Skip to content

Visual Studio Code, rebuilt in Rust

Rust

build(linux): install cargo-gc in the Linux build image

rokarturee8d0b3f4f49
diff --git a/port/tools/linux/Dockerfile b/port/tools/linux/Dockerfile
index 851caf9ea02..b5a7548f6a9 100644
--- a/port/tools/linux/Dockerfile
+++ b/port/tools/linux/Dockerfile
@@ -18,3 +18,14 @@ COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules/npm /usr/local/lib/node_modules/npm
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
+
+# cargo-gc, so builds run as `cargo gc <cmd>` here too and the target volume stays bounded.
+RUN arch=$(uname -m) \
+ && case $arch in \
+ aarch64) sum=74291a050e0d2c258eebed7979b80e0d65b6f6684ff7cb03b6650f5a85ed1470 ;; \
+ x86_64) sum=29476ae8128827cda3e3a3ed9b46bbe482966ecdd8d7eaf2543f54d88a3db260 ;; \
+ esac \
+ && curl -fsSL -o /tmp/cargo-gc.tgz "https://github.com/leostera/cargo-gc/releases/download/v0.1/cargo-gc-v0.1-$arch-unknown-linux-gnu.tar.gz" \
+ && echo "$sum /tmp/cargo-gc.tgz" | sha256sum -c - \
+ && tar xzf /tmp/cargo-gc.tgz -C /usr/local/cargo/bin ./cargo-gc \
+ && rm /tmp/cargo-gc.tgz