Repository: bytecodealliance/wasmtime
Pull request #9113 (2024-08-12 15:47:44)

Clean up dist build configuration
* Move updating `$PATH` to the `main.js` script which is the one that mounts `/rust/bin` so that knowledge isn't spread around.
* Remove some unused env vars in docker containers.
* Forward cargo/rust-specific env vars to the build from outside of containers to the build itself.

<!--
Please make sure you include the following information:

- If this work has been discussed elsewhere, please include a link to that
  conversation. If it was discussed in an issue, just mention "issue #...".

- Explain why this change is needed. If the details are in an issue already,
  this can be brief.

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->



Patch:
diff --git a/.github/actions/binary-compatible-builds/main.js b/.github/actions/binary-compatible-builds/main.js
index 6b72ebe2b..1101d78e4 100755
--- a/.github/actions/binary-compatible-builds/main.js
+++ b/.github/actions/binary-compatible-builds/main.js
@@ -32,7 +32,26 @@ if (process.env.INPUT_NAME && process.env.INPUT_NAME.indexOf("android") >= 0) {
 // commands in there with the `$CENTOS` env var.
 
 if (process.env.CENTOS !== undefined) {
-  const args = ['exec', '-w', process.cwd(), '-i', 'build-container'];
+  const args = ['exec', '--workdir', process.cwd(), '--interactive'];
+  // Forward any rust-looking env vars from the environment into the container
+  // itself.
+  for (let key in process.env) {
+    if (key.startsWith('CARGO') || key.startsWith('RUST')) {
+      args.push('--env');
+      args.push(key);
+    }
+  }
+  args.push('build-container')
+
+  // Start the container by appending to `$PATH` with the `/rust/bin` path that
+  // is mounted below.
+  args.push('bash');
+  args.push('-c');
+  args.push('export PATH=$PATH:/rust/bin; export RUSTFLAGS="$RUSTFLAGS $EXTRA_RUSTFLAGS"; exec "$@"');
+  args.push('bash');
+
+  // Add in whatever we're running which will get executed in the sub-shell with
+  // an augmented PATH.
   for (const arg of process.argv.slice(2)) {
     args.push(arg);
   }
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 6cb1cb03b..7fef12f50 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -147,6 +147,11 @@ jobs:
       run: cargo vet --locked
       continue-on-error: ${{ github.event_name == 'pull_request' }}
 
+    # Double-check that if versions are bumped that `cargo vet` still works.
+    # This is intended to weed out mistakes such as #9115 from happening again.
+    - run: rustc scripts/publish.rs && ./publish bump-patch && cargo vet
+      name: Ensure `cargo vet` works if versions are bumped
+
     # common logic to cancel the entire run if this job fails
     - run: gh run cancel ${{ github.run_id }}
       if: failure() && github.event_name != 'pull_request'
diff --git a/ci/docker/aarch64-linux/Dockerfile b/ci/docker/aarch64-linux/Dockerfile
index 152d268ba..b6dfc53cb 100644
--- a/ci/docker/aarch64-linux/Dockerfile
+++ b/ci/docker/aarch64-linux/Dockerfile
@@ -7,6 +7,4 @@ RUN apt-get update -y && apt-get install -y gcc gcc-aarch64-linux-gnu ca-certifi
 RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-x86_64.tar.gz | tar xzf -
 ENV PATH=$PATH:/cmake-3.29.3-linux-x86_64/bin
 
-ENV PATH=$PATH:/rust/bin
-ENV CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu
 ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
diff --git a/ci/docker/riscv64gc-linux/Dockerfile b/ci/docker/riscv64gc-linux/Dockerfile
index 38a25f07a..6d9a53bff 100644
--- a/ci/docker/riscv64gc-linux/Dockerfile
+++ b/ci/docker/riscv64gc-linux/Dockerfile
@@ -2,6 +2,4 @@ FROM ubuntu:22.04
 
 RUN apt-get update -y && apt-get install -y gcc gcc-riscv64-linux-gnu ca-certificates cmake
 
-ENV PATH=$PATH:/rust/bin
-ENV CARGO_BUILD_TARGET=riscv64gc-unknown-linux-gnu
 ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-linux-gnu-gcc
diff --git a/ci/docker/s390x-linux/Dockerfile b/ci/docker/s390x-linux/Dockerfile
index 13f6a83e0..a6d5a8677 100644
--- a/ci/docker/s390x-linux/Dockerfile
+++ b/ci/docker/s390x-linux/Dockerfile
@@ -7,6 +7,4 @@ RUN apt-get update -y && apt-get install -y gcc gcc-s390x-linux-gnu ca-certifica
 RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-x86_64.tar.gz | tar xzf -
 ENV PATH=$PATH:/cmake-3.29.3-linux-x86_64/bin
 
-ENV PATH=$PATH:/rust/bin
-ENV CARGO_BUILD_TARGET=s390x-unknown-linux-gnu
 ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc
diff --git a/ci/docker/x86_64-linux/Dockerfile b/ci/docker/x86_64-linux/Dockerfile
index a1bcdd23d..3271dba5a 100644
--- a/ci/docker/x86_64-linux/Dockerfile
+++ b/ci/docker/x86_64-linux/Dockerfile
@@ -1,5 +1,3 @@
 FROM almalinux:8
 
 RUN dnf install -y git gcc make cmake
-
-ENV PATH=$PATH:/rust/bin
diff --git a/ci/docker/x86_64-musl/Dockerfile b/ci/docker/x86_64-musl/Dockerfile
index c34c19bb8..ab2499d4d 100644
--- a/ci/docker/x86_64-musl/Dockerfile
+++ b/ci/docker/x86_64-musl/Dockerfile
@@ -9,9 +9,7 @@ FROM ubuntu:24.04
 RUN apt-get update -y && apt-get install -y cmake musl-tools
 COPY --from=libgcc_s_src /usr/lib/libgcc_s.so.1 /usr/lib/x86_64-linux-musl
 
-ENV PATH=$PATH:/rust/bin
-
 # Note that `-crt-feature` is passed here to specifically disable static linking
 # with musl. We want a `*.so` to pop out so static linking isn't what we want.
-ENV RUSTFLAGS=-Ctarget-feature=-crt-static
+ENV EXTRA_RUSTFLAGS=-Ctarget-feature=-crt-static
 ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc
diff --git a/cranelift/Cargo.toml b/cranelift/Cargo.toml
index 0d2b8fefa..74cff6db2 100644
--- a/cranelift/Cargo.toml
+++ b/cranelift/Cargo.toml
@@ -8,6 +8,7 @@ documentation = "https://github.com/bytecodealliance/wasmtime/blob/main/cranelif
 repository = "https://github.com/bytecodealliance/wasmtime"
 publish = false
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/bforest/Cargo.toml b/cranelift/bforest/Cargo.toml
index 516c8adff..41192317b 100644
--- a/cranelift/bforest/Cargo.toml
+++ b/cranelift/bforest/Cargo.toml
@@ -10,6 +10,7 @@ categories = ["no-std"]
 readme = "README.md"
 keywords = ["btree", "forest", "set", "map"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/bitset/Cargo.toml b/cranelift/bitset/Cargo.toml
index 959bfbaf9..841ac8f62 100644
--- a/cranelift/bitset/Cargo.toml
+++ b/cranelift/bitset/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 documentation = "https://docs.rs/cranelift-bitset"
 repository = "https://github.com/bytecodealliance/wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/codegen/Cargo.toml b/cranelift/codegen/Cargo.toml
index 47ba37904..5dd35f6b7 100644
--- a/cranelift/codegen/Cargo.toml
+++ b/cranelift/codegen/Cargo.toml
@@ -11,6 +11,7 @@ readme = "README.md"
 keywords = ["compile", "compiler", "jit"]
 build = "build.rs"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/codegen/meta/Cargo.toml b/cranelift/codegen/meta/Cargo.toml
index f3ba03931..f6f039c08 100644
--- a/cranelift/codegen/meta/Cargo.toml
+++ b/cranelift/codegen/meta/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/codegen/shared/Cargo.toml b/cranelift/codegen/shared/Cargo.toml
index cd59e3480..7628ba46a 100644
--- a/cranelift/codegen/shared/Cargo.toml
+++ b/cranelift/codegen/shared/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [dependencies]
 # Since this is a shared dependency of several packages, please strive to keep this dependency-free
diff --git a/cranelift/control/Cargo.toml b/cranelift/control/Cargo.toml
index 949e799b7..ebbc9447d 100644
--- a/cranelift/control/Cargo.toml
+++ b/cranelift/control/Cargo.toml
@@ -8,6 +8,7 @@ repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 keywords = ["fuzz", "test"]
 edition.workspace = true
+rust-version.workspace = true
 
 [dependencies]
 arbitrary = { workspace = true, optional = true }
diff --git a/cranelift/entity/Cargo.toml b/cranelift/entity/Cargo.toml
index 300d1f9f5..1c0c1bf0e 100644
--- a/cranelift/entity/Cargo.toml
+++ b/cranelift/entity/Cargo.toml
@@ -10,6 +10,7 @@ categories = ["no-std"]
 readme = "README.md"
 keywords = ["entity", "set", "map"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/frontend/Cargo.toml b/cranelift/frontend/Cargo.toml
index fc8f23af9..4352525dc 100644
--- a/cranelift/frontend/Cargo.toml
+++ b/cranelift/frontend/Cargo.toml
@@ -9,6 +9,7 @@ categories = ["no-std"]
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/fuzzgen/Cargo.toml b/cranelift/fuzzgen/Cargo.toml
index ac236f427..856828b2b 100644
--- a/cranelift/fuzzgen/Cargo.toml
+++ b/cranelift/fuzzgen/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lints]
diff --git a/cranelift/interpreter/Cargo.toml b/cranelift/interpreter/Cargo.toml
index af80eb0c7..c91482397 100644
--- a/cranelift/interpreter/Cargo.toml
+++ b/cranelift/interpreter/Cargo.toml
@@ -9,6 +9,7 @@ categories = ["no-std"]
 license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/isle/fuzz/Cargo.toml b/cranelift/isle/fuzz/Cargo.toml
index 086257bff..9a2b073d7 100644
--- a/cranelift/isle/fuzz/Cargo.toml
+++ b/cranelift/isle/fuzz/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.0.0"
 authors = ["Automatically generated"]
 publish = false
 edition.workspace = true
+rust-version.workspace = true
 
 [package.metadata]
 cargo-fuzz = true
diff --git a/cranelift/isle/isle/Cargo.toml b/cranelift/isle/isle/Cargo.toml
index aa4a5bf84..f96e9325a 100644
--- a/cranelift/isle/isle/Cargo.toml
+++ b/cranelift/isle/isle/Cargo.toml
@@ -2,6 +2,7 @@
 authors = ["The Cranelift Project Developers"]
 description = "ISLE: Instruction Selection and Lowering Expressions. A domain-specific language for instruction selection in Cranelift."
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 name = "cranelift-isle"
 readme = "../README.md"
diff --git a/cranelift/isle/islec/Cargo.toml b/cranelift/isle/islec/Cargo.toml
index 340c2aafd..51451634f 100644
--- a/cranelift/isle/islec/Cargo.toml
+++ b/cranelift/isle/islec/Cargo.toml
@@ -3,6 +3,7 @@ name = "islec"
 version = "0.0.0"
 authors = ["The Cranelift Project Developers"]
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 publish = false
 
diff --git a/cranelift/jit/Cargo.toml b/cranelift/jit/Cargo.toml
index 591c06cb0..28ea98299 100644
--- a/cranelift/jit/Cargo.toml
+++ b/cranelift/jit/Cargo.toml
@@ -8,6 +8,7 @@ documentation = "https://docs.rs/cranelift-jit"
 license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/module/Cargo.toml b/cranelift/module/Cargo.toml
index 0268b28bf..7cd0a4bf7 100644
--- a/cranelift/module/Cargo.toml
+++ b/cranelift/module/Cargo.toml
@@ -9,6 +9,7 @@ categories = ["no-std"]
 license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/native/Cargo.toml b/cranelift/native/Cargo.toml
index 54f76365c..599536d27 100644
--- a/cranelift/native/Cargo.toml
+++ b/cranelift/native/Cargo.toml
@@ -9,6 +9,7 @@ categories = ["no-std"]
 license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [dependencies]
 cranelift-codegen = { workspace = true }
diff --git a/cranelift/object/Cargo.toml b/cranelift/object/Cargo.toml
index 732210ae2..bbacba0d3 100644
--- a/cranelift/object/Cargo.toml
+++ b/cranelift/object/Cargo.toml
@@ -8,6 +8,7 @@ documentation = "https://docs.rs/cranelift-object"
 license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/reader/Cargo.toml b/cranelift/reader/Cargo.toml
index 623f8c7c7..29579bc8a 100644
--- a/cranelift/reader/Cargo.toml
+++ b/cranelift/reader/Cargo.toml
@@ -8,6 +8,7 @@ documentation = "https://docs.rs/cranelift-reader"
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/serde/Cargo.toml b/cranelift/serde/Cargo.toml
index a70aa604d..f37986220 100644
--- a/cranelift/serde/Cargo.toml
+++ b/cranelift/serde/Cargo.toml
@@ -8,6 +8,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
 keywords = ["webassembly", "serde"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/cranelift/umbrella/Cargo.toml b/cranelift/umbrella/Cargo.toml
index 7ec9fcd8f..8da764de7 100644
--- a/cranelift/umbrella/Cargo.toml
+++ b/cranelift/umbrella/Cargo.toml
@@ -10,6 +10,7 @@ categories = ["no-std"]
 readme = "README.md"
 keywords = ["compile", "compiler", "jit"]
 edition.workspace = true
+rust-version.workspace = true
 
 [dependencies]
 cranelift-codegen = { workspace = true }
diff --git a/cranelift/wasm/Cargo.toml b/cranelift/wasm/Cargo.toml
index b62d1018d..79d84ee4a 100644
--- a/cranelift/wasm/Cargo.toml
+++ b/cranelift/wasm/Cargo.toml
@@ -10,6 +10,7 @@ categories = ["no-std", "wasm"]
 readme = "README.md"
 keywords = ["webassembly", "wasm"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/asm-macros/Cargo.toml b/crates/asm-macros/Cargo.toml
index 8b9d96cc9..f04d759e0 100644
--- a/crates/asm-macros/Cargo.toml
+++ b/crates/asm-macros/Cargo.toml
@@ -2,6 +2,7 @@
 authors = ["The Wasmtime Project Developers"]
 description = "Macros for defining asm functions in Wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 name = "wasmtime-asm-macros"
 repository = "https://github.com/bytecodealliance/wasmtime"
diff --git a/crates/bench-api/Cargo.toml b/crates/bench-api/Cargo.toml
index 3cee803f7..b8d36dd54 100644
--- a/crates/bench-api/Cargo.toml
+++ b/crates/bench-api/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lints]
diff --git a/crates/c-api-macros/Cargo.toml b/crates/c-api-macros/Cargo.toml
index 10f492e63..99945a8eb 100644
--- a/crates/c-api-macros/Cargo.toml
+++ b/crates/c-api-macros/Cargo.toml
@@ -4,6 +4,7 @@ version.workspace = true
 authors = ["The Wasmtime Project Developers"]
 license = "Apache-2.0 WITH LLVM-exception"
 edition.workspace = true
+rust-version.workspace = true
 description = "Support macros for `wasmtime-c-api`"
 repository = "https://github.com/bytecodealliance/wasmtime"
 
diff --git a/crates/c-api/Cargo.toml b/crates/c-api/Cargo.toml
index ccf78db10..9b1abe546 100644
--- a/crates/c-api/Cargo.toml
+++ b/crates/c-api/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 links = "wasmtime-c-api"
 include = ["include", "src", "build.rs", "CMakeLists.txt", "cmake", "doxygen.conf.in"]
 
diff --git a/crates/c-api/artifact/Cargo.toml b/crates/c-api/artifact/Cargo.toml
index 789789b43..d3f5e816e 100644
--- a/crates/c-api/artifact/Cargo.toml
+++ b/crates/c-api/artifact/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lib]
diff --git a/crates/cache/Cargo.toml b/crates/cache/Cargo.toml
index bd6b57194..a1510d9ec 100644
--- a/crates/cache/Cargo.toml
+++ b/crates/cache/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 documentation = "https://docs.rs/wasmtime-cache/"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/cli-flags/Cargo.toml b/crates/cli-flags/Cargo.toml
index 705e0012a..832b86214 100644
--- a/crates/cli-flags/Cargo.toml
+++ b/crates/cli-flags/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 documentation = "https://docs.rs/wasmtime-cache/"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/component-macro/Cargo.toml b/crates/component-macro/Cargo.toml
index 818d2aad8..79dbc6a27 100644
--- a/crates/component-macro/Cargo.toml
+++ b/crates/component-macro/Cargo.toml
@@ -9,6 +9,7 @@ documentation = "https://docs.rs/wasmtime-component-macro/"
 categories = ["wasm"]
 keywords = ["webassembly", "wasm"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/component-util/Cargo.toml b/crates/component-util/Cargo.toml
index f51f76130..d1661b0f9 100644
--- a/crates/component-util/Cargo.toml
+++ b/crates/component-util/Cargo.toml
@@ -9,3 +9,4 @@ documentation = "https://docs.rs/wasmtime-component-util/"
 categories = ["wasm"]
 keywords = ["webassembly", "wasm"]
 edition.workspace = true
+rust-version.workspace = true
diff --git a/crates/cranelift/Cargo.toml b/crates/cranelift/Cargo.toml
index 9d1266655..51cf98393 100644
--- a/crates/cranelift/Cargo.toml
+++ b/crates/cranelift/Cargo.toml
@@ -9,6 +9,7 @@ documentation = "https://docs.rs/wasmtime-cranelift/"
 categories = ["wasm"]
 keywords = ["webassembly", "wasm"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/environ/Cargo.toml b/crates/environ/Cargo.toml
index c42690f8d..2ae748a0b 100644
--- a/crates/environ/Cargo.toml
+++ b/crates/environ/Cargo.toml
@@ -9,6 +9,7 @@ documentation = "https://docs.rs/wasmtime-environ/"
 categories = ["wasm"]
 keywords = ["webassembly", "wasm"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/environ/fuzz/Cargo.toml b/crates/environ/fuzz/Cargo.toml
index 97ff78986..d6a1774bf 100644
--- a/crates/environ/fuzz/Cargo.toml
+++ b/crates/environ/fuzz/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.0.0"
 authors = ["Automatically generated"]
 publish = false
 edition.workspace = true
+rust-version.workspace = true
 
 [package.metadata]
 cargo-fuzz = true
diff --git a/crates/explorer/Cargo.toml b/crates/explorer/Cargo.toml
index ba315ddd5..acbd32970 100644
--- a/crates/explorer/Cargo.toml
+++ b/crates/explorer/Cargo.toml
@@ -4,6 +4,7 @@ authors.workspace = true
 description = "Compiler explorer for Wasmtime and Cranelift"
 documentation = "https://docs.rs/wasmtime-explorer/"
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 version.workspace = true
diff --git a/crates/fiber/Cargo.toml b/crates/fiber/Cargo.toml
index 7ba3878ef..8d83fd035 100644
--- a/crates/fiber/Cargo.toml
+++ b/crates/fiber/Cargo.toml
@@ -6,6 +6,7 @@ description = "Fiber support for Wasmtime"
 license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/fuzzing/Cargo.toml b/crates/fuzzing/Cargo.toml
index d4757a7db..d93898205 100644
--- a/crates/fuzzing/Cargo.toml
+++ b/crates/fuzzing/Cargo.toml
@@ -2,6 +2,7 @@
 authors.workspace = true
 description = "Fuzzing infrastructure for Wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 name = "wasmtime-fuzzing"
 publish = false
 version = "0.0.0"
diff --git a/crates/fuzzing/wasm-spec-interpreter/Cargo.toml b/crates/fuzzing/wasm-spec-interpreter/Cargo.toml
index b18dc066c..d33bc619d 100644
--- a/crates/fuzzing/wasm-spec-interpreter/Cargo.toml
+++ b/crates/fuzzing/wasm-spec-interpreter/Cargo.toml
@@ -5,6 +5,7 @@ name = "wasm-spec-interpreter"
 version = "0.0.0"
 publish = false
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 
 [lints]
diff --git a/crates/jit-debug/Cargo.toml b/crates/jit-debug/Cargo.toml
index 11045bd81..c073df708 100644
--- a/crates/jit-debug/Cargo.toml
+++ b/crates/jit-debug/Cargo.toml
@@ -9,6 +9,7 @@ keywords = ["gdb", "jit"]
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/jit-icache-coherence/Cargo.toml b/crates/jit-icache-coherence/Cargo.toml
index 2f7461f1c..5612c2af5 100644
--- a/crates/jit-icache-coherence/Cargo.toml
+++ b/crates/jit-icache-coherence/Cargo.toml
@@ -7,6 +7,7 @@ documentation = "https://docs.rs/jit-icache-coherence"
 license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/misc/component-fuzz-util/Cargo.toml b/crates/misc/component-fuzz-util/Cargo.toml
index 9a23fa2cf..9f6f4a8e9 100644
--- a/crates/misc/component-fuzz-util/Cargo.toml
+++ b/crates/misc/component-fuzz-util/Cargo.toml
@@ -4,6 +4,7 @@ authors = ["The Wasmtime Project Developers"]
 license = "Apache-2.0 WITH LLVM-exception"
 version = "0.0.0"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lints]
diff --git a/crates/slab/Cargo.toml b/crates/slab/Cargo.toml
index d9f265ffb..b1b6c5e73 100644
--- a/crates/slab/Cargo.toml
+++ b/crates/slab/Cargo.toml
@@ -2,6 +2,7 @@
 authors = ["The Wasmtime Project Developers"]
 description = "Uni-typed slab with a free list for use in Wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 name = "wasmtime-slab"
 repository = "https://github.com/bytecodealliance/wasmtime"
diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml
index bd5c88331..1fbbb8fde 100644
--- a/crates/types/Cargo.toml
+++ b/crates/types/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 documentation = "https://docs.rs/wasmtime-types"
 edition.workspace = true
+rust-version.workspace = true
 
 [dependencies]
 anyhow = { workspace = true }
diff --git a/crates/versioned-export-macros/Cargo.toml b/crates/versioned-export-macros/Cargo.toml
index d9f2d9e47..59109a047 100644
--- a/crates/versioned-export-macros/Cargo.toml
+++ b/crates/versioned-export-macros/Cargo.toml
@@ -2,6 +2,7 @@
 authors = ["The Wasmtime Project Developers"]
 description = "Macros for defining versioned exports in Wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 name = "wasmtime-versioned-export-macros"
 repository = "https://github.com/bytecodealliance/wasmtime"
diff --git a/crates/wasi-common/Cargo.toml b/crates/wasi-common/Cargo.toml
index 579d92f9f..e1d47d1cf 100644
--- a/crates/wasi-common/Cargo.toml
+++ b/crates/wasi-common/Cargo.toml
@@ -9,6 +9,7 @@ keywords = ["webassembly", "wasm"]
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 include = ["src/**/*", "tests/**/*", "witx", "README.md", "LICENSE", "build.rs"]
 
 [lints]
diff --git a/crates/wasi-http/Cargo.toml b/crates/wasi-http/Cargo.toml
index 9c9400ab9..3339fc1b5 100644
--- a/crates/wasi-http/Cargo.toml
+++ b/crates/wasi-http/Cargo.toml
@@ -3,6 +3,7 @@ name = "wasmtime-wasi-http"
 version.workspace = true
 authors.workspace = true
 edition.workspace = true
+rust-version.workspace = true
 repository = "https://github.com/bytecodealliance/wasmtime"
 license = "Apache-2.0 WITH LLVM-exception"
 description = "Experimental HTTP library for WebAssembly in Wasmtime"
diff --git a/crates/wasi-keyvalue/Cargo.toml b/crates/wasi-keyvalue/Cargo.toml
index 561f33bb1..860e37a79 100644
--- a/crates/wasi-keyvalue/Cargo.toml
+++ b/crates/wasi-keyvalue/Cargo.toml
@@ -3,6 +3,7 @@ name = "wasmtime-wasi-keyvalue"
 version.workspace = true
 authors.workspace = true
 edition.workspace = true
+rust-version.workspace = true
 repository = "https://github.com/bytecodealliance/wasmtime"
 license = "Apache-2.0 WITH LLVM-exception"
 description = "Wasmtime implementation of the wasi-keyvalue API"
diff --git a/crates/wasi-nn/Cargo.toml b/crates/wasi-nn/Cargo.toml
index 4d8470824..48ac66e44 100644
--- a/crates/wasi-nn/Cargo.toml
+++ b/crates/wasi-nn/Cargo.toml
@@ -10,6 +10,7 @@ keywords = ["webassembly", "wasm", "neural-network"]
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/wasi-preview1-component-adapter/Cargo.toml b/crates/wasi-preview1-component-adapter/Cargo.toml
index 583a87989..0eac34f1e 100644
--- a/crates/wasi-preview1-component-adapter/Cargo.toml
+++ b/crates/wasi-preview1-component-adapter/Cargo.toml
@@ -3,6 +3,7 @@ name = "wasi-preview1-component-adapter"
 version.workspace = true
 authors.workspace = true
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lints]
diff --git a/crates/wasi-preview1-component-adapter/byte-array-literals/Cargo.toml b/crates/wasi-preview1-component-adapter/byte-array-literals/Cargo.toml
index 5be0dd938..10b21a963 100644
--- a/crates/wasi-preview1-component-adapter/byte-array-literals/Cargo.toml
+++ b/crates/wasi-preview1-component-adapter/byte-array-literals/Cargo.toml
@@ -3,6 +3,7 @@ name = "byte-array-literals"
 version.workspace = true
 authors.workspace = true
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lib]
diff --git a/crates/wasi-preview1-component-adapter/provider/Cargo.toml.in b/crates/wasi-preview1-component-adapter/provider/Cargo.toml.in
index 9f0ea47c7..a47099f95 100644
--- a/crates/wasi-preview1-component-adapter/provider/Cargo.toml.in
+++ b/crates/wasi-preview1-component-adapter/provider/Cargo.toml.in
@@ -9,6 +9,7 @@ documentation = "https://docs.rs/wasi-preview1-component-adapter-provider/"
 categories = ["wasm"]
 keywords = ["webassembly", "wasm"]
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/wasi-preview1-component-adapter/verify/Cargo.toml b/crates/wasi-preview1-component-adapter/verify/Cargo.toml
index d351b2bc2..52d75e055 100644
--- a/crates/wasi-preview1-component-adapter/verify/Cargo.toml
+++ b/crates/wasi-preview1-component-adapter/verify/Cargo.toml
@@ -2,6 +2,7 @@
 name = "verify-component-adapter"
 version.workspace = true
 edition.workspace = true
+rust-version.workspace = true
 authors.workspace = true
 publish = false
 
diff --git a/crates/wasi-runtime-config/Cargo.toml b/crates/wasi-runtime-config/Cargo.toml
index c5939b1e1..03df5d5bb 100644
--- a/crates/wasi-runtime-config/Cargo.toml
+++ b/crates/wasi-runtime-config/Cargo.toml
@@ -3,6 +3,7 @@ name = "wasmtime-wasi-runtime-config"
 version.workspace = true
 authors.workspace = true
 edition.workspace = true
+rust-version.workspace = true
 repository = "https://github.com/bytecodealliance/wasmtime"
 license = "Apache-2.0 WITH LLVM-exception"
 description = "Wasmtime implementation of the wasi-runtime-config API"
diff --git a/crates/wasi-threads/Cargo.toml b/crates/wasi-threads/Cargo.toml
index 467ce1e6f..0a5a681d7 100644
--- a/crates/wasi-threads/Cargo.toml
+++ b/crates/wasi-threads/Cargo.toml
@@ -10,6 +10,7 @@ keywords = ["webassembly", "wasm", "neural-network"]
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/wasi/Cargo.toml b/crates/wasi/Cargo.toml
index 2816f16c9..1f2610616 100644
--- a/crates/wasi/Cargo.toml
+++ b/crates/wasi/Cargo.toml
@@ -9,6 +9,7 @@ keywords = ["webassembly", "wasm"]
 repository = "https://github.com/bytecodealliance/wasmtime"
 readme = "README.md"
 edition.workspace = true
+rust-version.workspace = true
 include = ["src/**/*", "README.md", "LICENSE", "witx/*", "wit/**/*", "tests/*"]
 
 [lints]
diff --git a/crates/wast/Cargo.toml b/crates/wast/Cargo.toml
index a752481c0..599cfae1c 100644
--- a/crates/wast/Cargo.toml
+++ b/crates/wast/Cargo.toml
@@ -8,6 +8,7 @@ categories = ["wasm"]
 keywords = ["webassembly", "wasm"]
 repository = "https://github.com/bytecodealliance/wasmtime"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/wiggle/Cargo.toml b/crates/wiggle/Cargo.toml
index 0961f1be4..ae526252f 100644
--- a/crates/wiggle/Cargo.toml
+++ b/crates/wiggle/Cargo.toml
@@ -3,6 +3,7 @@ name = "wiggle"
 version.workspace = true
 authors = ["Pat Hickey <phickey@fastly.com>", "Jakub Konka <kubkonk@jakubkonka.com>", "Alex Crichton <alex@alexcrichton.com>"]
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 description = "Runtime components of wiggle code generator"
 categories = ["wasm"]
diff --git a/crates/wiggle/generate/Cargo.toml b/crates/wiggle/generate/Cargo.toml
index 071255c93..83444c410 100644
--- a/crates/wiggle/generate/Cargo.toml
+++ b/crates/wiggle/generate/Cargo.toml
@@ -4,6 +4,7 @@ version.workspace = true
 authors = ["Pat Hickey <phickey@fastly.com>", "Jakub Konka <kubkon@jakubkonka.com>", "Alex Crichton <alex@alexcrichton.com>"]
 license = "Apache-2.0 WITH LLVM-exception"
 edition.workspace = true
+rust-version.workspace = true
 description = "Library crate for wiggle code generator."
 categories = ["wasm"]
 keywords = ["webassembly", "wasm"]
diff --git a/crates/wiggle/macro/Cargo.toml b/crates/wiggle/macro/Cargo.toml
index ab3f39f3f..6d10be2ef 100644
--- a/crates/wiggle/macro/Cargo.toml
+++ b/crates/wiggle/macro/Cargo.toml
@@ -3,6 +3,7 @@ name = "wiggle-macro"
 version.workspace = true
 authors = ["Pat Hickey <phickey@fastly.com>", "Jakub Konka <kubkon@jakubkonka.com>", "Alex Crichton <alex@alexcrichton.com>"]
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 description = "Wiggle code generator"
 categories = ["wasm"]
diff --git a/crates/winch/Cargo.toml b/crates/winch/Cargo.toml
index 7d2d67abf..506abf459 100644
--- a/crates/winch/Cargo.toml
+++ b/crates/winch/Cargo.toml
@@ -4,6 +4,7 @@ description = "Integration between Wasmtime and Winch"
 version.workspace = true
 authors.workspace = true
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 
diff --git a/crates/wit-bindgen/Cargo.toml b/crates/wit-bindgen/Cargo.toml
index 9c8c26c97..90e8ea3e9 100644
--- a/crates/wit-bindgen/Cargo.toml
+++ b/crates/wit-bindgen/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 documentation = "https://docs.rs/wasmtime-wit-bindgen/"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/wmemcheck/Cargo.toml b/crates/wmemcheck/Cargo.toml
index 5d21c510b..ee4ff45a3 100644
--- a/crates/wmemcheck/Cargo.toml
+++ b/crates/wmemcheck/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 documentation = "https://docs.rs/wasmtime-cranelift/"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 58d21c1b1..7525a359d 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -2,6 +2,7 @@
 name = "wasmtime-fuzz"
 version = "0.0.0"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lints]
diff --git a/pulley/Cargo.toml b/pulley/Cargo.toml
index fc9401c17..89ffa0861 100644
--- a/pulley/Cargo.toml
+++ b/pulley/Cargo.toml
@@ -2,6 +2,7 @@
 authors = ["The Pulley Project Developers"]
 description = "The Pulley interpreter, its bytecode definition, encoder, decoder, and etc..."
 edition.workspace = true
+rust-version.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 name = "pulley-interpreter"
 readme = "./README.md"
diff --git a/pulley/fuzz/Cargo.toml b/pulley/fuzz/Cargo.toml
index 095943bbd..fc9737559 100644
--- a/pulley/fuzz/Cargo.toml
+++ b/pulley/fuzz/Cargo.toml
@@ -3,6 +3,7 @@ name = "pulley-interpreter-fuzz"
 version = "0.0.0"
 publish = false
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/winch/codegen/Cargo.toml b/winch/codegen/Cargo.toml
index 38c89b6d2..b5f0f2709 100644
--- a/winch/codegen/Cargo.toml
+++ b/winch/codegen/Cargo.toml
@@ -6,6 +6,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasmtime"
 version = "0.23.0"
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true


Test patch:
diff --git a/cranelift/filetests/Cargo.toml b/cranelift/filetests/Cargo.toml
index 502b5ec78..74fd10e7b 100644
--- a/cranelift/filetests/Cargo.toml
+++ b/cranelift/filetests/Cargo.toml
@@ -8,6 +8,7 @@ documentation = "https://docs.rs/cranelift-filetests"
 repository = "https://github.com/bytecodealliance/wasmtime"
 publish = false
 edition.workspace = true
+rust-version.workspace = true
 
 [lints]
 workspace = true
diff --git a/crates/component-macro/test-helpers/Cargo.toml b/crates/component-macro/test-helpers/Cargo.toml
index da543c919..03d2b1372 100644
--- a/crates/component-macro/test-helpers/Cargo.toml
+++ b/crates/component-macro/test-helpers/Cargo.toml
@@ -2,6 +2,7 @@
 name = "component-macro-test-helpers"
 version = "0.0.0"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 license = "Apache-2.0 WITH LLVM-exception"
 
diff --git a/crates/misc/component-macro-test/Cargo.toml b/crates/misc/component-macro-test/Cargo.toml
index 35e29dd51..5bc71a5fd 100644
--- a/crates/misc/component-macro-test/Cargo.toml
+++ b/crates/misc/component-macro-test/Cargo.toml
@@ -4,6 +4,7 @@ authors = ["The Wasmtime Project Developers"]
 license = "Apache-2.0 WITH LLVM-exception"
 version = "0.0.0"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [lib]
diff --git a/crates/misc/component-test-util/Cargo.toml b/crates/misc/component-test-util/Cargo.toml
index 840a23234..181a2f4e3 100644
--- a/crates/misc/component-test-util/Cargo.toml
+++ b/crates/misc/component-test-util/Cargo.toml
@@ -4,6 +4,7 @@ authors = ["The Wasmtime Project Developers"]
 license = "Apache-2.0 WITH LLVM-exception"
 version = "0.0.0"
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 
 [dependencies]
diff --git a/crates/test-programs/Cargo.toml b/crates/test-programs/Cargo.toml
index eae086c8a..baff3bba8 100644
--- a/crates/test-programs/Cargo.toml
+++ b/crates/test-programs/Cargo.toml
@@ -3,6 +3,7 @@ name = "test-programs"
 version = "0.0.0"
 authors = ["The Wasmtime Project Developers"]
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 license = "Apache-2.0 WITH LLVM-exception"
 
diff --git a/crates/test-programs/artifacts/Cargo.toml b/crates/test-programs/artifacts/Cargo.toml
index 614f6a7ab..40cc3a7bd 100644
--- a/crates/test-programs/artifacts/Cargo.toml
+++ b/crates/test-programs/artifacts/Cargo.toml
@@ -3,6 +3,7 @@ name = "test-programs-artifacts"
 version = "0.0.0"
 authors = ["The Wasmtime Project Developers"]
 edition.workspace = true
+rust-version.workspace = true
 publish = false
 license = "Apache-2.0 WITH LLVM-exception"
 
diff --git a/crates/wiggle/test-helpers/Cargo.toml b/crates/wiggle/test-helpers/Cargo.toml
index 5f81b6022..df2212e5f 100644
--- a/crates/wiggle/test-helpers/Cargo.toml
+++ b/crates/wiggle/test-helpers/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.0.0"
 authors = ["Pat Hickey <phickey@fastly.com>", "Jakub Konka <kubkon@jakubkonka.com>", "Alex Crichton <alex@alexcrichton.com>"]
 license = "Apache-2.0 WITH LLVM-exception"
 edition.workspace = true
+rust-version.workspace = true
 description = "Reusable testing components for wiggle code generator. Only intended to be used by tests in `wiggle` crate."
 categories = ["wasm"]
 keywords = ["webassembly", "wasm"]