mirror of
https://github.com/Twigpine/node.git
synced 2026-11-08 17:55:53 -10:00
The Dockerfile cache layer primed from four crate manifests while the workspace has six members, and crates/gl takes a path dependency on icaptcha-client. Cargo loads the whole workspace before resolving, so the layer aborted on the missing manifest and || true swallowed it. Every image build has been a full cold build since icaptcha-client landed, including the docker-build smoke test on every PR. Copy all six manifests, and drop the || true: the layer is expected to succeed, and tolerating its failure is what let this sit dead unnoticed. Dockerfile.bins pinned rust:1.85-bookworm against a workspace rust-version of 1.91. An unmet MSRV is a hard cargo error, so both Linux musl targets of scripts/build-bins.sh have been unbuildable. Nothing in CI builds that file, which is why nothing reported it. Closes #265 Closes #266
35 lines
1.2 KiB
Docker
35 lines
1.2 KiB
Docker
# Builds gl and git-remote-gitlawb for the target platform.
|
|
# ARG TARGET must be set: x86_64-unknown-linux-musl or aarch64-unknown-linux-musl
|
|
# Used by scripts/build-bins.sh — not used for node deployment.
|
|
ARG TARGET=x86_64-unknown-linux-musl
|
|
|
|
# Must stay at or above the workspace `rust-version` in Cargo.toml. An unmet
|
|
# MSRV is a hard cargo error, and nothing in CI builds this file, so a stale
|
|
# base image here fails only when someone runs scripts/build-bins.sh.
|
|
FROM rust:1.91-bookworm AS builder
|
|
ARG TARGET
|
|
|
|
WORKDIR /build
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
musl-tools \
|
|
gcc-aarch64-linux-gnu \
|
|
pkg-config \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Add the musl targets
|
|
RUN rustup target add x86_64-unknown-linux-musl aarch64-unknown-linux-musl
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY crates/ crates/
|
|
|
|
# Configure cross-linker for aarch64
|
|
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc
|
|
|
|
RUN cargo build --release --locked --target "$TARGET" -p gl -p git-remote-gitlawb
|
|
|
|
FROM debian:bookworm-slim
|
|
ARG TARGET
|
|
COPY --from=builder /build/target/$TARGET/release/gl /gl
|
|
COPY --from=builder /build/target/$TARGET/release/git-remote-gitlawb /git-remote-gitlawb
|