From 0db3db983d3df1973331325bf26e7648263a7003 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Wed, 10 Dec 2025 15:09:34 +0100 Subject: [PATCH 1/3] images: install rust using rustup --- images/ci/Dockerfile.build | 6 +++--- images/ci/Dockerfile.prebuild | 13 ++++++++----- images/create_ci_images.sh | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/images/ci/Dockerfile.build b/images/ci/Dockerfile.build index 2071973a619f..a707e86d0a68 100644 --- a/images/ci/Dockerfile.build +++ b/images/ci/Dockerfile.build @@ -28,9 +28,9 @@ ENV BLST_PORTABLE=yes # hadolint ignore=SC2046,DL4006 RUN opam install --yes \ - # We must tell Opam to assume external dependencies are installed because it is not able to - # correctly detect and/or install Cargo and Rust compiler packages using the system package - # manager. + # We must tell Opam to assume external dependencies are installed + # because it is not able to correctly detect and/or install Cargo + # and Rust compiler packages using the system package manager. --assume-depexts \ $(opam list --all --short | grep -v ocaml-option-) \ # Pin Tezt to its development version. diff --git a/images/ci/Dockerfile.prebuild b/images/ci/Dockerfile.prebuild index efaeb81af5cf..604f9af0ce25 100644 --- a/images/ci/Dockerfile.prebuild +++ b/images/ci/Dockerfile.prebuild @@ -29,7 +29,6 @@ ARG TARGETARCH COPY --chown=tezos:tezos .gitconfig /home/tezos/ # Rust installer script -COPY --chown=tezos:tezos install-rust.sh /tmp/ COPY --chown=tezos:tezos scripts/install_opam_static.sh /tmp/ COPY --chown=tezos:tezos scripts/install_sccache_static.sh /tmp/ @@ -78,12 +77,9 @@ RUN apk update \ protobuf \ protobuf-dev \ sqlite-static \ + rustup \ sqlite-dev -# Install Cargo and Rust (more information in the shell script) -RUN ./install-rust.sh \ - && rm -rf /tmp/install-rust.sh - ARG OPAM_VERSION ENV OPAM_VERSION=$OPAM_VERSION # Install opam @@ -96,6 +92,13 @@ RUN ./install_sccache_static.sh \ USER tezos WORKDIR /home/tezos +ARG RUST_VERSION +RUN rustup-init -y --default-toolchain ${RUST_VERSION} \ + -t x86_64-unknown-linux-musl + +ENV PATH=/home/tezos/.cargo/bin:$PATH +RUN rustup default ${RUST_VERSION} + # Create an opam-repository directory that is a clone of the public opam repository # filtered to only keep packages which we actually need. COPY --chown=tezos:tezos scripts/create_opam_repo.sh scripts/version.sh octez-deps.opam.locked release-tools-deps.opam.locked dream-httpaf.opam.locked dream.opam.locked cohttp.opam.locked cohttp-lwt.opam.locked cohttp-lwt-unix.opam.locked ./ diff --git a/images/create_ci_images.sh b/images/create_ci_images.sh index 4ecc5326587e..9cb229f54a20 100755 --- a/images/create_ci_images.sh +++ b/images/create_ci_images.sh @@ -207,6 +207,7 @@ build() { --build-arg BUILD_IMAGE="alpine:${alpine_version}" \ --build-arg OCAML_VERSION="${ocaml_version}" \ --build-arg OPAM_VERSION="${opam_version}" \ + --build-arg RUST_VERSION="${recommended_rust_version}" \ --build-arg TARGETARCH="${targetarch}" \ --build-arg NPM_REGISTRY_DOMAIN="${NPM_REGISTRY_DOMAIN:-}" \ --build-arg NPM_REGISTRY="${NPM_REGISTRY:-}" \ -- GitLab From 536975139a3e213d178825ff69e786400b692eb0 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Wed, 10 Dec 2025 15:13:16 +0100 Subject: [PATCH 2/3] tt --- images/ci/Dockerfile.prebuild | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/images/ci/Dockerfile.prebuild b/images/ci/Dockerfile.prebuild index 604f9af0ce25..19fc5e1367b1 100644 --- a/images/ci/Dockerfile.prebuild +++ b/images/ci/Dockerfile.prebuild @@ -77,7 +77,6 @@ RUN apk update \ protobuf \ protobuf-dev \ sqlite-static \ - rustup \ sqlite-dev ARG OPAM_VERSION @@ -93,11 +92,16 @@ USER tezos WORKDIR /home/tezos ARG RUST_VERSION -RUN rustup-init -y --default-toolchain ${RUST_VERSION} \ - -t x86_64-unknown-linux-musl +#RUN rustup-init -y --default-toolchain ${RUST_VERSION} \ +# -t x86_64-unknown-linux-musl + +# hadolint ignore=DL4006 +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ + sh -s -- --default-toolchain ${RUST_VERSION} -y ENV PATH=/home/tezos/.cargo/bin:$PATH -RUN rustup default ${RUST_VERSION} +RUN rustup target add x86_64-unknown-linux-musl && \ + rustup default ${RUST_VERSION} # Create an opam-repository directory that is a clone of the public opam repository # filtered to only keep packages which we actually need. -- GitLab From 3df24afa224d082b92df4dc962b02a2f8414ef9b Mon Sep 17 00:00:00 2001 From: Emma Turner Date: Wed, 10 Dec 2025 14:13:54 +0000 Subject: [PATCH 3/3] (wip): toolchain? --- images/ci/Dockerfile.prebuild | 8 ++------ manifest/product_octez.ml | 3 +-- src/rust_deps/dune | 2 +- src/rustzcash_deps/dune | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/images/ci/Dockerfile.prebuild b/images/ci/Dockerfile.prebuild index 19fc5e1367b1..26e98fef5304 100644 --- a/images/ci/Dockerfile.prebuild +++ b/images/ci/Dockerfile.prebuild @@ -64,6 +64,7 @@ RUN apk update \ perl \ postgresql14-dev \ rsync \ + rustup \ tar \ unzip \ wget \ @@ -92,12 +93,7 @@ USER tezos WORKDIR /home/tezos ARG RUST_VERSION -#RUN rustup-init -y --default-toolchain ${RUST_VERSION} \ -# -t x86_64-unknown-linux-musl - -# hadolint ignore=DL4006 -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ - sh -s -- --default-toolchain ${RUST_VERSION} -y +RUN rustup-init --default-toolchain ${RUST_VERSION} -y ENV PATH=/home/tezos/.cargo/bin:$PATH RUN rustup target add x86_64-unknown-linux-musl && \ diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml index 65826966578b..1e17abd814f6 100644 --- a/manifest/product_octez.ml +++ b/manifest/product_octez.ml @@ -512,7 +512,6 @@ let lib_rustzcash = [ S "targets"; S "liboctez_rustzcash_deps.a"; - S "dlloctez_rustzcash_deps.so"; ]; [ S "deps"; @@ -552,7 +551,7 @@ let octez_rust_deps, lib_wasmer_riscv = ]; [ S "rule"; - [S "targets"; S "liboctez_rust_deps.a"; S "dlloctez_rust_deps.so"]; + [S "targets"; S "liboctez_rust_deps.a"]; [ S "deps"; [S "file"; S "build.sh"]; diff --git a/src/rust_deps/dune b/src/rust_deps/dune index bea693fa87d7..2fc07a4f0086 100644 --- a/src/rust_deps/dune +++ b/src/rust_deps/dune @@ -10,7 +10,7 @@ (dirs :standard .cargo (not target)) (rule - (targets liboctez_rust_deps.a dlloctez_rust_deps.so) + (targets liboctez_rust_deps.a) (deps (file build.sh) (file Cargo.toml) diff --git a/src/rustzcash_deps/dune b/src/rustzcash_deps/dune index 9c60b89c8e80..ddddd69f0ac8 100644 --- a/src/rustzcash_deps/dune +++ b/src/rustzcash_deps/dune @@ -10,7 +10,7 @@ (dirs :standard .cargo (not target)) (rule - (targets liboctez_rustzcash_deps.a dlloctez_rustzcash_deps.so) + (targets liboctez_rustzcash_deps.a) (deps (file build.sh) (file Cargo.toml) -- GitLab