Skip to content

Commit abe73ab

Browse files
authored
Merge pull request #4187 from tgross35/backport-romanesco
[0.2] Backports
2 parents cec6aa9 + 1e2da75 commit abe73ab

File tree

35 files changed

+180
-469
lines changed

35 files changed

+180
-469
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,20 @@ jobs:
4444
- uses: actions/checkout@v4
4545
- name: Setup Rust toolchain
4646
run: ./ci/install-rust.sh
47+
48+
# FIXME(ci): These `du` statements are temporary for debugging cache
49+
- name: Target size before restoring cache
50+
run: du -sh target | sort -k 2 || true
51+
- uses: Swatinem/rust-cache@v2
52+
with:
53+
key: ${{ matrix.os }}-${{ matrix.toolchain }}
54+
- name: Target size after restoring cache
55+
run: du -sh target | sort -k 2 || true
56+
4757
- name: Execute build.sh
4858
run: ./ci/verify-build.sh
59+
- name: Target size after job completion
60+
run: du -sh target | sort -k 2
4961

5062
test_tier1:
5163
name: Test tier1
@@ -82,6 +94,9 @@ jobs:
8294
- uses: actions/checkout@v4
8395
- name: Setup Rust toolchain
8496
run: ./ci/install-rust.sh
97+
- uses: Swatinem/rust-cache@v2
98+
with:
99+
key: ${{ matrix.target }}
85100
- name: Run natively
86101
if: "!matrix.docker"
87102
run: ./ci/run.sh ${{ matrix.target }}
@@ -133,6 +148,9 @@ jobs:
133148
- uses: actions/checkout@v4
134149
- name: Setup Rust toolchain
135150
run: ./ci/install-rust.sh
151+
- uses: Swatinem/rust-cache@v2
152+
with:
153+
key: ${{ matrix.target }}
136154
- name: Execute run-docker.sh
137155
run: ./ci/run-docker.sh ${{ matrix.target }}
138156

ci/verify-build.sh

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ if [ "$TOOLCHAIN" = "nightly" ] ; then
2828
rustup component add rust-src
2929
fi
3030

31+
# Print GHA workflow commands
32+
echo_if_ci() {
33+
# Discard stderr so the "set -x" trace doesn't show up
34+
{ [ -n "${CI:-}" ] && echo "$1"; } 2> /dev/null
35+
}
36+
3137
# Run the tests for a specific target
3238
test_target() {
33-
target="${1}"
34-
no_dist="${2:-0}"
39+
target="$1"
40+
no_dist="$2"
3541

3642
RUSTFLAGS="${RUSTFLAGS:-}"
3743

@@ -269,7 +275,13 @@ case "$rust" in
269275
*) supports_wasi_pn=0 ;;
270276
esac
271277

272-
for target in $targets; do
278+
some_tests_run=0
279+
280+
# Apply the `FILTER` variable, do OS-specific tasks, and run a target
281+
filter_and_run() {
282+
target="$1"
283+
no_dist="${2:-0}"
284+
273285
if echo "$target" | grep -q "$filter"; then
274286
if [ "$os" = "windows" ]; then
275287
TARGET="$target" ./ci/install-rust.sh
@@ -282,27 +294,28 @@ for target in $targets; do
282294

283295
# `wasm32-wasip2` only exists in recent versions of Rust
284296
if [ "$target" = "wasm32-wasip2" ] && [ "$supports_wasi_pn" = "0" ]; then
285-
continue
297+
return
286298
fi
287299

288-
test_target "$target"
289-
test_run=1
300+
test_target "$target" "$no_dist"
301+
some_tests_run=1
290302
fi
303+
}
304+
305+
for target in $targets; do
306+
echo_if_ci "::group::Target: $target"
307+
filter_and_run "$target"
308+
echo_if_ci "::endgroup::"
291309
done
292310

293311
for target in ${no_dist_targets:-}; do
294-
if echo "$target" | grep -q "$filter"; then
295-
if [ "$os" = "windows" ]; then
296-
TARGET="$target" ./ci/install-rust.sh
297-
fi
298-
299-
test_target "$target" 1
300-
test_run=1
301-
fi
312+
echo_if_ci "::group::Target: $target"
313+
filter_and_run "$target" 1
314+
echo_if_ci "::endgroup::"
302315
done
303316

304317
# Make sure we didn't accidentally filter everything
305-
if [ "${test_run:-}" != 1 ]; then
318+
if [ "$some_tests_run" != 1 ]; then
306319
echo "No tests were run"
307320
exit 1
308321
fi

libc-test/build.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ fn do_cc() {
4242
|| target.contains("l4re")
4343
|| target.contains("android")
4444
|| target.contains("emscripten")
45+
|| target.contains("solaris")
46+
|| target.contains("illumos")
4547
{
4648
cc::Build::new().file("src/sigrt.c").compile("sigrt");
4749
}
@@ -2060,9 +2062,9 @@ fn test_android(target: &str) {
20602062
| "PF_IO_WORKER"
20612063
| "PF_WQ_WORKER"
20622064
| "PF_FORKNOEXEC"
2065+
| "PF_MCE_PROCESS"
20632066
| "PF_SUPERPRIV"
20642067
| "PF_DUMPCORE"
2065-
| "PF_MCE_PROCESS"
20662068
| "PF_SIGNALED"
20672069
| "PF_MEMALLOC"
20682070
| "PF_NPROC_EXCEEDED"
@@ -2078,6 +2080,7 @@ fn test_android(target: &str) {
20782080
| "PF_NO_SETAFFINITY"
20792081
| "PF_MCE_EARLY"
20802082
| "PF_MEMALLOC_PIN"
2083+
| "PF_BLOCK_TS"
20812084
| "PF_SUSPEND_TASK" => true,
20822085

20832086
_ => false,
@@ -2649,6 +2652,11 @@ fn test_freebsd(target: &str) {
26492652
// Added in FreeBSD 14.0
26502653
"TCP_FUNCTION_ALIAS" if Some(14) > freebsd_ver => true,
26512654

2655+
// These constants may change or disappear in future OS releases, and they probably
2656+
// have no legitimate use in applications anyway.
2657+
"CAP_UNUSED0_44" | "CAP_UNUSED0_57" | "CAP_UNUSED1_22" | "CAP_UNUSED1_57" |
2658+
"CAP_ALL0" | "CAP_ALL1" => true,
2659+
26522660
_ => false,
26532661
}
26542662
});
@@ -4308,12 +4316,17 @@ fn test_linux(target: &str) {
43084316
| "PF_RANDOMIZE"
43094317
| "PF_NO_SETAFFINITY"
43104318
| "PF_MCE_EARLY"
4311-
| "PF_MEMALLOC_PIN" => true,
4319+
| "PF_MEMALLOC_PIN"
4320+
| "PF_BLOCK_TS"
4321+
| "PF_SUSPEND_TASK" => true,
43124322

43134323
// FIXME: Requires >= 6.9 kernel headers.
43144324
"EPIOCSPARAMS"
43154325
| "EPIOCGPARAMS" => true,
43164326

4327+
// FIXME: Requires >= 6.11 kernel headers.
4328+
"MAP_DROPPABLE" => true,
4329+
43174330
_ => false,
43184331
}
43194332
});

libc-test/semver/linux-gnu.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ HUGETLB_FLAG_ENCODE_64KB
7878
HUGETLB_FLAG_ENCODE_8MB
7979
HUGETLB_FLAG_ENCODE_MASK
8080
HUGETLB_FLAG_ENCODE_SHIFT
81-
IFA_FLAGS
82-
IFA_F_MANAGETEMPADDR
83-
IFA_F_MCAUTOJOIN
84-
IFA_F_NODAD
85-
IFA_F_NOPREFIXROUTE
86-
IFA_F_STABLE_PRIVACY
8781
INIT_PROCESS
8882
ISOFS_SUPER_MAGIC
8983
JFFS2_SUPER_MAGIC
@@ -656,6 +650,7 @@ malloc_stats
656650
malloc_trim
657651
malloc_usable_size
658652
mallopt
653+
mempcpy
659654
mq_notify
660655
nl_mmap_hdr
661656
nl_mmap_req

libc-test/semver/linux.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,12 +923,18 @@ IFA_ADDRESS
923923
IFA_ANYCAST
924924
IFA_BROADCAST
925925
IFA_CACHEINFO
926+
IFA_FLAGS
926927
IFA_F_DADFAILED
927928
IFA_F_DEPRECATED
928929
IFA_F_HOMEADDRESS
930+
IFA_F_MANAGETEMPADDR
931+
IFA_F_MCAUTOJOIN
932+
IFA_F_NODAD
933+
IFA_F_NOPREFIXROUTE
929934
IFA_F_OPTIMISTIC
930935
IFA_F_PERMANENT
931936
IFA_F_SECONDARY
937+
IFA_F_STABLE_PRIVACY
932938
IFA_F_TEMPORARY
933939
IFA_F_TENTATIVE
934940
IFA_LABEL
@@ -1586,6 +1592,7 @@ MADV_UNMERGEABLE
15861592
MADV_WILLNEED
15871593
MADV_WIPEONFORK
15881594
MAP_DENYWRITE
1595+
MAP_DROPPABLE
15891596
MAP_EXECUTABLE
15901597
MAP_FILE
15911598
MAP_FIXED_NOREPLACE
@@ -2084,40 +2091,67 @@ PF_ASH
20842091
PF_ATMPVC
20852092
PF_ATMSVC
20862093
PF_AX25
2094+
PF_BLOCK_TS
20872095
PF_BLUETOOTH
20882096
PF_BRIDGE
20892097
PF_CAIF
20902098
PF_CAN
20912099
PF_DECnet
2100+
PF_DUMPCORE
20922101
PF_ECONET
2102+
PF_EXITING
2103+
PF_FORKNOEXEC
2104+
PF_IDLE
20932105
PF_IEEE802154
2106+
PF_IO_WORKER
20942107
PF_IPX
20952108
PF_IRDA
20962109
PF_ISDN
20972110
PF_IUCV
20982111
PF_KEY
2112+
PF_KSWAPD
2113+
PF_KTHREAD
20992114
PF_LLC
21002115
PF_LOCAL
2116+
PF_LOCAL_THROTTLE
21012117
PF_MASKOS
21022118
PF_MASKPROC
2119+
PF_MCE_EARLY
2120+
PF_MCE_PROCESS
2121+
PF_MEMALLOC
2122+
PF_MEMALLOC_NOFS
2123+
PF_MEMALLOC_NOIO
2124+
PF_MEMALLOC_PIN
21032125
PF_NETBEUI
21042126
PF_NETLINK
21052127
PF_NETROM
21062128
PF_NFC
2129+
PF_NOFREEZE
2130+
PF_NO_SETAFFINITY
2131+
PF_NPROC_EXCEEDED
21072132
PF_PACKET
21082133
PF_PHONET
2134+
PF_POSTCOREDUMP
21092135
PF_PPPOX
21102136
PF_R
2137+
PF_RANDOMIZE
21112138
PF_RDS
21122139
PF_ROSE
21132140
PF_ROUTE
21142141
PF_RXRPC
21152142
PF_SECURITY
2143+
PF_SIGNALED
21162144
PF_SNA
2145+
PF_SUPERPRIV
2146+
PF_SUSPEND_TASK
21172147
PF_TIPC
2148+
PF_USED_MATH
2149+
PF_USER_WORKER
2150+
PF_VCPU
21182151
PF_VSOCK
21192152
PF_W
21202153
PF_WANPIPE
2154+
PF_WQ_WORKER
21212155
PF_X
21222156
PF_X25
21232157
PIPE_BUF

libc-test/semver/solarish.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ LIO_WAIT
1616
LIO_WRITE
1717
PIPE_BUF
1818
SIGEV_PORT
19+
SIGRTMAX
20+
SIGRTMIN
1921
_POSIX_VDISABLE
2022
_ST_FSTYPSZ
2123
aio_cancel

libc-test/semver/unix.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ localtime_r
638638
lseek
639639
lstat
640640
malloc
641+
memccpy
641642
memchr
642643
memcmp
643644
memcpy

libc-test/test/sigrt.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
target_os = "linux",
55
target_os = "l4re",
66
target_os = "android",
7-
target_os = "emscripten"
7+
target_os = "emscripten",
8+
target_os = "solaris",
9+
target_os = "illumos",
810
))]
911
mod t {
1012
use libc;

src/fuchsia/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,8 @@ cfg_if! {
13401340
}
13411341
}
13421342

1343+
// FIXME(msrv): suggested method was added in 1.85
1344+
#[allow(unpredictable_function_pointer_comparisons)]
13431345
impl PartialEq for sigevent {
13441346
fn eq(&self, other: &sigevent) -> bool {
13451347
self.sigev_value == other.sigev_value

src/macros.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ macro_rules! s_no_extra_traits {
159159
$(#[$attr])*
160160
pub union $i { $($field)* }
161161
}
162+
163+
#[cfg(feature = "extra_traits")]
164+
impl ::core::fmt::Debug for $i {
165+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
166+
f.debug_struct(::core::stringify!($i)).finish_non_exhaustive()
167+
}
168+
}
162169
);
163170

164171
(it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (

src/unix/aix/mod.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -575,14 +575,6 @@ cfg_if! {
575575
}
576576
}
577577
impl Eq for __sigaction_sa_union {}
578-
impl fmt::Debug for __sigaction_sa_union {
579-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
580-
f.debug_struct("__sigaction_sa_union")
581-
.field("__su_handler", unsafe { &self.__su_handler })
582-
.field("__su_sigaction", unsafe { &self.__su_sigaction })
583-
.finish()
584-
}
585-
}
586578
impl hash::Hash for __sigaction_sa_union {
587579
fn hash<H: hash::Hasher>(&self, state: &mut H) {
588580
unsafe {
@@ -627,15 +619,6 @@ cfg_if! {
627619
}
628620
}
629621
impl Eq for __poll_ctl_ext_u {}
630-
impl fmt::Debug for __poll_ctl_ext_u {
631-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
632-
f.debug_struct("__poll_ctl_ext_u")
633-
.field("addr", unsafe { &self.addr })
634-
.field("data32", unsafe { &self.data32 })
635-
.field("data", unsafe { &self.data })
636-
.finish()
637-
}
638-
}
639622
impl hash::Hash for __poll_ctl_ext_u {
640623
fn hash<H: hash::Hasher>(&self, state: &mut H) {
641624
unsafe {

0 commit comments

Comments
 (0)