Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 1.14.4 as bundled HDF5 #243

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 43 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
fail-fast: false
matrix:
include:
- {version: [email protected]}
- {version: [email protected]}
- {version: [email protected]}
- {version: hdf5-mpi, mpi: true}
Expand Down Expand Up @@ -140,7 +139,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 @@ -150,7 +149,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 @@ -240,31 +239,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 @@ -282,22 +281,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
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
# 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()?;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the . intended to be escaped \.? If not, the regex can be shortened. In any case, I now see version strings "1.14.4-2".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably simplify it greatly by ignoring everything after number.number.number

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..=2).map(|v| Version::new(1, 14, v))); // 1.14.[0-2]
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
Loading