diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile index 7b8bdcfdadb32..d6927e5cc80ec 100644 --- a/ci/docker/aarch64-linux-android/Dockerfile +++ b/ci/docker/aarch64-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN dpkg --add-architecture i386 RUN apt-get update @@ -8,7 +8,6 @@ RUN apt-get install -y --no-install-recommends \ wget \ ca-certificates \ python3 \ - python3-distutils \ unzip \ expect \ openjdk-8-jre \ diff --git a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile index c94a7c63c0ea4..00569ddf22c9b 100644 --- a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 + RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates \ gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user diff --git a/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/ci/docker/aarch64-unknown-linux-musl/Dockerfile index bc15db0692297..fd4c1e28f2525 100644 --- a/ci/docker/aarch64-unknown-linux-musl/Dockerfile +++ b/ci/docker/aarch64-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc make libc6-dev git curl ca-certificates \ diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile index d0fb3176de7e7..9d6a5c9649832 100644 --- a/ci/docker/arm-linux-androideabi/Dockerfile +++ b/ci/docker/arm-linux-androideabi/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN dpkg --add-architecture i386 RUN apt-get update @@ -8,7 +8,6 @@ RUN apt-get install -y --no-install-recommends \ wget \ ca-certificates \ python3 \ - python3-distutils \ unzip \ expect \ openjdk-8-jre \ diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile index 977acabf4b6ba..8f2d3ea80d065 100644 --- a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -1,7 +1,11 @@ FROM ubuntu:23.10 -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev ca-certificates \ - gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user + +# FIXME(time): we are using an EOL release because 24.04 changes to 64-bit time +RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \ + /etc/apt/sources.list && \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc libc6-dev ca-certificates \ + gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \ PATH=$PATH:/rust/bin diff --git a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile index 1709699997e7f..f8a5d27df3b5f 100644 --- a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile +++ b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile @@ -1,8 +1,11 @@ FROM ubuntu:23.10 -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc make libc6-dev git curl ca-certificates \ - gcc-arm-linux-gnueabihf qemu-user +# FIXME(time): we are using an EOL release because 24.04 changes to 64-bit time +RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \ + /etc/apt/sources.list && \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc make libc6-dev git curl ca-certificates \ + gcc-arm-linux-gnueabihf qemu-user COPY install-musl.sh / RUN sh /install-musl.sh arm diff --git a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile index 585fdc35ff542..330493f54a1d1 100644 --- a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile +++ b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile @@ -1,6 +1,9 @@ FROM ubuntu:23.10 -RUN apt-get update && apt-get install -y --no-install-recommends \ +# FIXME(time): we are using an EOL release because 24.04 changes to 64-bit time +RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \ + /etc/apt/sources.list && \ + apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates qemu-system-arm curl \ xz-utils patch file diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile index d344cb1368f28..6f2d5ddfc78e1 100644 --- a/ci/docker/asmjs-unknown-emscripten/Dockerfile +++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 # This is a workaround to avoid the interaction with tzdata. ENV DEBIAN_FRONTEND=noninteractive @@ -14,7 +14,6 @@ RUN apt-get install -y --no-install-recommends \ libc6-dev \ libxml2 \ python3 \ - python3-distutils \ xz-utils \ bzip2 diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile index a78c7cb6e8457..0fb48aca342d4 100644 --- a/ci/docker/i686-linux-android/Dockerfile +++ b/ci/docker/i686-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN dpkg --add-architecture i386 RUN apt-get update @@ -8,7 +8,6 @@ RUN apt-get install -y --no-install-recommends \ wget \ ca-certificates \ python3 \ - python3-distutils \ unzip \ expect \ openjdk-8-jre \ diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile index 6cdc1942c50c7..fae0b566d33fc 100644 --- a/ci/docker/i686-unknown-linux-gnu/Dockerfile +++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile @@ -1,5 +1,10 @@ FROM ubuntu:23.10 -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - gcc-multilib libc6-dev ca-certificates + + +# FIXME(time): we are using an EOL release because 24.04 changes to 64-bit time +RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \ + /etc/apt/sources.list && \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc-multilib libc6-dev ca-certificates + ENV PATH=$PATH:/rust/bin diff --git a/ci/docker/i686-unknown-linux-musl/Dockerfile b/ci/docker/i686-unknown-linux-musl/Dockerfile index a54456fd9942b..4f36d2075485c 100644 --- a/ci/docker/i686-unknown-linux-musl/Dockerfile +++ b/ci/docker/i686-unknown-linux-musl/Dockerfile @@ -1,9 +1,12 @@ FROM ubuntu:23.10 -RUN dpkg --add-architecture i386 -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - gcc-multilib make libc6-dev git curl ca-certificates libc6-i386 + +# FIXME(time): we are using an EOL release because 24.04 changes to 64-bit time +RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \ + /etc/apt/sources.list && \ + dpkg --add-architecture i386 && \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc-multilib make libc6-dev git curl ca-certificates libc6-i386 COPY install-musl.sh / RUN sh /install-musl.sh i686 diff --git a/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile b/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile index aebf7c0741956..16b4cf4bfd34e 100644 --- a/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/loongarch64-unknown-linux-musl/Dockerfile b/ci/docker/loongarch64-unknown-linux-musl/Dockerfile index c1219c034c81f..2efd095b0fddd 100644 --- a/ci/docker/loongarch64-unknown-linux-musl/Dockerfile +++ b/ci/docker/loongarch64-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates curl gcc git libc6-dev make qemu-user xz-utils diff --git a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile index 930f0375db219..535202951d2ce 100644 --- a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile @@ -1,6 +1,9 @@ FROM ubuntu:23.10 -RUN apt-get update && apt-get install -y --no-install-recommends \ +# FIXME(time): we are using an EOL release because 24.04 changes to 64-bit time +RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \ + /etc/apt/sources.list && \ + apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \ qemu-system-ppc diff --git a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile index b5bf6e90dfbbd..76d8471a63aac 100644 --- a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile index f078a13e7c484..c4c6af25b8684 100644 --- a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile index 9ada79ac7273d..0624e2c102055 100644 --- a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/ci/docker/s390x-unknown-linux-gnu/Dockerfile index 70856d78bb879..306d773a61165 100644 --- a/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ b/ci/docker/s390x-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ diff --git a/ci/docker/s390x-unknown-linux-musl/Dockerfile b/ci/docker/s390x-unknown-linux-musl/Dockerfile index d93eba4bd48e6..d103a1d7488e0 100644 --- a/ci/docker/s390x-unknown-linux-musl/Dockerfile +++ b/ci/docker/s390x-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ diff --git a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile index ff6810a7fac58..4aff82ee46631 100644 --- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile @@ -1,3 +1,10 @@ +# FIXME(sparc): newer versions of Ubuntu get the following errors +# ``` +# /prog: /lib/sparc64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /prog) +# /prog: /lib/sparc64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /prog) +# ``` +# Not sure if this is a problem from rustc, our libc, or Ubuntu so we just +# stick with an old LTS for now. FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/ci/docker/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile index 0e429c055b200..5af38ca5258db 100644 --- a/ci/docker/wasm32-unknown-emscripten/Dockerfile +++ b/ci/docker/wasm32-unknown-emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 # This is a workaround to avoid the interaction with tzdata. ENV DEBIAN_FRONTEND=noninteractive @@ -17,7 +17,6 @@ RUN apt-get install -y --no-install-recommends \ libc6-dev \ libxml2 \ python3 \ - python3-distutils \ cmake \ sudo \ gdb \ diff --git a/ci/docker/wasm32-wasip1/Dockerfile b/ci/docker/wasm32-wasip1/Dockerfile index e1318151d2e62..68940f4615a7e 100644 --- a/ci/docker/wasm32-wasip1/Dockerfile +++ b/ci/docker/wasm32-wasip1/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM ubuntu:24.10 COPY wasi.sh / RUN bash /wasi.sh diff --git a/ci/docker/wasm32-wasip2/Dockerfile b/ci/docker/wasm32-wasip2/Dockerfile index c433c491353f9..7abaaf54da02d 100644 --- a/ci/docker/wasm32-wasip2/Dockerfile +++ b/ci/docker/wasm32-wasip2/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM ubuntu:24.10 COPY wasi.sh / RUN bash /wasi.sh diff --git a/ci/docker/x86_64-linux-android/Dockerfile b/ci/docker/x86_64-linux-android/Dockerfile index d4e87b5f419fc..f6331f10f3897 100644 --- a/ci/docker/x86_64-linux-android/Dockerfile +++ b/ci/docker/x86_64-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update && \ apt-get install -y --no-install-recommends \ @@ -7,7 +7,6 @@ RUN apt-get update && \ gcc \ libc-dev \ python3 \ - python3-distutils \ unzip WORKDIR /android/ diff --git a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile index aa5d5e043f9b1..b6ad33ebc7cb5 100644 --- a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 + RUN apt-get update RUN apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates linux-headers-generic diff --git a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile index 6cdc1942c50c7..f50af741db564 100644 --- a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 + RUN apt-get update RUN apt-get install -y --no-install-recommends \ gcc-multilib libc6-dev ca-certificates diff --git a/ci/docker/x86_64-unknown-linux-musl/Dockerfile b/ci/docker/x86_64-unknown-linux-musl/Dockerfile index 7b65f5fa2a8c1..11fbd6e1be46a 100644 --- a/ci/docker/x86_64-unknown-linux-musl/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:24.10 RUN apt-get update RUN apt-get install -y --no-install-recommends \ diff --git a/ci/style.sh b/ci/style.sh index d1b639db5bb89..17a47d037360a 100755 --- a/ci/style.sh +++ b/ci/style.sh @@ -14,6 +14,9 @@ rustc ci/style.rs && ./style src command -v rustfmt rustfmt -V +# Run once to cover everything that isn't in `src/` +cargo fmt + # Save a list of all source files tmpfile="file-list~" # trailing tilde for gitignore find src -name '*.rs' > "$tmpfile" diff --git a/libc-test/build.rs b/libc-test/build.rs index 4b5b7f41e3789..c8b1297d691ad 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4562,7 +4562,10 @@ fn test_linux(target: &str) { // `handle` is a VLA (struct_ == "fanotify_event_info_fid" && field == "handle") || // invalid application of 'sizeof' to incomplete type 'long unsigned int[]' - (musl && struct_ == "mcontext_t" && field == "__extcontext" && loongarch64) + (musl && struct_ == "mcontext_t" && field == "__extcontext" && loongarch64) || + // FIXME(#4121): a new field was added from `f_spare` + (struct_ == "statvfs" && field == "__f_spare") || + (struct_ == "statvfs64" && field == "__f_spare") }); cfg.skip_roundtrip(move |s| match s { diff --git a/src/macros.rs b/src/macros.rs index 19d567dfc3708..23fe345167100 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -197,13 +197,14 @@ macro_rules! e { // FIXME(ctest): ctest can't handle `const extern` functions, we should be able to remove this // cfg completely. +// FIXME(ctest): ctest can't handle `$(,)?` so we use `$(,)*` which isn't quite correct. cfg_if! { if #[cfg(feature = "const-extern-fn")] { /// Define an `unsafe` function that is const as long as `const-extern-fn` is enabled. macro_rules! f { ($( $(#[$attr:meta])* - pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty + pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block )*) => ($( #[inline] @@ -217,7 +218,7 @@ cfg_if! { macro_rules! safe_f { ($( $(#[$attr:meta])* - pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty + pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block )*) => ($( #[inline] @@ -231,7 +232,7 @@ cfg_if! { macro_rules! const_fn { ($( $(#[$attr:meta])* - $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty + $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block )*) => ($( #[inline] @@ -245,7 +246,7 @@ cfg_if! { macro_rules! f { ($( $(#[$attr:meta])* - pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty + pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block )*) => ($( #[inline] @@ -259,7 +260,7 @@ cfg_if! { macro_rules! safe_f { ($( $(#[$attr:meta])* - pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty + pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block )*) => ($( #[inline] @@ -273,7 +274,7 @@ cfg_if! { macro_rules! const_fn { ($( $(#[$attr:meta])* - $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty + $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block )*) => ($( #[inline]