-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rework rust installation (#426)
* chore: remove warning from bats test * ci: fix tool version update issue creation and content * chore: switch to ubuntu based rustup and cargo-binstall Rustup is present as apt package in 24.04 cargo-binstall installs binaries for most cargo provided tools * chore: fix probe-rs installation on aarch64
- Loading branch information
Showing
5 changed files
with
27 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FROM ubuntu:24.04@sha256:3f85b7caad41a95462cf5b787d8a04604c8262cdcdf9a472b8c52ef83375fe15 | ||
|
||
ARG BATS_VERSION=1.10.0 | ||
ARG CARGO_BINSTALL_VERSION=1.6.8 | ||
ARG RUST_VERSION=1.78.0 | ||
ARG RUSTUP_INIT_VERSION=1.26.0 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
|
@@ -23,17 +23,12 @@ RUN wget -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https:/ | |
&& update-ca-certificates | ||
|
||
# Install rust | ||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
ENV CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:"$PATH" | ||
RUN declare -A RUSTUP_SHA \ | ||
RUSTUP_SHA["x86_64"]="0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db" \ | ||
RUSTUP_SHA["aarch64"]="673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800" \ | ||
&& wget -qO /tmp/rustup-init "https://static.rust-lang.org/rustup/archive/${RUSTUP_INIT_VERSION}/$(uname -m)-unknown-linux-gnu/rustup-init" \ | ||
&& echo "${RUSTUP_SHA[$(uname -m)]} /tmp/rustup-init" | sha256sum -c - \ | ||
&& chmod +x /tmp/rustup-init \ | ||
&& /tmp/rustup-init -y --no-modify-path --default-toolchain=${RUST_VERSION} --component llvm-tools --target thumbv7em-none-eabi \ | ||
&& rm -rf /tmp/rustup-init | ||
RUN rustup set profile minimal \ | ||
&& rustup default ${RUST_VERSION} \ | ||
&& rustup component add clippy llvm-tools rustfmt \ | ||
&& rustup target add thumbv7em-none-eabi | ||
|
||
# Install bats | ||
RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \ | ||
|
@@ -46,15 +41,8 @@ RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \ | |
# Update all tool alternatives to the correct version | ||
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-13 20 | ||
|
||
# hadolint ignore=DL3008 | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends libudev-dev \ | ||
&& cargo install cargo-binutils \ | ||
&& cargo install cargo-mutants \ | ||
&& cargo install flip-link \ | ||
&& cargo install probe-rs --features cli \ | ||
&& rm -rf "$CARGO_HOME/registry" \ | ||
&& apt-get purge -y libudev-dev \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Install additional rust tools | ||
RUN wget -qO - "https://github.com/cargo-bins/cargo-binstall/releases/download/v${CARGO_BINSTALL_VERSION}/cargo-binstall-$(uname -m)-unknown-linux-gnu.tgz" | tar xz -C "/usr/bin" \ | ||
&& cargo-binstall -y --locked [email protected] [email protected] [email protected] \ | ||
# cargo-binstall can't (yet) install probe-rs-tools for aarch64, fall-back to script installation | ||
&& wget -qO - https://github.com/probe-rs/probe-rs/releases/download/v0.24.0/probe-rs-tools-installer.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters