Skip to content

Commit

Permalink
Auto merge of #2581 - GuillaumeGomez:freebsd-version, r=Amanieu
Browse files Browse the repository at this point in the history
Fix invalid freebsd version selection

Just realized when working on sysinfo that my `stafs` struct filled by `getmntinfo` was missing **a lot** of information. After trying to find out from my size what I missed, I simply check the `size_of` the rust struct vs the C struct and found `484 != 2384`. After looking a bit more, I discovered that only the CI was using the right freebsd version, which is quite problematic.

r? `@Amanieu`
  • Loading branch information
bors committed Dec 9, 2021
2 parents 6f661a8 + 53e79b8 commit 6fe1ff9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ fn main() {
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
// running tests to ensure that the ABI is correct.
match which_freebsd() {
Some(10) if libc_ci || rustc_dep_of_std => {
println!("cargo:rustc-cfg=freebsd10")
}
Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"),
Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"),
Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"),
Some(14) if libc_ci => println!("cargo:rustc-cfg=freebsd14"),
Some(10) => println!("cargo:rustc-cfg=freebsd10"),
Some(11) => println!("cargo:rustc-cfg=freebsd11"),
Some(12) => println!("cargo:rustc-cfg=freebsd12"),
Some(13) => println!("cargo:rustc-cfg=freebsd13"),
Some(14) => println!("cargo:rustc-cfg=freebsd14"),
Some(_) | None => println!("cargo:rustc-cfg=freebsd11"),
}

Expand Down

0 comments on commit 6fe1ff9

Please sign in to comment.