oficina / docs Public

Release builds: no VCS stamping inside a git archive

scripts/build-release.sh builds from a git archive in a temp directory,
which has no repository of its own; the version is stamped by ldflags.
With VCS stamping on, Go walked up into whatever repository enclosed the
temp directory — on the CI runner an unrelated checkout it could not read
— and failed TestReleaseBinaryReportsItsVersion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev fd6acc4c2823e6d370d18be1db28f554df1ee974 parent 07145a9
1 file changed, +5 −1
  • scripts/build-release.sh +5 −1

CI passed — run details

diff --git a/scripts/build-release.sh b/scripts/build-release.sh
index 5ecafa1..d829974 100755
--- a/scripts/build-release.sh
+++ b/scripts/build-release.sh
@@ -29,8 +29,12 @@ docs_source=$(mktemp -d)
trap 'rm -rf -- "$docs_source"' EXIT
git archive "$docs_revision" | tar -x -C "$docs_source"
cd "$docs_source"
+# -buildvcs=false: this tree is a git archive with no repository of its
+# own, and the version is stamped above. Left on, Go walks up from the
+# temp directory into whatever repository encloses it — on a CI runner,
+# an unrelated checkout it cannot read — and fails the build (2026-09-29).
CGO_ENABLED=0 GOOS="${GOOS:-linux}" GOARCH="${GOARCH:-arm64}" \
- go build -mod=readonly -trimpath \
+ go build -mod=readonly -trimpath -buildvcs=false \
-ldflags "-s -w -X github.com/carlosframework/rastrillo.BuildVersion=$docs_version" \
-o "$docs_output" ./cmd/docs