diff --git a/.github/actions/rust-cache/action.yml b/.github/actions/rust-cache/action.yml index 9174e268d6..902eb34822 100644 --- a/.github/actions/rust-cache/action.yml +++ b/.github/actions/rust-cache/action.yml @@ -28,7 +28,7 @@ runs: # whatever the runner image ships: the compiler these jobs build with # exists only inside `nix develop`. The `toolchain` input is no help # either, since it names a rustup toolchain and probes - # `rustc + -vV`, and nothing installs 1.95.0 through rustup. + # `rustc + -vV`, and nothing installs that channel through rustup. # # flake.lock pins that compiler, so hashing the flake identifies it more # precisely than `rustc -vV` would, and rolls the cache when the dev diff --git a/Cargo.toml b/Cargo.toml index eaff3f0ab6..5adfd2a778 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,9 +90,9 @@ ignored = ["getrandom"] # it to 1.95 (sysinfo 0.39), and moq-cli does too because it depends on that # library. Those crates are applications; the point of the per-crate override # is to keep the bump off the libraries others actually build on. The nix flake -# / rust-toolchain.toml pin the build toolchain to 1.95 (so the whole workspace -# including the relay compiles) rather than latest stable, which keeps the -# relay's ceiling from creeping up unnoticed. +# / rust-toolchain.toml pin the build toolchain to a fixed version rather than +# latest stable, which keeps the relay's ceiling from creeping up unnoticed. +# That pin sits above every MSRV here; rust-toolchain.toml says why. rust-version = "1.91" [workspace.dependencies] diff --git a/flake.nix b/flake.nix index 28fd8f1064..48971bef39 100644 --- a/flake.nix +++ b/flake.nix @@ -59,10 +59,12 @@ # Pinned build toolchain (not latest stable) so `nix develop` and CI # compile against a fixed rustc and the relay's MSRV can't creep up - # unnoticed. Set to moq-relay's 1.95 (the highest crate MSRV in the - # workspace) so the whole workspace, including the relay, builds; the - # library crates declare a lower 1.91 floor (Cargo.toml rust-version). - rust-toolchain = pkgs.rust-bin.stable."1.95.0".default.override { + # unnoticed. The floor is 1.98, not the 1.95 relay MSRV: earlier rustc + # strips Mach-O debuginfo with an llvm-objcopy that leaves the LINKEDIT + # string pool 4-byte aligned, which macOS 27's dyld refuses to load, so + # release-profile proc macros and cdylibs are a coin flip there. The + # crates still declare their own lower floors (Cargo.toml rust-version). + rust-toolchain = pkgs.rust-bin.stable."1.98.1".default.override { extensions = [ "rust-src" "rust-analyzer" diff --git a/nix/overlay.nix b/nix/overlay.nix index 29fd04cb62..d9d4b48853 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -2,13 +2,12 @@ { crane }: final: prev: let - # Pin crane to the workspace MSRV (Cargo.toml rust-version / - # rust-toolchain.toml) so `nix build` uses the same toolchain as - # `nix develop` and release artifacts build with the version CI verifies. - # Without an explicit toolchain, crane falls back to `final.rustc`/ - # `final.cargo`, which nixpkgs resolves to its own default Rust. + # Pin crane to the same build toolchain as rust-toolchain.toml / flake.nix so + # `nix build` uses what `nix develop` does and release artifacts build with + # the version CI verifies. Without an explicit toolchain, crane falls back to + # `final.rustc`/`final.cargo`, which nixpkgs resolves to its own default Rust. # - rustToolchain = final.rust-bin.stable."1.95.0".default; + rustToolchain = final.rust-bin.stable."1.98.1".default; craneLib = (crane.mkLib final).overrideToolchain rustToolchain; # Helper function to get crate info from Cargo.toml diff --git a/rs/kio/src/waiter.rs b/rs/kio/src/waiter.rs index 03bdbd2df6..3403d25e36 100644 --- a/rs/kio/src/waiter.rs +++ b/rs/kio/src/waiter.rs @@ -808,6 +808,10 @@ mod tests { #[test] fn park_retires_a_waiter_for_another_task() { struct Nop; + // Not `Waker::noop()`, which clippy suggests: that is a singleton, so the two + // wakers below would name the same task and the assertion would pass without + // testing anything. What this needs is two wakers that do nothing and differ. + #[expect(clippy::manual_noop_waker, reason = "the two wakers must not be identical")] impl std::task::Wake for Nop { fn wake(self: Arc) {} } diff --git a/rs/moq-relay/src/web.rs b/rs/moq-relay/src/web.rs index da850250c6..07caaa5bb9 100644 --- a/rs/moq-relay/src/web.rs +++ b/rs/moq-relay/src/web.rs @@ -762,6 +762,8 @@ async fn admit_http( } /// Serve the announced broadcasts for a given prefix. +// The `Err` is axum's own `ErrorResponse`, so there is nothing here to box. +#[expect(clippy::result_large_err, reason = "the error type is axum's, not ours")] async fn serve_announced( path: Option>, Query(query): Query, @@ -799,6 +801,8 @@ async fn serve_announced( } /// Serve the given group for a given track +// The `Err` is axum's own `ErrorResponse`, so there is nothing here to box. +#[expect(clippy::result_large_err, reason = "the error type is axum's, not ours")] async fn serve_fetch( Path(path): Path, Query(params): Query, diff --git a/rs/moq-relay/src/websocket.rs b/rs/moq-relay/src/websocket.rs index e478a7a941..8b8457bbba 100644 --- a/rs/moq-relay/src/websocket.rs +++ b/rs/moq-relay/src/websocket.rs @@ -19,6 +19,8 @@ use crate::{auth, web::MtlsPeer, web::WebState, web::landing_response}; // One axum extractor per fact the upgrade needs; there is no struct to fold them into. #[allow(clippy::too_many_arguments)] +// The `Err` is axum's own `ErrorResponse`, so there is nothing here to box. +#[expect(clippy::result_large_err, reason = "the error type is axum's, not ours")] pub(crate) async fn serve_ws( ws: Result, OriginalUri(uri): OriginalUri, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index fe13b196b0..b869731cbf 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,9 @@ [toolchain] -# Pinned to the build toolchain: moq-relay's 1.95 (the highest crate MSRV), so -# the whole workspace compiles. NOT the 1.91 workspace library floor in -# Cargo.toml. Keep in sync with flake.nix / nix/overlay.nix. -channel = "1.95.0" +# Pinned to the build toolchain, NOT the 1.91 workspace library floor or the +# 1.95 relay MSRV in Cargo.toml. It has to be at least 1.98: below that, rustc +# strips Mach-O debuginfo with an llvm-objcopy that leaves the LINKEDIT string +# pool 4-byte aligned, and macOS 27's dyld refuses to load such an image. That +# makes every release-profile proc macro and cdylib (moq-ffi, moq-gst) a coin +# flip there. Keep in sync with flake.nix / nix/overlay.nix. +channel = "1.98.1" components = ["rustfmt", "clippy"]