Skip to content

Commit

Permalink
fix(rust): Try and find why our toolchain keeps getting re-installed
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenj committed May 7, 2024
1 parent cb873b6 commit 04b10ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions earthly/rust/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,19 @@ rust-base-plus-tools:
installer:
FROM +rust-base-plus-tools

RUN rustup show

# Call +INIT before copying the source file to avoid installing dependencies every time source code changes.
# This parametrization will be used in future calls to functions of the library
# Init using the common cat-ci cache prefix.
DO rust+INIT --keep_fingerprints=true

RUN rustup show

DO rust+SET_CACHE_MOUNTS_ENV

RUN rustup show

# Install the default cargo config, and ensure its in the cached CARGO_HOME as well.
COPY stdcfgs/cargo_config.toml $CARGO_INSTALL_ROOT/config.toml
DO +EXECUTE --cmd="cp $CARGO_INSTALL_ROOT/config.toml $CARGO_HOME/config.toml"
Expand All @@ -134,6 +140,8 @@ installer:
# This is to enforce consistent compiler and tool configuration on local setup and CI builds.
COPY --dir stdcfgs /stdcfgs

RUN rustup show

# Builds all the rust-base targets for each supported DOCKER architecture.
# Currently only used for multi-platform cross build testing.
# This will ONLY work if you have `qemu` properly setup on linux and `rosetta` for
Expand Down Expand Up @@ -270,10 +278,14 @@ SETUP:
FUNCTION
FROM +installer

RUN rustup show

ARG toolchain=./rust-toolchain.toml

# Copy our toolchain dependency.
COPY $toolchain ./rust-toolchain.toml

RUN rustup show

# Toolchain MUST be the same as vendored, and if it is the toolchain is
# already installed.

0 comments on commit 04b10ed

Please sign in to comment.