-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[0.2]: fix: make sure the const-extern-fn feature is enabled #4135
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @JohnTitor rustbot has assigned @JohnTitor. Use |
We haven't been running any tests associated with the `libc` crate, make sure we do this here. Also simplify some redundant things in the script. (backport <rust-lang#4134>) (cherry picked from commit e0c4e5b)
By default, any functions defined in this macro (such as `CMSG_SPACE`) should be `const`. (backport <rust-lang#4134>) (cherry picked from commit 0304ed5) No change in the cherry pick since the function came from libc-0.2 originally.
For some reason, running unit tests in CI gives the following on Android: ```text 2024-11-23T02:17:49.1406378Z Running unittests src/lib.rs (target/i686-linux-android/debug/deps/libc-79430fca1af8b7ec) 2024-11-23T02:17:49.1432206Z * daemon not running; starting now at tcp:5037 2024-11-23T02:17:52.1460169Z * daemon started successfully 2024-11-23T02:18:00.1454112Z adb: error: failed to copy '/checkout/target/i686-linux-android/debug/deps/libc-79430fca1af8b7ec' to '/data/local/tmp/libc-79430fca1af8b7ec': remote secure_mkdirs failed: Read-only file system 2024-11-23T02:18:00.1457084Z /checkout/target/i686-linux-android/debug/deps/libc-79430fca1af8b7ec: 1 file pushed, 0 skipped. 19.3 MB/s (5418952 bytes in 0.267s) 2024-11-23T02:18:00.3757282Z thread 'main' panicked at /tmp/runtest.rs:26:5: 2024-11-23T02:18:00.3758028Z assertion failed: status.success() 2024-11-23T02:18:00.3758589Z stack backtrace: 2024-11-23T02:18:00.3810307Z 0: rust_begin_unwind 2024-11-23T02:18:00.3811230Z at /rustc/a47555110cf09b3ed59811d9b02235443e76a595/library/std/src/panicking.rs:665:5 2024-11-23T02:18:00.3812225Z 1: core::panicking::panic_fmt 2024-11-23T02:18:00.3813089Z at /rustc/a47555110cf09b3ed59811d9b02235443e76a595/library/core/src/panicking.rs:76:14 2024-11-23T02:18:00.3814034Z 2: core::panicking::panic 2024-11-23T02:18:00.3814860Z at /rustc/a47555110cf09b3ed59811d9b02235443e76a595/library/core/src/panicking.rs:148:5 2024-11-23T02:18:00.3815756Z 3: runtest::main 2024-11-23T02:18:00.3816545Z 4: core::ops::function::FnOnce::call_once 2024-11-23T02:18:00.3817848Z note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. 2024-11-23T02:18:00.3822763Z error: test failed, to rerun pass `--lib` ``` And on s390x: ``` + grep -Ev ^\[ KASLR disabled: CPU has no PRNG /prog: /lib/s390x-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /prog) + grep -E (PASSED)|(test result: ok) output /prog: /lib/s390x-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /prog) error: test failed, to rerun pass `--lib` ``` For now, don't run unit tests on these platforms. (backport <rust-lang#4134>) (cherry picked from commit f5fdb56)
This was dropped in fa554bc on `main` and 674cc1f on `libc-0.2` ("Drop the libc_const_extern_fn conditional"). Unfortunately, this meant that functions were incorrectly never getting marked `const`, which showed up with `CMSG_SPACE` [1]. Instead of the fix here, I attempted to just use `cfg(not(libc_ctest))` instead of a Cargo feature to enable `const` extern functions; however, this seemed extremely problematic with `ctest` for some reason [2]. Instead, leave the feature as-is and just make it enabled by default. Fixes: rust-lang#4115 [1] [2]: rust-lang#4134 (backport <rust-lang#4134>) (cherry picked from commit 19e9e6a)
tgross35
force-pushed
the
backport-fix-constness
branch
from
November 25, 2024 11:09
7475047
to
c2bded3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #4134