From 7a8cdaeb35c3945235b0c9c55394359ab6962159 Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Tue, 2 Jun 2026 23:59:09 +0530 Subject: [PATCH 1/9] runtime tarballs --- .github/workflows/build-rust.yml | 2 +- scripts/pack.sh | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-rust.yml b/.github/workflows/build-rust.yml index 708f07e..5f1dc68 100644 --- a/.github/workflows/build-rust.yml +++ b/.github/workflows/build-rust.yml @@ -52,4 +52,4 @@ jobs: with: name: metacall-rust-toolchain-${{ matrix.distro }} path: dist/rust-toolchain.tar.gz - retention-days: 1 + retention-days: 7 diff --git a/scripts/pack.sh b/scripts/pack.sh index 59e149f..536cba7 100755 --- a/scripts/pack.sh +++ b/scripts/pack.sh @@ -72,18 +72,39 @@ function generate_tarball() { # List of components triplet=$(rustc -vV | grep host | awk '{print $2}') -components=( +# components=( +# "cargo-nightly-${triplet}" +# "clippy-nightly-${triplet}" +# "rust-analysis-nightly-${triplet}" +# "rust-analyzer-nightly-${triplet}" +# "rust-std-nightly-${triplet}" +# "rustc-nightly-${triplet}" +# "rustc-dev-nightly-${triplet}" +# "rustfmt-nightly-${triplet}" +# "rust-src-nightly" +# ) + +runtime_components=( "cargo-nightly-${triplet}" "clippy-nightly-${triplet}" - "rust-analysis-nightly-${triplet}" - "rust-analyzer-nightly-${triplet}" "rust-std-nightly-${triplet}" "rustc-nightly-${triplet}" - "rustc-dev-nightly-${triplet}" + "rust-analyzer-nightly-${triplet}" "rustfmt-nightly-${triplet}" +) + +dev_components=( + "rust-analysis-nightly-${triplet}" + "rustc-dev-nightly-${triplet}" "rust-src-nightly" ) +# generate runtime tarball +generate_tarball "${runtime_components[@]}" +mv /rust-toolchain.tar.gz /rust-toolchain-runtime.tar.gz + # Generate dev tarball -generate_tarball "${components[@]}" +find /usr/local -type f | sort > /tmp/install-prefix-before.txt + +generate_tarball "${dev_components[@]}" # mv /rust-toolchain.tar.gz /rust-toolchain-dev.tar.gz From 8bc805f8afa0cb923c7d502d1152225df3bdff3e Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Wed, 3 Jun 2026 20:57:08 +0530 Subject: [PATCH 2/9] tarballs --- .github/workflows/build-rust.yml | 4 +++- Dockerfile | 3 ++- release.sh | 3 ++- scripts/pack.sh | 8 +++++++- scripts/validate.sh | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-rust.yml b/.github/workflows/build-rust.yml index 5f1dc68..dc635e0 100644 --- a/.github/workflows/build-rust.yml +++ b/.github/workflows/build-rust.yml @@ -51,5 +51,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: metacall-rust-toolchain-${{ matrix.distro }} - path: dist/rust-toolchain.tar.gz + path: | + dist/rust-toolchain-runtime.tar.gz + dist/rust-toolchain-dev.tar.gz retention-days: 7 diff --git a/Dockerfile b/Dockerfile index ce5145e..3acfc94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,8 @@ FROM ${RUST_TOOLCHAIN_IMAGE} AS validate WORKDIR /workspace -COPY --from=pack /rust-toolchain.tar.gz / +COPY --from=pack /rust-toolchain-runtime.tar.gz / +COPY --from=pack /rust-toolchain-dev.tar.gz / COPY scripts/validate.sh /validate.sh diff --git a/release.sh b/release.sh index b52ba2b..5b13524 100755 --- a/release.sh +++ b/release.sh @@ -6,5 +6,6 @@ docker buildx build \ --load \ -t metacall/rust-toolchain . docker run --name metacall-rust-toolchain metacall/rust-toolchain -docker cp metacall-rust-toolchain:/rust-toolchain.tar.gz ./dist/ +docker cp metacall-rust-toolchain:/rust-toolchain-runtime.tar.gz ./dist/ +docker cp metacall-rust-toolchain:/rust-toolchain-dev.tar.gz ./dist/ docker rm metacall-rust-toolchain diff --git a/scripts/pack.sh b/scripts/pack.sh index 536cba7..38b3ad5 100755 --- a/scripts/pack.sh +++ b/scripts/pack.sh @@ -94,8 +94,14 @@ runtime_components=( ) dev_components=( + "cargo-nightly-${triplet}" + "clippy-nightly-${triplet}" "rust-analysis-nightly-${triplet}" + "rust-analyzer-nightly-${triplet}" + "rust-std-nightly-${triplet}" + "rustc-nightly-${triplet}" "rustc-dev-nightly-${triplet}" + "rustfmt-nightly-${triplet}" "rust-src-nightly" ) @@ -107,4 +113,4 @@ mv /rust-toolchain.tar.gz /rust-toolchain-runtime.tar.gz find /usr/local -type f | sort > /tmp/install-prefix-before.txt generate_tarball "${dev_components[@]}" -# mv /rust-toolchain.tar.gz /rust-toolchain-dev.tar.gz +mv /rust-toolchain.tar.gz /rust-toolchain-dev.tar.gz diff --git a/scripts/validate.sh b/scripts/validate.sh index e2cbb03..b8e83c3 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -13,7 +13,7 @@ apt update && apt install -y --no-install-recommends \ libssl-dev # Uncompress toolchain -tar -xzf /rust-toolchain.tar.gz -C / +tar -xzf /rust-toolchain-dev.tar.gz -C / # Validate which rustc From c400aa4efb6c72e60c7bbcaee8a311fabb0206af Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Wed, 3 Jun 2026 22:06:28 +0530 Subject: [PATCH 3/9] debugging --- scripts/validate.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/validate.sh b/scripts/validate.sh index b8e83c3..fc517aa 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -15,6 +15,9 @@ apt update && apt install -y --no-install-recommends \ # Uncompress toolchain tar -xzf /rust-toolchain-dev.tar.gz -C / +# debugging +tar -tzf /rust-toolchain-dev.tar.gz | grep -E "rustc|cargo|clippy|rustfmt" || true + # Validate which rustc which cargo From 78a4a15b47f57cecb3984b6104591267419cb2ee Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Thu, 4 Jun 2026 01:31:20 +0530 Subject: [PATCH 4/9] debugging --- scripts/validate.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/validate.sh b/scripts/validate.sh index fc517aa..cf7b8df 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -16,7 +16,17 @@ apt update && apt install -y --no-install-recommends \ tar -xzf /rust-toolchain-dev.tar.gz -C / # debugging -tar -tzf /rust-toolchain-dev.tar.gz | grep -E "rustc|cargo|clippy|rustfmt" || true +echo "rustc" +tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/rustc$" || true + +echo "cargo" +tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/cargo$" || true + +echo "cargo-clippy" +tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/cargo-clippy$" || true + +echo "rustfmt" +tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/rustfmt$" || true # Validate which rustc From c5a768f7395bb75aeefba3ff77656b84e5dbb3ba Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Thu, 4 Jun 2026 14:36:40 +0530 Subject: [PATCH 5/9] debugging --- scripts/pack.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/pack.sh b/scripts/pack.sh index 38b3ad5..0516d4b 100755 --- a/scripts/pack.sh +++ b/scripts/pack.sh @@ -86,20 +86,14 @@ triplet=$(rustc -vV | grep host | awk '{print $2}') runtime_components=( "cargo-nightly-${triplet}" - "clippy-nightly-${triplet}" "rust-std-nightly-${triplet}" "rustc-nightly-${triplet}" - "rust-analyzer-nightly-${triplet}" - "rustfmt-nightly-${triplet}" ) dev_components=( - "cargo-nightly-${triplet}" "clippy-nightly-${triplet}" "rust-analysis-nightly-${triplet}" "rust-analyzer-nightly-${triplet}" - "rust-std-nightly-${triplet}" - "rustc-nightly-${triplet}" "rustc-dev-nightly-${triplet}" "rustfmt-nightly-${triplet}" "rust-src-nightly" From 6c76369e320a2bdc2695d4578e904227fc66b85b Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Thu, 4 Jun 2026 16:06:01 +0530 Subject: [PATCH 6/9] dev + runtime --- scripts/pack.sh | 1 - scripts/validate.sh | 18 ++++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/scripts/pack.sh b/scripts/pack.sh index 0516d4b..c360628 100755 --- a/scripts/pack.sh +++ b/scripts/pack.sh @@ -104,7 +104,6 @@ generate_tarball "${runtime_components[@]}" mv /rust-toolchain.tar.gz /rust-toolchain-runtime.tar.gz # Generate dev tarball -find /usr/local -type f | sort > /tmp/install-prefix-before.txt generate_tarball "${dev_components[@]}" mv /rust-toolchain.tar.gz /rust-toolchain-dev.tar.gz diff --git a/scripts/validate.sh b/scripts/validate.sh index cf7b8df..03fcf5f 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -12,21 +12,11 @@ apt update && apt install -y --no-install-recommends \ libc6-dev \ libssl-dev -# Uncompress toolchain -tar -xzf /rust-toolchain-dev.tar.gz -C / - -# debugging -echo "rustc" -tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/rustc$" || true - -echo "cargo" -tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/cargo$" || true +# Uncompress toolchain runtime tarball +tar -xzf /rust-toolchain-runtime.tar.gz -C / -echo "cargo-clippy" -tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/cargo-clippy$" || true - -echo "rustfmt" -tar -tzf /rust-toolchain-dev.tar.gz | grep "^usr/local/bin/rustfmt$" || true +# Uncompress toolchain dev tarball +tar -xzf /rust-toolchain-dev.tar.gz -C / # Validate which rustc From 69e387626e5695ff52199e7e9f488c906bfed69a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:06:41 -0400 Subject: [PATCH 7/9] Update pack.sh --- scripts/pack.sh | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/scripts/pack.sh b/scripts/pack.sh index c360628..25b8fe9 100755 --- a/scripts/pack.sh +++ b/scripts/pack.sh @@ -72,18 +72,6 @@ function generate_tarball() { # List of components triplet=$(rustc -vV | grep host | awk '{print $2}') -# components=( -# "cargo-nightly-${triplet}" -# "clippy-nightly-${triplet}" -# "rust-analysis-nightly-${triplet}" -# "rust-analyzer-nightly-${triplet}" -# "rust-std-nightly-${triplet}" -# "rustc-nightly-${triplet}" -# "rustc-dev-nightly-${triplet}" -# "rustfmt-nightly-${triplet}" -# "rust-src-nightly" -# ) - runtime_components=( "cargo-nightly-${triplet}" "rust-std-nightly-${triplet}" @@ -104,6 +92,5 @@ generate_tarball "${runtime_components[@]}" mv /rust-toolchain.tar.gz /rust-toolchain-runtime.tar.gz # Generate dev tarball - generate_tarball "${dev_components[@]}" mv /rust-toolchain.tar.gz /rust-toolchain-dev.tar.gz From 051ac4a99dcccf704295259828d4748d56205eea Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Thu, 4 Jun 2026 22:16:50 +0530 Subject: [PATCH 8/9] validate.sh changes --- scripts/validate.sh | 118 +++++++++++++++++++++++++++++--------------- 1 file changed, 77 insertions(+), 41 deletions(-) diff --git a/scripts/validate.sh b/scripts/validate.sh index 03fcf5f..2408306 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -6,6 +6,39 @@ function error() { exit 1 } +function validate_runtime() { + + # runtime validation check + rustc -Vv | grep "1.94.0-nightly"|| error "rustc not found in runtime tarball" + cargo -V | grep "1.94.0" || error "cargo not found in runtime tarball" + + which rustc || error "rustc not found in runtime tarball" + which cargo || error "cargo not found in runtime tarball" + + rm -rf /tmp/runtime-test + mkdir -p /tmp/runtime-test + cd /tmp/runtime-test + + cargo new hello-world + cd hello-world + cargo build || error "the program couldn't build" + cargo run | grep "Hello, world!" || error "the program couldn't run" + +} + +function validate_dev() { + + # dev validation check + cargo clippy --version || error "clippy not found in dev tarball" + rustfmt --version || error "rustfmt not found in dev tarball" + + which cargo-clippy | grep "/usr/local/bin"|| error "clippy not found in dev tarball" + which rustfmt | grep "/usr/local/bin" || error "rustfmt not found in dev tarball" + + cargo clippy -- -D warnings || error "clippy failed" + cargo fmt --check || error "cargo fmt check failed" +} + # Install dependencies apt update && apt install -y --no-install-recommends \ gcc \ @@ -13,48 +46,51 @@ apt update && apt install -y --no-install-recommends \ libssl-dev # Uncompress toolchain runtime tarball -tar -xzf /rust-toolchain-runtime.tar.gz -C / + tar -xzf /rust-toolchain-runtime.tar.gz -C / + validate_runtime # Uncompress toolchain dev tarball -tar -xzf /rust-toolchain-dev.tar.gz -C / + tar -xzf /rust-toolchain-dev.tar.gz -C / + validate_dev + # Validate -which rustc -which cargo - -rustc -Vv -cargo -V - -find /usr/local -name "librustc_driver*.so" 2>/dev/null -find /usr/local -name "rustc_middle*" 2>/dev/null -find /usr/local -name "rustc_hir*" 2>/dev/null -find /usr/local -name "rustc_interface*" 2>/dev/null -find /usr/local -name "*clippy*" 2>/dev/null -find /usr/local -name "*rustfmt*" 2>/dev/null - -ls /usr/local/lib/rustlib/ 2>/dev/null - -rustc -Vv | grep "1.94.0-nightly" || error "wrong rustc version" -cargo -V | grep "1.94.0" || error "wrong cargo version" -rustfmt --version | grep "nightly" || error "wrong rustfmt version" -rustc -Vv || error "rustc validation failed" -cargo -V || error "cargo validation failed" -cargo clippy --version || error "clippy validation failed" -rustfmt --version || error "rustfmt validation failed" - -which rustc | grep "/usr/local/bin" || error "rustc not using installed toolchain" -which cargo | grep "/usr/local/bin" || error "cargo not using installed toolchain" -which cargo-clippy | grep "/usr/local/bin" || error "clippy not using installed toolchain" -which rustfmt | grep "/usr/local/bin" || error "rustfmt not using installed toolchain" - -# Compile a program -mkdir /tmp/toolchain-test -cd /tmp/toolchain-test - -cargo new hello-world -cd hello-world - -cargo build || error "cargo build failed" -cargo clippy -- -D warnings || error "clippy failed" -cargo fmt --check || error "cargo fmt check failed" -cargo run | grep "Hello, world!" || error "cargo run failed" +# which rustc +# which cargo + +# rustc -Vv +# cargo -V + +# find /usr/local -name "librustc_driver*.so" 2>/dev/null +# find /usr/local -name "rustc_middle*" 2>/dev/null +# find /usr/local -name "rustc_hir*" 2>/dev/null +# find /usr/local -name "rustc_interface*" 2>/dev/null +# find /usr/local -name "*clippy*" 2>/dev/null +# find /usr/local -name "*rustfmt*" 2>/dev/null + +# ls /usr/local/lib/rustlib/ 2>/dev/null + +# rustc -Vv | grep "1.94.0-nightly" || error "wrong rustc version" +# cargo -V | grep "1.94.0" || error "wrong cargo version" +# rustfmt --version | grep "nightly" || error "wrong rustfmt version" +# rustc -Vv || error "rustc validation failed" +# cargo -V || error "cargo validation failed" +# cargo clippy --version || error "clippy validation failed" +# rustfmt --version || error "rustfmt validation failed" + +# which rustc | grep "/usr/local/bin" || error "rustc not using installed toolchain" +# which cargo | grep "/usr/local/bin" || error "cargo not using installed toolchain" +# which cargo-clippy | grep "/usr/local/bin" || error "clippy not using installed toolchain" +# which rustfmt | grep "/usr/local/bin" || error "rustfmt not using installed toolchain" + +# # Compile a program +# mkdir /tmp/toolchain-test +# cd /tmp/toolchain-test + +# cargo new hello-world +# cd hello-world + +# cargo build || error "cargo build failed" +# cargo clippy -- -D warnings || error "clippy failed" +# cargo fmt --check || error "cargo fmt check failed" +# cargo run | grep "Hello, world!" || error "cargo run failed" From 642e0b81a33900aa7481a90119da08389821ffeb Mon Sep 17 00:00:00 2001 From: SATVIKsynopsis Date: Fri, 5 Jun 2026 00:14:15 +0530 Subject: [PATCH 9/9] final touch --- scripts/validate.sh | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/scripts/validate.sh b/scripts/validate.sh index 2408306..d019f9f 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -53,44 +53,3 @@ apt update && apt install -y --no-install-recommends \ tar -xzf /rust-toolchain-dev.tar.gz -C / validate_dev - -# Validate -# which rustc -# which cargo - -# rustc -Vv -# cargo -V - -# find /usr/local -name "librustc_driver*.so" 2>/dev/null -# find /usr/local -name "rustc_middle*" 2>/dev/null -# find /usr/local -name "rustc_hir*" 2>/dev/null -# find /usr/local -name "rustc_interface*" 2>/dev/null -# find /usr/local -name "*clippy*" 2>/dev/null -# find /usr/local -name "*rustfmt*" 2>/dev/null - -# ls /usr/local/lib/rustlib/ 2>/dev/null - -# rustc -Vv | grep "1.94.0-nightly" || error "wrong rustc version" -# cargo -V | grep "1.94.0" || error "wrong cargo version" -# rustfmt --version | grep "nightly" || error "wrong rustfmt version" -# rustc -Vv || error "rustc validation failed" -# cargo -V || error "cargo validation failed" -# cargo clippy --version || error "clippy validation failed" -# rustfmt --version || error "rustfmt validation failed" - -# which rustc | grep "/usr/local/bin" || error "rustc not using installed toolchain" -# which cargo | grep "/usr/local/bin" || error "cargo not using installed toolchain" -# which cargo-clippy | grep "/usr/local/bin" || error "clippy not using installed toolchain" -# which rustfmt | grep "/usr/local/bin" || error "rustfmt not using installed toolchain" - -# # Compile a program -# mkdir /tmp/toolchain-test -# cd /tmp/toolchain-test - -# cargo new hello-world -# cd hello-world - -# cargo build || error "cargo build failed" -# cargo clippy -- -D warnings || error "clippy failed" -# cargo fmt --check || error "cargo fmt check failed" -# cargo run | grep "Hello, world!" || error "cargo run failed"