Skip to content

Commit f489272

Browse files
authored
Merge pull request #149 from magnusuMET/bugfix/ci
Whitelist versions emitted by netcdf-sys
2 parents 010b07d + d382ce3 commit f489272

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
- {os: ubuntu-latest, rust: stable}
119119
- {os: windows-latest, rust: stable-msvc}
120120
- {os: windows-latest, rust: stable-gnu}
121-
- {os: macos-11, rust: stable}
121+
- {os: macos-12, rust: stable}
122122
- {os: macos-latest, rust: stable}
123123
defaults:
124124
run:

netcdf-sys/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ fn main() {
294294
Version::new(4, 9, 0),
295295
Version::new(4, 9, 1),
296296
Version::new(4, 9, 2),
297+
// Keep this list up to date with netcdf/build.rs
297298
];
298299

299300
for version in &versions {

netcdf/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ mpi-sys = { workspace = true, optional = true }
3535
clap = { version = "4.5.1", features = ["derive"] }
3636
tempfile = "3.1.0"
3737

38+
[build-dependencies]
39+
semver = "1.0.23"
40+
3841
[package.metadata.docs.rs]
3942
features = ["static"]
4043
rustdoc-args = ["--cfg", "docsrs"]

netcdf/build.rs

+27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1+
use semver::Version;
2+
13
fn main() {
24
println!("cargo::rustc-check-cfg=cfg(feature, values(\"has-mmap\"))");
5+
let versions = [
6+
Version::new(4, 4, 0),
7+
Version::new(4, 4, 1),
8+
Version::new(4, 5, 0),
9+
Version::new(4, 6, 0),
10+
Version::new(4, 6, 1),
11+
Version::new(4, 6, 2),
12+
Version::new(4, 6, 3),
13+
Version::new(4, 7, 0),
14+
Version::new(4, 7, 1),
15+
Version::new(4, 7, 2),
16+
Version::new(4, 7, 3),
17+
Version::new(4, 7, 4),
18+
Version::new(4, 8, 0),
19+
Version::new(4, 8, 1),
20+
Version::new(4, 9, 0),
21+
Version::new(4, 9, 1),
22+
Version::new(4, 9, 2),
23+
// Keep this list up to date with netcdf-sys/build.rs
24+
];
25+
26+
for version in &versions {
27+
println!("cargo::rustc-check-cfg=cfg(feature, values(\"{version}\"))");
28+
}
29+
330
if std::env::var("DEP_NETCDF_HAS_MMAP").is_ok() {
431
println!("cargo::rustc-cfg=feature=\"has-mmap\"");
532
}

0 commit comments

Comments
 (0)