Remove BUILDARCH and stamp the git version in Docker builds (closes #107, closes #109) #108

Merged
clawbot merged 1 commits from issue-107-remove-buildarch into next 2026-10-02 04:13:07 +02:00
Collaborator

No build architecture. Implements #107. The Makefile no longer defines BUILDARCH or passes -X main.Buildarch=.... No Buildarch variable exists in the code, so that flag never set anything. The architecture is available at run time from runtime.GOARCH; neoircd does not report it, and none is added.

The Docker build stamps the git version. Implements #109. A plain docker build . stamped dev into neoircd, because .dockerignore left out .git and the builder declared ARG VERSION=dev. Now:

  • .dockerignore sends .git into the build but leaves out .git/config. A clone's remote URL, or the token a CI checkout stores there, can hold a credential, and git describe does not need that file.
  • The builder takes the version from the VERSION build argument when one is given. Otherwise it uses git describe --tags --always, which gives the tag on a tagged commit and the short commit otherwise. ARG VERSION has no default.
  • If .git is present and the version still comes out empty, dev or unknown, the build fails.

Things the diff does not show:

  • The version shows in the healthcheck JSON and in the IRC welcome. The startup log does not include it, because Identify() is never called. That is unchanged here.
  • A build without .git and without VERSION, such as one from a source tarball, now stamps an empty version, not dev. The IRC welcome already shows dev for an empty version.
  • .git changes on every commit, so a docs-only commit no longer reuses the cached build.

Model: opus-5-5

**No build architecture.** Implements https://git.eeqj.de/sneak/neoirc/issues/107. The `Makefile` no longer defines `BUILDARCH` or passes `-X main.Buildarch=...`. No `Buildarch` variable exists in the code, so that flag never set anything. The architecture is available at run time from `runtime.GOARCH`; `neoircd` does not report it, and none is added. **The Docker build stamps the git version.** Implements https://git.eeqj.de/sneak/neoirc/issues/109. A plain `docker build .` stamped `dev` into `neoircd`, because `.dockerignore` left out `.git` and the builder declared `ARG VERSION=dev`. Now: - `.dockerignore` sends `.git` into the build but leaves out `.git/config`. A clone's remote URL, or the token a CI checkout stores there, can hold a credential, and `git describe` does not need that file. - The builder takes the version from the `VERSION` build argument when one is given. Otherwise it uses `git describe --tags --always`, which gives the tag on a tagged commit and the short commit otherwise. `ARG VERSION` has no default. - If `.git` is present and the version still comes out empty, `dev` or `unknown`, the build fails. Things the diff does not show: - The version shows in the healthcheck JSON and in the IRC welcome. The startup log does not include it, because `Identify()` is never called. That is unchanged here. - A build without `.git` and without `VERSION`, such as one from a source tarball, now stamps an empty version, not `dev`. The IRC welcome already shows `dev` for an empty version. - `.git` changes on every commit, so a docs-only commit no longer reuses the cached build. Model: opus-5-5
clawbot added the needs-review label 2026-10-02 01:00:43 +02:00
clawbot self-assigned this 2026-10-02 01:00:43 +02:00
Author
Collaborator

next is green again (915f56e, #105), so this PR no longer waits on it. It needs a rebase onto current next before its review, and the red-check disclosure in the body no longer applies.

Model: opus-5-5

`next` is green again (`915f56e`, https://git.eeqj.de/sneak/neoirc/pulls/105), so this PR no longer waits on it. It needs a rebase onto current `next` before its review, and the red-check disclosure in the body no longer applies. Model: opus-5-5
clawbot added 1 commit 2026-10-02 03:31:41 +02:00
The Makefile no longer passes a build architecture; it set a variable that
does not exist, and the architecture is available at run time.

A plain docker build now stamps neoircd with the tag or short commit:
.dockerignore sends .git, without its config, and the builder takes the
version from the VERSION build arg when given, otherwise from git describe.
With .git present, an empty, dev or unknown version fails the build.

Model: opus-5-5
clawbot force-pushed issue-107-remove-buildarch from b4d798005e to 04f60eea50 2026-10-02 03:31:41 +02:00 Compare
clawbot changed title from Remove BUILDARCH from the Makefile (closes #107) to Remove BUILDARCH and stamp the git version in Docker builds (closes #107, closes #109) 2026-10-02 03:49:30 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 729c671561 into next 2026-10-02 04:13:07 +02:00
clawbot deleted branch issue-107-remove-buildarch 2026-10-02 04:13:07 +02:00
Sign in to join this conversation.