File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ concurrency:
3434jobs :
3535 build-push-single-arch :
3636 runs-on : ubuntu-latest
37- timeout-minutes : 30
37+ timeout-minutes : 60
3838
3939 steps :
4040 - uses : actions/checkout@v4
Original file line number Diff line number Diff line change 33# The recipe will change ONLY when Cargo.toml changes.
44FROM rust:1.94.0-bookworm AS chef
55
6+ ARG TARGETARCH=amd64
7+ ARG CARGO_CHEF_VERSION=0.1.73
8+
69WORKDIR /opt/mega
710
8- # Install cargo-chef, a tool to cache Rust dependencies efficiently
9- RUN cargo install cargo-chef --version 0.1.73
11+ # Prebuilt cargo-chef (avoids compiling it on every cold planner layer).
12+ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl \
13+ && rm -rf /var/lib/apt/lists/* \
14+ && set -eux \
15+ && case "$TARGETARCH" in \
16+ amd64) chef_arch=x86_64-unknown-linux-musl ;; \
17+ arm64) chef_arch=aarch64-unknown-linux-gnu ;; \
18+ *) echo "unsupported TARGETARCH=$TARGETARCH" >&2; exit 1 ;; \
19+ esac \
20+ && curl -fsSL "https://github.com/LukeMathWalker/cargo-chef/releases/download/v${CARGO_CHEF_VERSION}/cargo-chef-${chef_arch}.tar.gz" \
21+ | tar xz -C /usr/local/cargo/bin
1022
1123COPY Cargo.toml ./
1224COPY api-model/Cargo.toml api-model/
@@ -43,10 +55,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4355 libssl-dev \
4456 ca-certificates \
4557 clang \
58+ mold \
4659 protobuf-compiler \
4760 libprotobuf-dev \
4861 && rm -rf /var/lib/apt/lists/*
4962
63+ # Faster linking (release deps + final mono link).
64+ ENV RUSTFLAGS="-C link-arg=-fuse-ld=mold"
5065
5166# Copy the dependency recipe from the planner stage
5267COPY --from=chef /opt/mega/recipe.json recipe.json
You can’t perform that action at this time.
0 commit comments