fix: resolve doubled toolchain path in CI build

The find command on cache hit returns an absolute path
(e.g., /tmp/toolchain/x86-64--musl--stable-2025.08-1),
but the PATH/CC lines were prepending /tmp/toolchain/ again,
causing /tmp/toolchain//tmp/toolchain/... to fail.
This commit is contained in:
root 2026-04-24 14:40:58 +08:00
parent 288635adfc
commit 96a1bc9f1f

View file

@ -209,9 +209,9 @@ jobs:
echo "Using cached toolchain: $TOOLCHAIN_DIR"
fi
export PATH="$(realpath "/tmp/toolchain/$TOOLCHAIN_DIR")/bin:$PATH"
export CC=$(realpath "$(find "/tmp/toolchain/$TOOLCHAIN_DIR/bin" -name '*-gcc.br_real' -type f -executable | head -n1)")
[ -z "$CC" ] && { echo "No gcc.br_real found in /tmp/toolchain/$TOOLCHAIN_DIR/bin" >&2; exit 1; }
export PATH="$(realpath "$TOOLCHAIN_DIR")/bin:$PATH"
export CC=$(realpath "$(find "$TOOLCHAIN_DIR/bin" -name '*-gcc.br_real' -type f -executable | head -n1)")
[ -z "$CC" ] && { echo "No gcc.br_real found in $TOOLCHAIN_DIR/bin" >&2; exit 1; }
go build -ldflags "-w -s -linkmode external -extldflags '-static'" -o xui-release -v main.go
file xui-release
ldd xui-release || echo "Static binary confirmed"