From 444d37824f965d9b91458a5c5aee36ac924a9e1e Mon Sep 17 00:00:00 2001 From: GroM Date: Tue, 23 Jan 2024 16:03:51 +0100 Subject: [PATCH] set default Rust toolchain to stable --- CHANGELOG.md | 5 +++++ full/Dockerfile | 27 ++++++++++++++++----------- legacy/Dockerfile | 25 +++++++++++++++---------- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed0d89..77b4a16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.14.0] - 2024-01-23 + +### Changed + - [full, legacy, dev-tools] Default Rust toolchain set to stable 1.75.0 + ## [3.13.0] - 2024-01-18 ### Changed diff --git a/full/Dockerfile b/full/Dockerfile index c8e6119..1478e77 100644 --- a/full/Dockerfile +++ b/full/Dockerfile @@ -3,6 +3,9 @@ FROM ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest ARG RUST_STABLE_VERSION=1.75.0 ARG RUST_NIGHTLY_VERSION=nightly-2023-11-10 +ENV RUST_STABLE=$RUST_STABLE_VERSION +ENV RUST_NIGHTLY=$RUST_NIGHTLY_VERSION + # Add curl for Rust buildchain RUN apk add --update-cache --upgrade curl @@ -15,17 +18,18 @@ RUN apk add rustup # Adding cargo binaries to PATH ENV PATH=${CARGO_HOME}/bin:${PATH} -# Installing rustup and setting the default toolchain to the RUST_NIGHTLY_VERSION nightly channel. -RUN rustup-init --default-toolchain $RUST_NIGHTLY_VERSION -y +# Installing rustup and setting the default toolchain to the RUST_STABLE_VERSION channel. +RUN rustup-init --default-toolchain $RUST_STABLE_VERSION -y -# Installing stable channel version RUST_STABLE_VERSION as well (for cargo-ledger installation). -RUN rustup install $RUST_STABLE_VERSION +# Installing nightly channel version RUST_NIGHTLY_VERSION (for Rust applications). +RUN rustup install $RUST_NIGHTLY_VERSION -# Adding ARMV6M target to the installed nightly toolchain -RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_NIGHTLY_VERSION +# Adding ARMV6M target to the installed stable toolchain +RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_STABLE_VERSION -# Adding rust-src component to nightly channel +# Adding rust-src component to nightly and stable channels RUN rustup component add rust-src --toolchain $RUST_NIGHTLY_VERSION +RUN rustup component add rust-src --toolchain $RUST_STABLE_VERSION # Python packages building dependencies, can be removed afterwards RUN apk add -t python_build_deps python3-dev \ @@ -37,11 +41,12 @@ RUN pip3 install ledgerwallet==0.4.0 # Cleanup, remove packages that aren't needed anymore RUN apk del python_build_deps -# Add cargo ledger (needs a version of Rust >= 1.70) -RUN cargo +$RUST_STABLE_VERSION install --version 1.2.3 cargo-ledger +# Add cargo ledger +#RUN cargo +$RUST_STABLE_VERSION install --version 1.2.4 cargo-ledger +RUN cargo +$RUST_STABLE_VERSION install --git https://github.com/LedgerHQ/ledger-device-rust-sdk.git --branch feat/use_nightly_toolchain_explicitly cargo-ledger -# Setup cargo ledger (install JSON target files) -RUN cargo ledger setup +# Setup cargo ledger (install JSON target files) for nightly +RUN cargo +$RUST_NIGHTLY_VERSION ledger setup # Add a global Cargo config file (includes mandatory unstable features used to build our apps) ADD ./full/cargo_global_config.toml $CARGO_HOME/config.toml diff --git a/legacy/Dockerfile b/legacy/Dockerfile index 4b6e081..eaa50f6 100644 --- a/legacy/Dockerfile +++ b/legacy/Dockerfile @@ -10,6 +10,10 @@ ARG LLVM_VERSION=12 ARG RUST_STABLE_VERSION=1.75.0 ARG RUST_NIGHTLY_VERSION=nightly-2023-11-10 +ENV RUST_STABLE="+1.75.0" +ENV RUST_NIGHTLY="+nightly-2023-11-10" + + RUN apt-get update && apt-get upgrade -qy RUN apt-get install -qy \ clang-$LLVM_VERSION \ @@ -59,27 +63,28 @@ ENV PATH=/opt/gcc-arm-none-eabi-${TOOLCHAIN_VERSION}/bin:$PATH \ # Adding cargo binaries to PATH ENV PATH=${CARGO_HOME}/bin:${PATH} -# Installing rustup to manage rust toolchainsand setting the default toolchain to the RUST_NIGHTLY_VERSION nightly channel. +# Installing rustup to manage rust toolchains and setting the default toolchain to the RUST_STABLE_VERSION stable channel. RUN curl https://sh.rustup.rs -sSf | \ - sh -s -- --default-toolchain $RUST_NIGHTLY_VERSION -y + sh -s -- --default-toolchain $RUST_STABLE_VERSION -y -# Installing stable channel version RUST_STABLE_VERSION as well (for cargo-ledger installation). -RUN rustup install $RUST_STABLE_VERSION +# Installing nightly channel version RUST_NIGHTLY_VERSION +RUN rustup install $RUST_NIGHTLY_VERSION -# Adding ARMV6M target to the installed nightly toolchain -RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_NIGHTLY_VERSION +# Adding ARMV6M target to the installed stable toolchain +RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_STABLE_VERSION -# Adding rust-src component to nightly channel +# Adding rust-src component to nightly and stable channels RUN rustup component add rust-src --toolchain $RUST_NIGHTLY_VERSION +RUN rustup component add rust-src --toolchain $RUST_STABLE_VERSION # Add ledgerwallet python package used by cargo ledger to generate the app APDU file RUN pip3 install ledgerwallet==0.4.0 -# Add cargo ledger (needs a version of Rust >= 1.70) -RUN cargo +$RUST_STABLE_VERSION install --version 1.2.3 cargo-ledger +# Add cargo ledger +RUN cargo +$RUST_STABLE_VERSION install --version 1.2.4 cargo-ledger # Setup cargo ledger (install JSON target files) -RUN cargo ledger setup +RUN cargo $RUST_NIGHTLY_VERSION ledger setup # Adding LLVM-15 APT repository and installing it RUN wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -