From 18260a27299df653faf3b77be28b286153bdceeb Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 26 Jul 2026 17:30:21 +0000 Subject: [PATCH] docker: fix build.sh's arch-list read for relative invocations a05c58b6b read the arch list back out of the Dockerfile with "$(dirname "$0")/Dockerfile", but build.sh already does cd "$(dirname "$0")" near the top. The dirname is therefore applied twice, so every invocation by a path other than ./build.sh from inside docker/ died before reaching docker build: $ bash wt_r5748/docker/build.sh sed: can't read wt_r5748/docker/Dockerfile: No such file or directory EXIT=2 set -euo pipefail turns the sed failure into an abort, so this broke the whole script rather than just the banner it was meant to print. Use a bare filename, which is what the rest of the script already does (the docker build context below is a bare "."). Verified from the workspace root, from an absolute path, and from docker/ itself: all three now print arch list 7.5;8.0;8.6;8.9;9.0;10.0;12.0+PTX --- docker/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/build.sh b/docker/build.sh index 296953fb62..ad295295b7 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -44,8 +44,10 @@ echo " llama.cpp ${LLAMA_PREBUILT_TAG}" # Read the arch list back out of the Dockerfile rather than repeating it: the # hand-copied banner had already drifted, dropping 7.5 and so under-reporting # Turing support to anyone reading this output. +# Bare filename: the script cd'd to its own directory above, so $0's dirname +# would be applied a second time and break every relative invocation. ARCH_LIST="$(sed -n 's/^[[:space:]]*TORCH_CUDA_ARCH_LIST="\([^"]*\)".*/\1/p' \ - "$(dirname "$0")/Dockerfile" | head -n1)" + Dockerfile | head -n1)" echo " arch list ${ARCH_LIST:-unknown}" echo