From 75cfc069cc85e48400f001dce60530d8c6870c12 Mon Sep 17 00:00:00 2001 From: Daniel Trick Date: Fri, 20 Sep 2024 23:53:58 +0200 Subject: [PATCH] Included the 'cargo-rebuild' command. --- CHANGELOG.md | 5 +++ Dockerfile | 52 ++++++++------------------------ README.md | 2 +- bin/cargo-rebuild.sh | 3 ++ {src => bin}/install_packages.sh | 0 5 files changed, 22 insertions(+), 40 deletions(-) create mode 100755 bin/cargo-rebuild.sh rename {src => bin}/install_packages.sh (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d25bc25..6641d69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). +## Unstable/Sid r4 - 2024-09-20 + +### Added +- Included the `cargo-rebuild` command. + ## Unstable/Sid r3 - 2024-09-10 ### Added diff --git a/Dockerfile b/Dockerfile index 0c76dee..beef903 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,60 +1,34 @@ # Debian Version -ARG DEBIAN_VERS=debian:sid-20240904-slim - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Stage #1 -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -FROM $DEBIAN_VERS AS build +FROM debian:sid-20240904-slim # Rust version -ARG RUST_VERSION=nightly-2024-09-10 - -# Set up environment -ENV RUSTUP_HOME=/opt/rust/rustup -ENV CARGO_HOME=/opt/rust/cargo - -# Provide the 'install_packages' tool -COPY src/install_packages.sh /usr/sbin/install_packages - -# Install build dependencies -RUN install_packages \ - ca-certificates \ - curl \ - rdfind - -# Install Rust -RUN curl https://sh.rustup.rs -sSf | \ - sh -s -- --default-toolchain=${RUST_VERSION} --profile=minimal -y \ - && ${CARGO_HOME}/bin/rustup component add rustfmt \ - && rdfind -makeresultsfile false -makesymlinks true /opt/rust/ - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Stage #2 -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -FROM $DEBIAN_VERS +ARG RUST_VERSION=nightly-2024-09-20 # Set up environment -ENV RUSTUP_HOME=/opt/rust/rustup -ENV CARGO_HOME=/opt/rust/cargo +ENV CARGO_HOME="/usr/local/cargo" +ENV RUSTUP_HOME="/usr/local/rustup" ENV CARGO_TARGET_DIR=/var/tmp/rust/target # Provide the 'install_packages' tool -COPY --from=build /usr/sbin/install_packages /usr/sbin/ - -# Copy Rust/Cargo files -COPY --from=build /opt/rust/ /opt/rust/ +COPY bin/install_packages.sh /usr/sbin/install_packages # Install runtime dependencies RUN install_packages \ ca-certificates \ + curl \ gcc \ libclang-dev \ libtss2-dev \ pkg-config \ uuid-dev -# Copy Rust/Cargo files -COPY --from=build /opt/rust/ /opt/rust/ +# Install Rust +RUN curl https://sh.rustup.rs -sSf | \ + sh -s -- --default-toolchain=${RUST_VERSION} --profile=minimal -y \ + && ${CARGO_HOME}/bin/rustup component add rustfmt + +# Copy 'rebuild' command +COPY bin/cargo-rebuild.sh /usr/local/cargo/bin/cargo-rebuild # Copy entry-point script COPY bin/entry-point.sh /opt/rust/entry-point.sh diff --git a/README.md b/README.md index d1a31e8..e9d8f83 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,6 @@ Version history | **Release** | **Date** | **Base system** | **Rust toolchain** | **TPM2 Software Stack** | | ----------- | ---------- | --------------------------------- | ------------------ | ----------------------- | -| r3 | 2024-09-10 | Debian Unstable (Sid), 2024-09-04 | 1.83.0-nightly | 4.1.3-1 | +| r4 | 2024-09-20 | Debian Unstable (Sid), 2024-09-04 | 1.83.0-nightly | 4.1.3-1 | | r2 | 2024-09-05 | Debian Unstable (Sid), 2024-09-04 | 1.81.0 | 4.1.3-1 | | r1 | 2024-09-03 | Debian Unstable (Sid), 2024-08-13 | 1.80.0 | 4.1.3-1 | diff --git a/bin/cargo-rebuild.sh b/bin/cargo-rebuild.sh new file mode 100755 index 0000000..4042202 --- /dev/null +++ b/bin/cargo-rebuild.sh @@ -0,0 +1,3 @@ +#!/bin/bash -ex +cargo clean +cargo build "${@:2}" diff --git a/src/install_packages.sh b/bin/install_packages.sh similarity index 100% rename from src/install_packages.sh rename to bin/install_packages.sh