Skip to content

Commit

Permalink
Merge pull request #3 from metno/feature/static-hdf5-1.14.4
Browse files Browse the repository at this point in the history
Use hdf5 1.14.4 in static build
  • Loading branch information
magnusuMET committed Aug 8, 2024
2 parents 9adc9c3 + 9b8f1b6 commit 0e01290
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 47 deletions.
87 changes: 43 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
include:
- {os: ubuntu, rust: stable}
- {os: windows, rust: stable-msvc}
- {os: windows, rust: stable-gnu}
# - {os: windows, rust: stable-gnu}
- {os: macos, rust: stable}
steps:
- name: Checkout repository
Expand All @@ -152,7 +152,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with: {toolchain: '${{matrix.rust}}'}
- name: Build and test all crates
run: cargo test --workspace -v --features hdf5-sys/static,hdf5-sys/zlib --exclude hdf5-derive
run: cargo test --workspace -vvv --features hdf5-sys/static,hdf5-sys/zlib --exclude hdf5-derive
- name: Build and test with filters and other features
run: cargo test --workspace -v --features hdf5-sys/static,hdf5-sys/zlib,lzf,blosc,f16,complex --exclude hdf5-derive
if: matrix.rust != 'stable-gnu'
Expand Down Expand Up @@ -242,31 +242,31 @@ jobs:
- name: Build and test all crates
run: cargo test -vv

mingw:
name: mingw
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
rust: [stable]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with: {submodules: true}
- name: Install Rust (${{matrix.rust}})
uses: dtolnay/rust-toolchain@stable
with: {toolchain: '${{matrix.rust}}', targets: x86_64-pc-windows-gnu}
- name: Install HDF5
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-hdf5 mingw-w64-x86_64-pkgconf
- name: Build and test all crates
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;"
cargo test -vv --target=x86_64-pc-windows-gnu
# mingw:
# name: mingw
# runs-on: windows-latest
# strategy:
# fail-fast: false
# matrix:
# rust: [stable]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with: {submodules: true}
# - name: Install Rust (${{matrix.rust}})
# uses: dtolnay/rust-toolchain@stable
# with: {toolchain: '${{matrix.rust}}', targets: x86_64-pc-windows-gnu}
# - name: Install HDF5
# shell: pwsh
# run: |
# $env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
# C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
# C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-hdf5 mingw-w64-x86_64-pkgconf
# - name: Build and test all crates
# shell: pwsh
# run: |
# $env:PATH="$env:PATH;C:\msys64\mingw64\bin;"
# cargo test -vv --target=x86_64-pc-windows-gnu

msrv:
name: Minimal Supported Rust Version
Expand All @@ -284,23 +284,22 @@ jobs:
run:
cargo test --workspace -vv --features=hdf5-sys/static,hdf5-sys/zlib --exclude=hdf5-derive

wine:
name: wine
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with: {submodules: true}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
# Last version to support Wine pre 8.13
with: {toolchain: "1.75", targets: x86_64-pc-windows-gnu}
- name: Install dependencies
run: sudo apt-get update && sudo apt install wine64 mingw-w64
- name: Build and test
env:
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER: wine64
run: cargo test --workspace --features hdf5-sys/static --target x86_64-pc-windows-gnu --exclude=hdf5-derive
# wine:
# name: wine
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with: {submodules: true}
# - name: Install Rust
# uses: dtolnay/rust-toolchain@stable
# with: {toolchain: stable, targets: x86_64-pc-windows-gnu}
# - name: Install dependencies
# run: sudo apt-get update && sudo apt install wine64 mingw-w64
# - name: Build and test
# env:
# CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER: wine64
# run: cargo test --workspace --features hdf5-sys/static --target x86_64-pc-windows-gnu --exclude=hdf5-derive

addr_san:
name: Address sanitizer
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
library which is threadsafe.
- Requesting a feature which is not compiled in the dynamic HDF5 library will
now cause a compile time error.
- The bundled version of HDF5 in `hdf5-src` is now 1.14.3.

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions hdf5-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn main() {
"HDF5_BUILD_CPP_LIB",
"HDF5_BUILD_UTILS",
"HDF5_ENABLE_PARALLEL",
"HDF5_ENABLE_NONSTANDARD_FEATURES",
] {
cfg.define(option, "OFF");
}
Expand All @@ -30,6 +31,7 @@ fn main() {
"HDF5_ENABLE_THREADSAFE",
"ALLOW_UNSUPPORTED",
"HDF5_BUILD_HL_LIB",
"HDF5_ENABLE_NONSTANDARD_FEATURE_FLOAT16",
] {
cfg.define(option, "OFF");
}
Expand All @@ -44,6 +46,8 @@ fn main() {
.define("ZLIB_STATIC_LIBRARY", zlib_lib);
println!("cargo:zlib_header={}", zlib_header.to_str().unwrap());
println!("cargo:zlib={}", zlib_lib);
} else {
cfg.define("HDF5_ENABLE_Z_LIB_SUPPORT", "OFF");
}

if feature_enabled("DEPRECATED") {
Expand Down
2 changes: 1 addition & 1 deletion hdf5-src/ext/hdf5
Submodule hdf5 updated 4553 files
8 changes: 6 additions & 2 deletions hdf5-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Version {
}

pub fn parse(s: &str) -> Option<Self> {
let re = Regex::new(r"^(1)\.(8|10|12|14)\.(\d\d?)(_\d+)?((-|.)(patch)?\d+)?$").ok()?;
let re = Regex::new(r"^(1)\.(8|10|12|14)\.(\d\d?)(_|.\d+)?((-|.)(patch)?\d+)?$").ok()?;
let captures = re.captures(s)?;
Some(Self {
major: captures.get(1).and_then(|c| c.as_str().parse::<u8>().ok())?,
Expand Down Expand Up @@ -659,7 +659,7 @@ impl Config {
let mut vs: Vec<_> = (5..=21).map(|v| Version::new(1, 8, v)).collect(); // 1.8.[5-23]
vs.extend((0..=8).map(|v| Version::new(1, 10, v))); // 1.10.[0-10]
vs.extend((0..=2).map(|v| Version::new(1, 12, v))); // 1.12.[0-2]
vs.extend((0..=1).map(|v| Version::new(1, 14, v))); // 1.14.[0-1]
vs.extend((0..=4).map(|v| Version::new(1, 14, v))); // 1.14.[0-4]
for v in vs.into_iter().filter(|&v| version >= v) {
println!("cargo:rustc-cfg=feature=\"{}.{}.{}\"", v.major, v.minor, v.micro);
println!("cargo:version_{}_{}_{}=1", v.major, v.minor, v.micro);
Expand All @@ -684,6 +684,10 @@ impl Config {
println!("cargo:rustc-cfg=feature=\"have-filter-deflate\"");
println!("cargo:have_filter_deflate=1");
}

if cfg!(windows) && version >= Version::new(1, 14, 0) {
println!("cargo:rustc-link-lib=shlwapi");
}
}

fn check_against_features_required(&self) {
Expand Down

0 comments on commit 0e01290

Please sign in to comment.