Skip to content

Commit f82006a

Browse files
authored
Merge pull request #129 from mulimoen/bugfix/CI
Fix CI
2 parents a6e7d6b + fbe7b55 commit f82006a

File tree

6 files changed

+25
-21
lines changed

6 files changed

+25
-21
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- master
57
pull_request:
68
branches:
79
- master
@@ -94,7 +96,7 @@ jobs:
9496
uses: actions-rs/toolchain@v1
9597
with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true}
9698
- name: Install conda
97-
uses: goanpeca/setup-miniconda@v1
99+
uses: conda-incubator/setup-miniconda@v2
98100
with: {auto-update-conda: false, activate-environment: testenv}
99101
- name: Install HDF5 (${{matrix.version}}${{matrix.mpi && '-' || ''}}${{matrix.mpi}})
100102
run: |
@@ -124,6 +126,9 @@ jobs:
124126
- name: Checkout repository
125127
uses: actions/checkout@v2
126128
with: {submodules: true}
129+
- name: Change to older toolchain
130+
if: matrix.os == 'macos'
131+
run: sudo xcode-select -s "/Applications/Xcode_11.7.app"
127132
- name: Install Rust (${{matrix.rust}})
128133
uses: actions-rs/toolchain@v1
129134
with: {toolchain: '${{matrix.rust}}', profile: minimal, override: true}
@@ -165,7 +170,7 @@ jobs:
165170
fail-fast: false
166171
matrix:
167172
rust: [stable]
168-
version: [1.8, '1.10']
173+
version: ["1.8", "1.10", "1.12"]
169174
steps:
170175
- name: Checkout repository
171176
uses: actions/checkout@v2
@@ -176,18 +181,22 @@ jobs:
176181
- name: Configure environment
177182
shell: bash
178183
run: |
179-
if [ "${{matrix.version}}" == "1.8" ]; then
184+
if [[ "${{matrix.version}}" == "1.8" ]]; then
180185
VERSION=1.8.21
181186
DL_PATH=hdf5-1.8.21-Std-win7_64-vs14.zip
182-
echo ::set-env name=MSI_PATH::hdf\\HDF5-1.8.21-win64.msi
183-
else
187+
echo "MSI_PATH=hdf\\HDF5-1.8.21-win64.msi" >> $GITHUB_ENV
188+
elif [[ "${{matrix.version}}" == "1.10" ]]; then
184189
VERSION=1.10.0
185190
DL_PATH=windows/extra/hdf5-1.10.0-win64-VS2015-shared.zip
186-
echo ::set-env name=MSI_PATH::hdf5\\HDF5-1.10.0-win64.msi
191+
echo "MSI_PATH=hdf5\\HDF5-1.10.0-win64.msi" >> $GITHUB_ENV
192+
else
193+
VERSION=1.12.0
194+
DL_PATH=hdf5-1.12.0-Std-win10_64-vs16.zip
195+
echo "MSI_PATH=hdf\\HDF5-1.12.0-win64.msi" >> $GITHUB_ENV
187196
fi
188197
BASE_URL=https://support.hdfgroup.org/ftp/HDF5/prev-releases
189-
echo ::set-env name=DL_URL::$BASE_URL/hdf5-${{matrix.version}}/hdf5-$VERSION/bin/$DL_PATH
190-
echo ::add-path::C:\\Program Files\\HDF_Group\\HDF5\\$VERSION\\bin
198+
echo "DL_URL=$BASE_URL/hdf5-${{matrix.version}}/hdf5-$VERSION/bin/$DL_PATH" >> $GITHUB_ENV
199+
echo "C:\\Program Files\\HDF_Group\\HDF5\\$VERSION\\bin" >> $GITHUB_PATH
191200
- name: Install HDF5 (${{matrix.version}})
192201
shell: pwsh
193202
run: |

hdf5-sys/src/h5s.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::internal_prelude::*;
66

77
pub const H5S_ALL: hid_t = 0;
88

9-
pub const H5S_UNLIMITED: hsize_t = (-1 as hssize_t) as _;
9+
pub const H5S_UNLIMITED: hsize_t = -1_i32 as _;
1010

1111
pub const H5S_MAX_RANK: c_uint = 32;
1212

src/hl/group.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl Group {
189189
}
190190

191191
let callback_fn: H5L_iterate_t = Some(members_callback);
192-
let iteration_position: *mut hsize_t = &mut { 0 as u64 };
192+
let iteration_position: *mut hsize_t = &mut { 0_u64 };
193193
let mut result: Vec<String> = Vec::new();
194194
let other_data: *mut c_void = &mut result as *mut _ as *mut c_void;
195195

src/hl/plist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub fn set_vlen_manager_libc(plist: hid_t) -> Result<()> {
215215
panic::catch_unwind(|| unsafe { libc::malloc(size) }).unwrap_or(ptr::null_mut())
216216
}
217217
extern "C" fn free(ptr: *mut c_void, _info: *mut libc::c_void) {
218-
let _ = panic::catch_unwind(|| unsafe { libc::free(ptr) });
218+
let _p = panic::catch_unwind(|| unsafe { libc::free(ptr) });
219219
}
220220
h5try!(H5Pset_vlen_mem_manager(
221221
plist,

src/hl/plist/file_access.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,15 +1157,12 @@ impl FileAccessBuilder {
11571157
}
11581158

11591159
pub fn core_options(&mut self, increment: usize, filebacked: bool) -> &mut Self {
1160-
let mut drv = CoreDriver::default();
1161-
drv.increment = increment;
1162-
drv.filebacked = filebacked;
1160+
let drv = CoreDriver { increment, filebacked, ..CoreDriver::default() };
11631161
self.driver(&FileDriver::Core(drv))
11641162
}
11651163

11661164
pub fn core_filebacked(&mut self, filebacked: bool) -> &mut Self {
1167-
let mut drv = CoreDriver::default();
1168-
drv.filebacked = filebacked;
1165+
let drv = CoreDriver { filebacked, ..CoreDriver::default() };
11691166
self.driver(&FileDriver::Core(drv))
11701167
}
11711168

@@ -1585,11 +1582,8 @@ impl FileAccess {
15851582
self.get_family().map(FileDriver::Family)
15861583
} else if drv_id == *H5FD_MULTI {
15871584
let multi = self.get_multi()?;
1588-
if let Some(split) = SplitDriver::from_multi(&multi) {
1589-
Ok(FileDriver::Split(split))
1590-
} else {
1591-
Ok(FileDriver::Multi(multi))
1592-
}
1585+
SplitDriver::from_multi(&multi)
1586+
.map_or(Ok(FileDriver::Multi(multi)), |split| Ok(FileDriver::Split(split)))
15931587
} else {
15941588
fail!("unknown or unsupported file driver (id: {})", drv_id);
15951589
}

src/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub fn string_from_cstr(string: *const c_char) -> String {
1616
/// Convert a `String` or a `&str` into a zero-terminated string (`const char *`).
1717
pub fn to_cstring<S: Borrow<str>>(string: S) -> Result<CString> {
1818
let string = string.borrow();
19+
#[allow(clippy::map_err_ignore)]
1920
CString::new(string).map_err(|_| format!("null byte in string: {:?}", string).into())
2021
}
2122

0 commit comments

Comments
 (0)