fix(build): stamp gatewayVersion/runtimeVersion in the right package

-X main.gatewayVersion/main.runtimeVersion targeted package main, but
those vars live in internal/app/archied (cmd/archied is a thin
wrapper). An -X target that doesn't exist is silently ignored by the
linker, so every archied binary this shipped -- task build, install.sh,
Dockerfile.archied, and the carina self-update script -- reported
"dev" instead of its real version. Point every one of those ldflags at
the actual package.

Also, while chasing the carina incident this surfaced:

- restart.go: /restart didn't check for an in-flight /update install.
  The install runs as archied's own child process, so a restart killed
  it mid-build (observed: "signal: terminated") instead of letting it
  finish or fail cleanly. Refuse the restart while updateInProgress.
- update.go / update_report.go: the "no version could be confirmed
  running" branch still opened with "Update complete", contradicting
  its own next clause. Reworded so an unverified outcome isn't
  reported as completion.
This commit is contained in:
sam committed 2026-09-02 00:00:32 +10:00
1 parent bd5d4b9b13
commit 1425050506
8 files changed
+59 -35

No files matched your search

+1 -1
View File
@@ -126,7 +126,7 @@ install -m755 "$source_dir/scripts/archie-update-check" "$BIN_DIR/archie-update-
if [[ ",$components," == *,daemon,* ]]; then
echo "==> building archied $GW"
go build -ldflags "-X main.gatewayVersion=$GW -X main.runtimeVersion=$RT -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" \
go build -ldflags "-X github.com/samcharles93/archie-core/internal/app/archied.gatewayVersion=$GW -X github.com/samcharles93/archie-core/internal/app/archied.runtimeVersion=$RT -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" \
-o "$tmp/archied" ./cmd/archied
fi
if [[ ",$components," == *,daemon,* ]]; then