weiqingy commented on code in PR #2371:
URL: https://github.com/apache/auron/pull/2371#discussion_r3554708590
##########
auron-build.sh:
##########
@@ -165,6 +168,19 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
+ --platform)
+ if [[ -n "$2" && "$2" != -* ]]; then
+ DOCKER_PLATFORM="$2"
+ if [[ ! "$DOCKER_PLATFORM" =~
^[a-z0-9_.-]+/[a-z0-9_.-]+(/[a-z0-9_.-]+)?$ ]]; then
Review Comment:
Given the x86_64-only images, `--platform linux/arm64` passes this regex and
then fails deep inside the image build — `ubuntu24`/`debian11` hard-code
`JAVA_HOME=/usr/lib/jvm/java-*-openjdk-amd64` — with an error pointing nowhere
near the flag.
Which raises the question I keep circling: if `linux/amd64` is the only
platform these images can build, the flag's one legal value is also its
default. Is arm64 meant to work eventually — in which case the Dockerfiles need
an arch-aware toolchain and `JAVA_HOME`, and `RUSTFLAGS` can't stay pinned to
`skylake`? Or is amd64 the only supported target, in which case would the
compose default alone be enough, without the flag?
##########
dev/docker-build/docker-compose.yml:
##########
@@ -17,6 +17,7 @@
services:
build-release:
+ platform: ${AURON_DOCKER_PLATFORM:-linux/amd64}
Review Comment:
This line is also the answer to the amd64-on-ARM question raised in the
thread, I think. Every build image installs an x86_64 Rust toolchain
(`--default-toolchain nightly-2025-05-09-x86_64-unknown-linux-gnu`, in all five
Dockerfiles), and `docker-compose.yml:34` pins `RUSTFLAGS: "-C
target-cpu=skylake"` unconditionally. So with `platform: linux/amd64` it's an
x86_64 `rustc`, running under emulation, emitting x86_64/Skylake codegen — the
artifact should be the one a native amd64 host would produce, not an arm64
binary. Emulation costs build time, not correctness.
Worth noting the converse too: *without* this line, an arm64 host builds
arm64 base images and then installs an x86_64 `rustc` it can't execute. So this
looks less like "let me cross-build" and more like a fix for Docker mode on ARM
hosts — which might be worth saying in the PR description, since it currently
says there are no user-facing changes.
That's from reading the images rather than running the build, so worth a
sanity check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]