Skip to content

Commit 8bd4302

Browse files
committed
add more to the 'min' toolchain
* add 'cargo' which is used by some of our Python tooling for cargo metadata * add 'libclang' which is used by bindgen for rockdb
1 parent b4ddfbb commit 8bd4302

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

bin/ci-builder

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ fi
4242
cmd=$1 && shift
4343
flavor=$1 && shift
4444

45-
rust_version=
4645
rust_date=
4746
case "$flavor" in
48-
min) docker_target=ci-builder-min ;;
47+
min)
48+
docker_target=ci-builder-min
49+
rust_version=$(sed -n 's/rust-version = "\(.*\)"/\1/p' Cargo.toml)
50+
;;
4951
stable)
5052
docker_target=ci-builder-full
5153
rust_version=$(sed -n 's/rust-version = "\(.*\)"/\1/p' Cargo.toml)

ci/builder/Dockerfile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ RUN apt-get update --fix-missing && TZ=UTC DEBIAN_FRONTEND=noninteractive apt-ge
5252
python3-setuptools \
5353
xz-utils \
5454
zstd \
55+
# TODO(parkmycar): Include libclang in our Bazel sysroot.
56+
libclang-18-dev \
5557
&& rm -rf /var/lib/apt/lists/*
5658

5759
# Install Python dependencies. These are necessary to run some of our base tooling.
@@ -61,7 +63,14 @@ RUN curl -LsSf https://astral.sh/uv/0.4.25/install.sh | UV_INSTALL_DIR=/usr/loca
6163

6264
# Install extra tools not available in apt repositories.
6365

66+
COPY rust.asc .
67+
RUN gpg --import rust.asc \
68+
&& rm rust.asc \
69+
&& echo "trusted-key 85AB96E6FA1BE5FE" >> ~/.gnupg/gpg.conf
70+
6471
ARG BAZEL_VERSION
72+
ARG RUST_DATE
73+
ARG RUST_VERSION
6574

6675
RUN \
6776
# 1. autouseradd
@@ -85,7 +94,18 @@ RUN \
8594
&& curl -fsSL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-$ARCH_GCC > /usr/local/lib/docker/cli-plugins/docker-compose \
8695
&& chmod +x /usr/local/lib/docker/cli-plugins/docker-compose \
8796
&& curl -fsSL https://github.com/christian-korneck/docker-pushrm/releases/download/v1.9.0/docker-pushrm_linux_$ARCH_GO > /usr/local/lib/docker/cli-plugins/docker-pushrm \
88-
&& chmod +x /usr/local/lib/docker/cli-plugins/docker-pushrm
97+
&& chmod +x /usr/local/lib/docker/cli-plugins/docker-pushrm \
98+
# 4. Cargo
99+
#
100+
# Some parts of our stack use 'cargo' to read metadata, so we install just that. Importantly we
101+
# do not install 'rustc' or any of the other tools, this keeps the Docker image small.
102+
&& mkdir rust \
103+
&& curl -fsSL https://static.rust-lang.org/dist$RUST_DATE/rust-$RUST_VERSION-$ARCH_GCC-unknown-linux-gnu.tar.gz > rust.tar.gz \
104+
&& curl -fsSL https://static.rust-lang.org/dist$RUST_DATE/rust-$RUST_VERSION-$ARCH_GCC-unknown-linux-gnu.tar.gz.asc > rust.asc \
105+
&& gpg --verify rust.asc rust.tar.gz \
106+
&& tar -xzf rust.tar.gz -C rust --strip-components=1 \
107+
&& rust/install.sh --components=cargo \
108+
&& rm -rf rust.asc rust.tar.gz rust
89109

90110
# Make the image as small as possible.
91111
RUN find /workdir /root -mindepth 1 -maxdepth 1 -exec rm -rf {} +

0 commit comments

Comments
 (0)