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

Fix missing SO_* values #4242

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

snogge
Copy link
Contributor

@snogge snogge commented Jan 14, 2025

Some identifiers for #4148 was missing, and this was not detected because verify-build does not rebuild when
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 is set.

Fix the verify-build task by using a separate target-dir and add the missing identifiers

This is probably not the best way of structuring the CI steps, it could also be set up using a matrix in the verify-build task of ci.yml.

Sources

https://github.com/torvalds/linux/blob/master/arch/mips/include/uapi/asm/socket.h#L125
https://github.com/torvalds/linux/blob/master/arch/powerpc/include/uapi/asm/socket.h
https://github.com/torvalds/linux/blob/master/tools/include/uapi/asm-generic/socket.h

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@@ -73,7 +72,7 @@ test_target() {

if [ "$os" = "linux" ]; then
# Test with the equivalent of __USE_TIME_BITS64
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd --target-dir "target/$target-time64"
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of the changes to this file, could you add println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64") to build.rs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've pushed an attempt. It seems to trigger rebuilds, but I'm not sure it's in the right place.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you just mean the right place within build.rs? If so, I would put it immediately before/after the env is read at let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok(); so it's easy to see they go together.

LGTM otherwise, note that CI will fail until a rust-lang/rust fix gets into nightly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my question. I moved things around a bit to collect the linux_time_bits64 stuff in one place as much as possible.

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jan 27, 2025
@snogge snogge force-pushed the linux-time64-fixes branch from a5e53d7 to 45eefd1 Compare January 27, 2025 11:28
Collect the linux_time_bits64 in one place.
The _NEW defines are not available in musl and ohos.
@snogge snogge force-pushed the linux-time64-fixes branch from 45eefd1 to 57ffa6c Compare January 27, 2025 13:37
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks for following up, this looks good to merge as soon as CI gets fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI Area: CI-related items O-linux O-mips O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants