Upgrade to Rust 1.98.1 and align dependencies with EdgeZero - #1123
Upgrade to Rust 1.98.1 and align dependencies with EdgeZero#1123aram356 wants to merge 7 commits into
Conversation
Match the toolchain and shared dependency pins to EdgeZero PR #366 so both workspaces resolve the same major versions. Toolchain: Rust 1.95.0 to 1.98.1, Node 24.12.0 to 24.20.0, Fastly CLI 15.1.0 to 16.0.0, Viceroy 0.17.0 to 0.21.0, wasmtime 44.0.1 to 48.0.1. CI derives each from `.tool-versions`, so only that file and `rust-toolchain.toml` pin them. EdgeZero moves from tag v0.0.7 to the PR #366 head revision. The latest tag, v0.0.8, still carries the 1.95 toolchain and the previous majors, so it would contradict the pins below. Restore a tag once #366 merges. Shared majors: fastly and log-fastly 0.12 to 0.13, spin-sdk ~6.0 to ~7.0, validator 0.20 to 0.21, sha2 0.10 to 0.11. brotli stays at 8 for the reason recorded in #366: async-compression still resolves 8, so taking 9 adds a second decompressor stack rather than replacing one. sha2 0.11 moves RustCrypto to `hybrid_array`, which forces two further majors this workspace needs but #366 did not: hmac 0.12 to 0.13 and chacha20poly1305 0.10 to 0.11. Their fallout is three lines: - `new_from_slice` moved from `Mac` to `KeyInit`, so `ec/generation.rs` and `s3_sigv4.rs` bring that trait into scope. HMAC output is unchanged, verified byte-for-byte against 0.12 for both a short key and a block-length key, so persisted EC IDs and SigV4 signatures stay valid. - `Array` does not implement `LowerHex` as `GenericArray` did, so `settings_data.rs` formats via `hex::encode`. sha2 0.11 also pulls crypto-common 0.2, which depends on getrandom 0.4. That line renamed the browser RNG feature from `js` to `wasm_js`, so the Cloudflare target needs a second getrandom entry to enable it. The Fastly adapter does not build on this branch: `esi` 0.7.2 pins fastly ^0.12 while EdgeZero requires 0.13, and both meet in `esi_assembly.rs`. Upstream `fastly/esi` main is still on ^0.12.
Point the Viceroy install command at 0.21.0 in the getting-started,
testing and error-reference guides, the integration-tests README, and
the three scripts that name it in their prerequisites.
Fill in the Rust and NodeJS versions in the getting-started
prerequisites. Both were `{{RUST_VERSION}}` / `{{NODEJS_VERSION}}`
placeholders with no substitution step anywhere in the repo, so the
published page rendered the braces literally.
`docs/superpowers/**` keeps its 1.95 and 0.17.0 mentions: those are
dated design records describing the stack as it stood when each was
written.
`hybrid_array` deprecates `from_slice` in favour of `TryFrom`, which is an error under the workspace's `-D warnings` clippy gate. The encode path builds a fixed `[u8; 24]`, so it converts infallibly via `XNonce::from`. The decode path takes a runtime slice, so it uses `XNonce::try_from` and returns `None` on a mismatch, matching the function's existing `Option` contract; the preceding length check already guarantees 24 bytes, so this is unreachable in practice and replaces a path that would previously have panicked. Both conversions yield an owned `XNonce` where `from_slice` yielded a reference, so the three use sites borrow explicitly.
`publisher.rs` imports `std::io::Write` at file scope, and the test module's `use super::*` already brings it in, so the module's own `Write as _` is redundant. Rust 1.98 reports it as an unused import, which is an error under the workspace's `-D warnings` gate. Confirmed new to the toolchain rather than pre-existing: clippy on `main` under 1.95 is clean against the identical pair of imports.
`run.rs` imports `Parser` at file scope, and the test module's `use super::*` already brings it in, so the module's own `Parser as _` is redundant. Same shape as the `publisher.rs` case: new under Rust 1.98, and an error under `-D warnings`. Missed in the first local pass because `cargo check` on the CLI runs neither `--all-targets` nor `-D warnings`; CI's clippy does both.
|
CI status after the two Rust 1.98 unused-import fixes. Passing: cross-adapter parity, cloudflare (native + wasm32-unknown-unknown), spin (native + wasm32-wasip1), ts CLI (native), vitest, format-typescript, format-docs, CodeQL. Failing — all four for the same reason: Each fails with the same two errors at the same two lines: That is #1122 and nothing else — no other failure mode appears in any of the four logs. Every job that does not build the Fastly adapter is green. Locally, with esi patched to |
`esi` 0.7.2 pins `fastly = "^0.12"` while EdgeZero requires 0.13. Both land in `trusted-server-adapter-fastly`, and `esi_assembly.rs` passes `fastly::Request` and `Response` across that boundary, so the two copies meet and the adapter fails to compile. The fork changes only the version ranges, in the library and the six examples that pin `fastly` themselves. No source changes: the crate compiles and its suite passes unmodified against 0.13. `fastly` 0.12 now drops out of the graph entirely, leaving one copy. Temporary. Drop this patch once the range bump is released upstream; tracked in #1122.
|
All CI checks pass with the esi patch in place. Every job that was failing on the esi type conflict is now green: The patch points at stackpop/esi@
The patch is temporary and commented as such. It should be dropped once the range bump is released upstream — #1122 tracks that. |
`{{RUST_VERSION}}` and `{{NODEJS_VERSION}}` were replaced with literal
versions on the mistaken belief that nothing substituted them. VitePress
does: `docs/.vitepress/config.mts` installs a markdown hook that reads
`.tool-versions` and replaces `{{<TOOL>_VERSION}}` for every tool listed
there. `{{FASTLY_VERSION}}`, four lines below in the same file, was
already relying on it.
Hardcoding the numbers dropped the guide out of that mechanism, so it
would have silently gone stale at the next toolchain bump. The
placeholders now resolve from the versions updated earlier in this
branch; verified against a real `npm run build`, whose rendered HTML
reads "Rust 1.98.1", "NodeJS 24.20.0" and "Fastly 16.0.0" with no
placeholder left unsubstituted.
Summary
Aligns the toolchain and shared dependency pins with EdgeZero PR stackpop/edgezero#366, so both workspaces resolve the same major versions instead of fighting each other.
The Fastly adapter does not build on this branch. That is a single external blocker, tracked in #1122 and detailed at the bottom. Everything else — core, Axum, Cloudflare, Spin, CLI — compiles, lints and tests clean.
Toolchain
CI derives every one of these from
.tool-versions, so only that file andrust-toolchain.tomlpin them — no workflow changes needed.EdgeZero
Moves from
tag = "v0.0.7"torev = 40c52e3f(the head of #366). Deliberately a rev, not a tag: the latest release, v0.0.8, still carries the 1.95 toolchain and the previous majors, so it would contradict every pin below. The comment at the pin says to restore a tag once #366 merges.Dependency majors
Matched to #366:
fastlyandlog-fastly0.12 → 0.13,spin-sdk~6.0 → ~7.0,validator0.20 → 0.21,sha20.10 → 0.11.brotlistays at 8, for the reason #366 records and measures:async-compressionstill resolves brotli 8, so taking 9 on the direct dependency adds a second decompressor stack rather than replacing one.Two further majors this workspace needs but #366 did not.
sha20.11 moves RustCrypto tohybrid_array, and the ecosystem has to cross together:hmac0.12 → 0.13 andchacha20poly13050.10 → 0.11. Without them,XChaCha20Poly1305::newreceives anArraywhere it expects aGenericArray.Source changes — six lines, no lint suppressions
Every fix addresses the actual API change. Nothing is silenced with
#[allow].new_from_slicemoved fromMactoKeyInitin hmac 0.13 —ec/generation.rsands3_sigv4.rsbring the trait into scope withas _.Arraydoes not implementLowerHexasGenericArraydid —settings_data.rsformats viahex::encode. (hexis already a dependency, already used for exactly this nearby. Hand-rolling hex is a trap: it tripsindexing_slicing, thenas-truncation, thenarithmetic_side_effectsin turn.)Array::from_sliceis deprecated in favour ofTryFrom, which is an error under-D warnings. Inhttp_util.rsthe encode path builds a fixed[u8; 24]and converts infallibly viaFrom; the decode path takes a runtime slice and usesTryFrom, returningNoneon a mismatch to match the function's existingOptioncontract — replacing a path that would previously have panicked.publisher.rs(std::io::Write) andcli/src/run.rs(clap::Parser) each import the trait at file scope, and the test module'suse super::*already brings it in, so the module's ownas _copy is unused. Confirmed new to the toolchain rather than pre-existing: clippy onmainunder 1.95 is clean against the identical pairs.getrandom
sha20.11 pullscrypto-common0.2, which depends ongetrandom0.4 without enabling its browser RNG feature. Onwasm32-unknown-unknownthat is a hardcompile_error!.A transitive dependency's features can only be enabled by declaring it directly, so
getrandom_04is a renamed-package entry alongside the existinggetrandom0.2 line. The repo already does exactly this for 0.2 withfeatures = ["js"]; 0.4 renamed that feature towasm_js, which is why the two need separate entries. Both majors are load-bearing.Behaviour is unchanged, and this was verified rather than assumed
hmac 0.13 could plausibly have changed digests for keys shorter than the block size — which would silently invalidate every persisted EC ID and S3 SigV4 signature. Built scratch crates against both versions and compared:
Byte-identical. Existing identities remain valid.
Documentation
Viceroy install command updated to 0.21.0 in the getting-started, testing and error-reference guides, the integration-tests README, and three scripts that name it in their prerequisites.
The getting-started prerequisites keep their
{{RUST_VERSION}}and{{NODEJS_VERSION}}placeholders.docs/.vitepress/config.mtsinstalls a markdown hook that reads.tool-versionsand substitutes{{<TOOL>_VERSION}}for every tool listed there, so those lines track the pins automatically and need no edit. Verified against a realnpm run build: the rendered HTML reads "Rust 1.98.1", "NodeJS 24.20.0" and "Fastly 16.0.0".docs/superpowers/**keeps its 1.95 and 0.17.0 mentions: dated design records describing the stack as it stood when each was written. Same exclusion #366 made.The blocker: esi pins fastly ^0.12 (#1122)
esi0.7.2 declaresfastly = "^0.12"while EdgeZero requires 0.13. Both land intrusted-server-adapter-fastly, andesi_assembly.rspassesfastly::http::Response/Requestacross that boundary, so it sees two incompatible copies of the same types. ESI is unconditional there, not feature-gated.The fix is one line and needs no source changes to esi. Cloning
fastly/esiat v0.7.2 and changing only the manifest range to^0.13compiles clean, and with that patched in locally the entire workspace builds, Fastly adapter included.Upstream
mainstill reads^0.12, and no open PR addresses it —fastly/esi#60is the v0.7.2 release bump, touching only the workspace version and lockfile. #1122 lays out the two paths (upstream PR and wait, or carry it on the existingstackpop/esifork behind[patch.crates-io]).Closes
Closes #1124
Depends on #1122 for the temporary
esipatch — that one stays open until the range bump is released upstream and the patch can be dropped.Test plan
Verified on
rustc 1.98.1, Node 24.20.0, Viceroy 0.21.0:cargo fmt --all -- --checkcargo clippy-axum,clippy-cloudflare,clippy-cloudflare-wasm,clippy-spin-native,clippy-spin-wasm— all clean under-D warningscargo test-axum— 38 passedcargo test-cloudflare— 40 passedcargo test-spin— 80 passedcargo test --package trusted-server-cli --target aarch64-apple-darwin— 209 passed, plus clippy--all-targets -D warningsnpm run formatnpm run formatFastly gates — pass, but only with the esi fix applied locally. They cannot run in CI until #1122 is resolved. With
[patch.crates-io]pointing at an esi clone whose only change isfastly = "^0.13":cargo clippy-fastly— clean under-D warningscargo test-fastly— 166 adapter (ESI assembly included) + 2290 core + 2 js + 21 openrtb + 3 doctests, 0 failed, under Viceroy 0.21.0That patch is not committed here. It exists only to prove the upgrade is sound and that #1122 is the sole thing standing in the way.
Review notes
The Fastly gates will be red in CI until #1122 is resolved, so that decision gates this merge. Everything else is green, and the run above shows the Fastly side passes the moment esi's range moves.
The
getrandom_04renamed-package entry is the one piece of unusual wiring and the thing most worth a second opinion.