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

build.rs: always use freebsd12 when rustc_dep_of_std is set #3723

Merged
merged 1 commit into from
Jun 15, 2024
Merged
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
23 changes: 15 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,21 @@ 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 => set_cfg("freebsd10"),
Some(11) if libc_ci => set_cfg("freebsd11"),
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
Copy link
Member Author

Choose a reason for hiding this comment

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

I just realized the previous logic for rustc_dep_of_std here wasn't what I thought it was...

The logic was: if the auto-detected version is 12 and rustc_dep_of_std is set, then use freebsd12. If the auto-detected version is anything else and rustc_dep_of_std is set, use freebsd11. If this was deliberate, I don't understand why, and it doesn't match the comments.

With my PR, the logic now is: if rustc_dep_of_std is set, don't even auto-detect, just use version 12. This matches what the comments already said before.

Some(13) if libc_ci => set_cfg("freebsd13"),
Some(14) if libc_ci => set_cfg("freebsd14"),
Some(15) if libc_ci => set_cfg("freebsd15"),
Some(_) | None => set_cfg("freebsd11"),
let which_freebsd = if libc_ci {
which_freebsd().unwrap_or(11)
} else if rustc_dep_of_std {
12
} else {
11
};
match which_freebsd {
x if x < 10 => panic!("FreeBSD older than 10 is not supported"),
10 => set_cfg("freebsd10"),
11 => set_cfg("freebsd11"),
12 => set_cfg("freebsd12"),
13 => set_cfg("freebsd13"),
14 => set_cfg("freebsd14"),
_ => set_cfg("freebsd15"),
}

match emcc_version_code() {
Expand Down