rust-lang / libc

Raw bindings to platform APIs for Rust
https://docs.rs/libc
Apache License 2.0
2.07k stars 1.04k forks source link

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

Closed RalfJung closed 3 months ago

RalfJung commented 4 months ago

Currently, when rustc_dep_of_std is set, the freebsd version used depends on the return value of which_freebsd():

That does not seem intended? It is certainly rather odd that when building on FreeBSD 13 we'd get the freebsd11 API, but when building on FreeBSD 12 we get freebsd12. This also causes some "fun" for Miri when cross-building the freebsd std on other targets: which_freebsd() then returns None, so std uses different symbols than it does in the std that is shipped by rustup.

I assume the intention of https://github.com/rust-lang/libc/pull/3434 was to force std to use freebsd12 when rustc_dep_of_std is set (at least that's what the comments seem to say), so let's implement that.

rustbot commented 4 months ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

RalfJung commented 2 months ago

@JohnTitor any chance of seeing a libc release with this change any time soon? That should allow a bit of cleanup in Miri. :)

RalfJung commented 1 month ago

Oh, I didn't realize that the branch for releases on crates.io is separate from main... should I just create a version of this PR against the libc-0.2 branch or how does that work?

tgross35 commented 1 month ago

The branches are unfortunately pretty divergent, so I have just been requesting everyone to always target main and, if it should be backported, @rustbot label +stable-nominated. I cherry pick them in batches.

I'll get this into a release within the next couple of days.

RalfJung commented 1 month ago

Okay cool, thanks :)

On August 17, 2024 8:40:48 PM UTC, Trevor Gross @.***> wrote:

The branches are unfortunately pretty divergent, so I have just been requesting everyone to always target main and @.*** label +stable-nominated` for things that should get backported. I cherry pick them in batches.

I'll get this into a release within the next couple of days.

-- Reply to this email directly or view it on GitHub: https://github.com/rust-lang/libc/pull/3723#issuecomment-2294980030 You are receiving this because you modified the open/close state.

Message ID: @.***>

tgross35 commented 1 month ago

@RalfJung this should be available in 0.2.157 now