-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
C-bugCategory: bugCategory: bugO-bsdS-waiting-on-decisionversion-supportThis is a discussion related to supported versions that may require a decision.This is a discussion related to supported versions that may require a decision.
Milestone
Description
The detection of freebsd
version invokes a freebsd-version
executable:
Lines 122 to 123 in 5f7c6c1
fn which_freebsd() -> Option<i32> { | |
let output = std::process::Command::new("freebsd-version").output().ok(); |
however that only meaningfully works when building on a freebsd host. When building on any other host and targeting a freebsd, libc
will always default to targeting a freebsd11.0:
Lines 26 to 34 in 5f7c6c1
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(_) | None => println!("cargo:rustc-cfg=freebsd11"), | |
} |
Thus making it difficult to e.g.
- Cross-compile a library or binary that relies on freebsd12.0 or freebsd13.0 APIs;
- CI test other libraries that rely on freebsd12.0 or freebsd13.0 APIs.
Note that adding a freebsd-version
executable to the path is not a very viable solution – some builds running in parallel may target other versions of freebsd too.
raphaelcohn
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugO-bsdS-waiting-on-decisionversion-supportThis is a discussion related to supported versions that may require a decision.This is a discussion related to supported versions that may require a decision.