From 136a67a1faaae62ddcb097b18eb8450ccc3dc896 Mon Sep 17 00:00:00 2001 From: glihm Date: Wed, 10 Jan 2024 14:41:33 -0600 Subject: [PATCH] fix: make devcontainer standalone for rust toolchain version (#1411) --- .devcontainer/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 29720815d3..0895fc1ad4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -11,13 +11,14 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ RUN apt install -y gh libgmp3-dev -COPY rust-toolchain.toml . +# To allow independent workflow of the container, the rust-toolchain is explicitely given. +RUN echo "1.74.0" > rust_toolchain_version # Install cargo-binstall RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash -RUN rustup toolchain install $(cat rust-toolchain.toml | grep channel | cut -d\" -f2) && \ - rustup default $(cat rust-toolchain.toml | grep channel | cut -d\" -f2) && \ +RUN rustup toolchain install $(cat rust_toolchain_version) && \ + rustup default $(cat rust_toolchain_version) && \ rustup component add clippy && \ rustup component add rustfmt @@ -37,14 +38,14 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] ; then \ mv hurl-4.1.0-aarch64-unknown-linux-gnu/hurl /usr/local/bin/ && \ rm -r hurl-4.1.0-aarch64-unknown-linux-gnu && \ rm hurl.tar.gz && \ - rustup component add llvm-tools-preview --toolchain 1.70.0-aarch64-unknown-linux-gnu; \ + rustup component add llvm-tools-preview --toolchain $(cat rust_toolchain_version)-aarch64-unknown-linux-gnu; \ elif [ "$TARGETPLATFORM" = "linux/amd64" ] ; then \ curl -L https://github.com/Orange-OpenSource/hurl/releases/download/4.1.0/hurl-4.1.0-x86_64-unknown-linux-gnu.tar.gz -o hurl.tar.gz && \ tar -xzf hurl.tar.gz && \ mv hurl-4.1.0-x86_64-unknown-linux-gnu/hurl /usr/local/bin/ && \ rm -r hurl-4.1.0-x86_64-unknown-linux-gnu && \ rm hurl.tar.gz && \ - rustup component add llvm-tools-preview --toolchain 1.70.0-x86_64-unknown-linux-gnu && \ + rustup component add llvm-tools-preview --toolchain $(cat rust_toolchain_version)-x86_64-unknown-linux-gnu && \ rustup target add x86_64-fortanix-unknown-sgx --toolchain nightly; \ fi