Skip to content

Commit 6314273

Browse files
Mossakaclaude
andcommitted
fix: use custom BASE_IMAGE arg to override cross-rs Docker base images
Cross 0.2.5 always overrides CROSS_BASE_IMAGE with its own :0.2.5 tagged image. Use a custom BASE_IMAGE build arg instead, which cross doesn't override, to use the :main tagged images (Ubuntu 20.04+). This provides modern toolchains (protoc 3.x, libclang 10+) while keeping the cross 0.2.5 binary compatible with rustc 1.85.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 774e3cb commit 6314273

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cross.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ default-target = "x86_64-unknown-linux-musl"
33

44
[target.aarch64-unknown-linux-musl.dockerfile]
55
file = "cross/Dockerfile.musl"
6-
build-args = { CROSS_BASE_IMAGE = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main", CROSS_CMAKE_SYSTEM_PROCESSOR = "aarch64", CROSS_SYSROOT = "/usr/local/aarch64-linux-musl" }
6+
build-args = { BASE_IMAGE = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main", CROSS_CMAKE_SYSTEM_PROCESSOR = "aarch64", CROSS_SYSROOT = "/usr/local/aarch64-linux-musl" }
77

88
[target.x86_64-unknown-linux-musl.dockerfile]
99
file = "cross/Dockerfile.musl"
10-
build-args = { CROSS_BASE_IMAGE = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main", CROSS_CMAKE_SYSTEM_PROCESSOR = "x86_64", CROSS_SYSROOT = "/usr/local/x86_64-linux-musl" }
10+
build-args = { BASE_IMAGE = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main", CROSS_CMAKE_SYSTEM_PROCESSOR = "x86_64", CROSS_SYSROOT = "/usr/local/x86_64-linux-musl" }
1111

1212
[target.aarch64-unknown-linux-gnu.dockerfile]
1313
file = "cross/Dockerfile.gnu"
14-
build-args = { CROSS_BASE_IMAGE = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main" }
14+
build-args = { BASE_IMAGE = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main" }
1515

1616
[target.x86_64-unknown-linux-gnu.dockerfile]
1717
file = "cross/Dockerfile.gnu"
18-
build-args = { CROSS_BASE_IMAGE = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main" }
18+
build-args = { BASE_IMAGE = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main" }

cross/Dockerfile.gnu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ARG CROSS_BASE_IMAGE
1+
ARG BASE_IMAGE
22
ARG CROSS_DEB_ARCH
3-
FROM $CROSS_BASE_IMAGE
3+
FROM ${BASE_IMAGE}
44

55
ARG CROSS_DEB_ARCH
66
RUN dpkg --add-architecture ${CROSS_DEB_ARCH} && \

cross/Dockerfile.musl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG CROSS_BASE_IMAGE
2-
FROM $CROSS_BASE_IMAGE
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
33

44
ARG CROSS_CMAKE_SYSTEM_PROCESSOR
55
ARG CROSS_SYSROOT

0 commit comments

Comments
 (0)