[0.2] Backports - #5532
Merged
Merged
[0.2] Backports#5532
Conversation
Also fix a few lints. (backport <rust-lang#5461>) (cherry picked from commit 6930883)
Avoid an error when the commit message contains a word like "don't" that ends the `'`-quoted string. Also fix a few lints. (backport <rust-lang#5463>) (cherry picked from commit 0cbe30a)
* File PRs against both branches separately. This avoids the need to backport lockfile bumps, which always conflicts. * Swap to biweekly lockfile maintenance * Add applicable stable-* labels * Clean up some inconsistent syntax (backport <rust-lang#5467>) (cherry picked from commit 9a7a284)
…lowing are sources to each platform's `paths.h`: From BSD: * [Apple](https://github.com/apple-oss-distributions/Libc/blob/71bbe350ab79eef58113991d817ccc6165061a64/include/paths.h#L65): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [Dragonfly](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/42aaacafd14ddb7f660730a5ca5da0a2d941723a/include/paths.h#L40): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [FreeBSD](https://github.com/freebsd/freebsd-src/blob/551b7c5e12bfea623a47edf97ad5689732a1233f/include/paths.h#L40): Has `_PATH_BSHELL` and `_PATH_DEFPATH` (verified same values on version 11+) * [NetBSD](https://github.com/NetBSD/src/blob/f66621237dc60126bd8a972b6064639892b344b7/include/paths.h#L43): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [OpenBSD](https://github.com/openbsd/src/blob/7d89a3e823169cb6a1d989e3f5f93f7f3c4b5db4/include/paths.h#L39): Has `_PATH_BSHELL` and `_PATH_DEFPATH` From Linux: * [Android](https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/paths.h#48): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [glibc](https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/paths.h;h=1342ab3a96ab12065311b718e57e7235e07587f8;hb=HEAD#l36): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [musl](https://git.musl-libc.org/cgit/musl/tree/include/paths.h?id=f21a96538f78fa8e2040831b4209b35f2fb581da#n4): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [uClibc](https://github.com/kraj/uClibc/blob/ca1c74d67dd115d059a875150e10b8560a9c35a8/include/paths.h#L36): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [emscripten](https://github.com/emscripten-core/emscripten/blob/a2059f978ed206b688daf4a8774211949610c2aa/system/lib/libc/musl/include/paths.h#L4): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * l4re: There's [musl](https://github.com/l4re/l4re-core/blob/d09b1619c45d17786bc256ea219688f8ba3ff1fe/libc/musl/contrib/musl/include/paths.h#L4) and [uclibc](https://github.com/l4re/l4re-core/blob/d09b1619c45d17786bc256ea219688f8ba3ff1fe/libc/uclibc-ng/contrib/uclibc/include/paths.h#L36) `paths.h` file containing `_PATH_BSHELL` and `_PATH_DEFPATH` values Miscellaneous Platforms: * [Haiku](https://github.com/haiku/haiku/blob/8a33129223e93ea046dc62e9e09f8c93f45cfb7b/headers/compatibility/bsd/paths.h#L45): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [Hurd](https://github.com/joshumax/hurd/blob/83a6fc7641eecdb2b96c2dee2261da92573693de/hurd/paths.h#L20): Doesn't have `_PATH_BSHELL` and `_PATH_DEFPATH` in paths.h (wouldn't hurt to confirm this though in terminal) * [Cygwin](https://github.com/cygwin/cygwin/blob/cf61e0140e3d6cd21e743a38d35efc98194b63f3/winsup/cygwin/include/paths.h#L12): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [newlib](https://github.com/ourairquality/newlib/blob/0dea38754696422d526543262274703acd8317c5/newlib/libc/include/paths.h#L7): Has `_PATH_BSHELL` * [Redox](https://gitlab.redox-os.org/redox-os/relibc/-/blob/c3b3f2773a3a2622fdb632a9bfa1a77d68778150/include/paths.h): Has `_PATH_BSHELL` Platforms I'm unsure if they have `_PATH_BSHELL`/`_PATH_DEFPATH`: * Solarish: I'm unsure how to get this info since I believe Solaris is closed source? * AIX: I think this is also closed source? However, I saw this [archive repo](https://github.com/Arquivotheca/AIX-4.1.3/blob/d6fe8fe8299ececc0db4fae9c19cd3babffd28ae/bos/usr/include/paths.h#L36) of AIX 4.13 that has `_PATH_BSHELL`. * [nuttx](https://github.com/apache/nuttx): Couldn't find a `include/paths.h` file. * [NTO/QNX](https://github.com/qnx): Couldn't find a `include/paths.h` file. (backport <rust-lang#5449>) (cherry picked from commit 89a22c6)
Link: https://github.com/kraj/musl/blob/cec26f5164f0deede51ed36591f58fca19c10795/include/sys/socket.h#L99-L225 (backport <rust-lang#5471>) (cherry picked from commit 2deb3b2)
Nest and re-export `io::sys`, and re-export other `bits` modules into top level to match how things are imported via `bits/`. (backport <rust-lang#5472>) (cherry picked from commit df4fd88)
Renovate didn't like scheduling for an exact minute, and instead requires a range. (backport <rust-lang#5470>) (cherry picked from commit 819314b)
`tmpnam` is TOCTOU-prone and not thread-safe if called with NULL, and has been marked obsolete by POSIX [1] and glibc [2]. `tempnam` is also TOCTOU-prone and marked obsolete by POSIX [3], and glib docs say "Never use this function". We don't have these on all platforms, but mark them deprecated where they still exist. Closes: rust-lang#5211 [1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/tmpnam.html [2]: https://man7.org/linux/man-pages/man3/tmpnam.3.html [3]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tempnam.html [4]: https://man7.org/linux/man-pages/man3/tempnam.3.html (backport <rust-lang#5478>) (cherry picked from commit 0f65977)
(backport <rust-lang#5479>) (cherry picked from commit d25215c)
ctest must not support nonpublic constant types, during testing we get
get:
cargo:warning=/checkout/target/x86_64-unknown-linux-gnu/debug/build/libc-test/5b4faecd46dc6111/out/ctest_output.c:4929:8: error: unknown type name '__socket_type'; did you mean '__socklen_t'?
cargo:warning= 4929 | static __socket_type ctest_const_SOCK_STREAM_val_static = SOCK_STREAM;
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning= | __socklen_t
cargo:warning=/checkout/target/x86_64-unknown-linux-gnu/debug/build/libc-test/5b4faecd46dc6111/out/ctest_output.c:4931:14: error: unknown type name '__socket_type'; use 'enum' keyword to refer to the type
cargo:warning= 4931 | CTEST_EXTERN __socket_type *ctest_const__SOCK_STREAM(void) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning= | enum
cargo:warning=/checkout/target/x86_64-unknown-linux-gnu/debug/build/libc-test/5b4faecd46dc6111/out/ctest_output.c:4935:8: error: unknown type name '__socket_type'; did you mean '__socklen_t'?
cargo:warning= 4935 | static __socket_type ctest_const_SOCK_DGRAM_val_static = SOCK_DGRAM;
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning= | __socklen_t
cargo:warning=/checkout/target/x86_64-unknown-linux-gnu/debug/build/libc-test/5b4faecd46dc6111/out/ctest_output.c:4937:14: error: unknown type name '__socket_type'; use 'enum' keyword to refer to the type
cargo:warning= 4937 | CTEST_EXTERN __socket_type *ctest_const__SOCK_DGRAM(void) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning= | enum
Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/socket/sys/socket.h
Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/sysdeps/unix/sysv/linux/bits/socket.h
Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/sysdeps/unix/sysv/linux/bits/socket_type.h
Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/sysdeps/unix/sysv/linux/mips/bits/socket_type.h
Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/sysdeps/unix/sysv/linux/sparc/bits/socket_type.h
(backport <rust-lang#5479>)
(cherry picked from commit 0136060)
(backport <rust-lang#5485>) (cherry picked from commit 50af125)
(backport <rust-lang#5485>) (cherry picked from commit 4e4a96a)
Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/socket/sys/socket.h Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/sysdeps/unix/sysv/linux/bits/socket.h Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/sysdeps/unix/sysv/linux/mips/bits/socket_type.h Link: https://github.com/sailfishos-mirror/glibc/blob/fe03757f67e25bc8fea1473572beb30a05508d08/sysdeps/unix/sysv/linux/sparc/bits/socket_type.h Link: https://github.com/kraj/musl/blob/cec26f5164f0deede51ed36591f58fca19c10795/include/sys/socket.h Link: https://github.com/kraj/musl/blob/cec26f5164f0deede51ed36591f58fca19c10795/arch/mips/bits/socket.h Link: https://github.com/kraj/musl/blob/cec26f5164f0deede51ed36591f58fca19c10795/arch/mips64/bits/socket.h Link: https://github.com/wbx-github/uclibc-ng/blob/e73186b69999c043b075348b5fcabc586cf76a83/include/sys/socket.h Link: https://github.com/wbx-github/uclibc-ng/blob/e73186b69999c043b075348b5fcabc586cf76a83/libc/sysdeps/linux/common/bits/socket_type.h Link: https://github.com/wbx-github/uclibc-ng/blob/e73186b69999c043b075348b5fcabc586cf76a83/libc/sysdeps/linux/mips/bits/socket_type.h (backport <rust-lang#5484>) (cherry picked from commit d5c45a8)
Make things a bit more type safe and prepare for better checks. (backport <rust-lang#5490>) (cherry picked from commit 1f24be2)
Adjust configuration so that we are not e.g. setting `freebsd12` on non-FreeBSD targets, and add assertions that similar configuration setups make sense. This also means we aren't spending the (small) time to invoke version-fetching commands on targets where they won't even be used. (backport <rust-lang#5491>) (cherry picked from commit 6840d7b)
(backport <rust-lang#5491>) (cherry picked from commit 7e30c32)
All that is needed is some import adjustments. Closes: rust-lang#2064 (backport <rust-lang#5492>) (cherry picked from commit 23bab1e)
(backport <rust-lang#5495>) (cherry picked from commit ec167ae)
RISC-V 32-bit only provides time64 variants for these syscalls. Use the time64 syscall numbers and remove the generic names that refer to unavailable time32 syscalls. Sources: https://github.com/torvalds/linux/blob/v7.1/arch/riscv/kernel/Makefile.syscalls https://github.com/torvalds/linux/blob/v7.1/include/uapi/asm-generic/unistd.h#L269 https://github.com/bminor/glibc/blob/glibc-2.42/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h#L64-L68 Closes rust-lang#5379 (backport <rust-lang#5455>) (cherry picked from commit 181ab01)
(backport <rust-lang#5506>) (cherry picked from commit 7e9f749)
MUSL_REDIR_TIME64_ARCHES are just the 32-bit arches that aren't 1.2-only, i.e. the opposite of the 32-bit arches that always set `musl_v1_2 = true`. Merge the logic for these two. riscv32 is added to this list since it is in the same boat. Additionally, restructure things to make the logic flow more clear. (backport <rust-lang#5508>) (cherry picked from commit 4042869)
(backport <rust-lang#5508>) (cherry picked from commit 008f905)
(backport <rust-lang#5469>) (cherry picked from commit 77e9b41)
(backport <rust-lang#5493>) (cherry picked from commit 5cf8e76)
It's been a few months, so nudge to a version past the LLVM update. This fixes the m68k LLVM issue, but libc still does not build on that platform. (backport <rust-lang#5513>) (cherry picked from commit 92a41dd)
(backport <rust-lang#5514>) (cherry picked from commit 60b56d1)
These constants were disabled for uclibc (and therefore implicitly disabled for L4Re). Now that they are not disabled for uclibc anymore, explicitly disable them for L4Re. (backport <rust-lang#5515>) (cherry picked from commit 7470c73)
Source: https://github.com/torvalds/linux/blob/v6.10/include/uapi/linux/magic.h#L40 (backport <rust-lang#5516>) (cherry picked from commit c610b5f)
In Alpine, we have to set both the old and new `cfg` *and* the environment variable since various versions of libc are being used by packaged software. This will then emit the warnings about the options being deprecated, even though we fully intentionally set them. I believe the primary purpose of the warnings is to tell people to migrate to the new `cfg`, so we can just not print a warning if musl 1.2 is being opted into via a different way (and the `cfg` or env var has no effect) already. (backport <rust-lang#5517>) (cherry picked from commit df65616)
(backport <rust-lang#5526>) (cherry picked from commit 6b98995)
Collaborator
|
- Modify `struct_with_default` to automatically add a private field to all records such that they are always built field-by-field in downstream crates. - Add support for `exhaustive` custom attribute to opt out of having the record have a `__non_exhaustive` field added to it. - Annotate records without private fields under `src/new/helenos/time.rs` and `src/new/linux_uapi/linux/can.rs` with `exhaustive` attribute. (backport <rust-lang#5390>) (cherry picked from commit ee87176)
Add tests to ensure two things about the private field added to enforce non-exhaustiveness in records declared within `s_with_default` and `s_no_extra_traits_with_default`. - Ensure the field is added only if the `exhaustive` attribute is not found while munching the annotated attributes of the record item. - Ensure the `exhaustive` attribute also works when it appears between other sets of attributes. (backport <rust-lang#5390>) (cherry picked from commit 2614ed8)
tgross35
force-pushed
the
backport-red
branch
from
September 17, 2026 07:45
037ed20 to
a65b5c8
Compare
Collaborator
|
- Rename `s_with_default`, `s_no_extra_traits_with_default` and `struct_with_default` to `s2`, `s_no_extra_traits2`, and `custom_struct`. These macros now both add a `Default` impl and a private field to enforce non-exhaustiveness. - Rewrap comments and doc comments to follow 80 and 100 columns guides. (backport <rust-lang#5390>) (cherry picked from commit 0c0db5c)
tgross35
force-pushed
the
backport-red
branch
from
September 17, 2026 07:46
a65b5c8 to
171beaf
Compare
https://github.com/redox-os/relibc/blob/381772ec81fced6d055f0f0ba6fa92c7f3256fbb/src/header/stdio/constants.rs#L8 (backport <rust-lang#5530>) (cherry picked from commit d3ec7b3)
tgross35
force-pushed
the
backport-red
branch
from
September 17, 2026 08:04
171beaf to
0c17322
Compare
tgross35
enabled auto-merge
September 17, 2026 08:04
This file contains hidden or 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
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 the following:
exhaustiveattribute #5390_PATH_BSHELLand_PATH_DEFPATHwhere available #5449printf#5463mainandlibc-0.2#5467socket.rs#5471tmpnam,tempnam#5478socket.hconstants tosrc/new#5479socket.hdefinitions tosrc/new#5484rustc-dep-of-stdwork withextra-traits#5492rustc-dep-of-stdwork in tests #5495uninit#5514BCACHEFS_SUPER_MAGICconstant #5516__f_unusedtostatvfs64on riscv32 #5518siginfo_tdefinition #5521siginfo_tfield #5523i686-pc-windows-msvcas without host tools #5526