Add a make build target and repoint README's last raw go build instruction #19

Closed
opened 2026-08-09 07:01:04 +02:00 by clawbot · 1 comment
Collaborator

Problem

README.md's "Building and running" section still tells the reader to run:

go build ./cmd/rogue

This is the last raw-toolchain instruction left in the docs. #3 fixed the test
path (go test ./game/make test) but deliberately left this one alone,
correctly: there is no build: target to point it at, and adding one inside a
docs-only commit would have broken the docs-only review exception that PR
relied on. So the target has to come first.

The org standard expects the Makefile to be the interface to the toolchain —
make build is one of the standard targets, and this repo's Makefile is
otherwise a complete (if minimal) set: fmt, fmt-check, lint, test,
check.

Definition of done

  1. A build: target in the Makefile that builds the binary, following the
    file's existing conventions (a short comment above it like its neighbors,
    listed in .PHONY).
  2. build is wired into neither check nor test. make check must stay
    exactly fmt-check lint test, and must continue not to modify any file in
    the repo — verify by running make check and confirming git status is
    clean afterwards.
  3. The build output goes somewhere git-ignored; update .gitignore if the
    binary would otherwise land in the working tree. A stray rogue binary
    must not be committable.
  4. README.md's "Building and running" block uses make build, and the
    make-target list in the "Code layout" section mentions it.
  5. No raw go invocation remains anywhere in README.md — grep and confirm.
  6. make check fully green.
  7. TODO.md updated in the same commit — add a Completed Steps entry and
    do not rotate "Next Step" (precedent ratified on PR #9: out-of-band
    issue work leaves Next Step alone).
  8. Commit title ends with (closes #N).

Implementation requirements

  • make targets only for verification — never run go build/go test
    directly, including to check your own target works. Invoke make build.
  • Do NOT add a Dockerfile, CI config, or script/ entrypoints — this repo is
    explicitly exempt.
  • Do NOT modify .golangci.yml.
  • No Go source changes; this is build tooling plus a README edit.
  • Leave the c-master and modern-rogue branches alone.
  • Run make fmt for the markdown and include the result in the commit.
  • Never mention Claude or Anthropic anywhere.

Explicitly out of scope

The org Go styleguide also wants the git commit hash embedded into the binary
and surfaced at startup (the -X main.Version pattern). That is a real gap
here, but it is a separate concern with its own design questions — do not
fold it in. If you think it is worth doing, say so on this issue and I will
file it separately.

Priority

Low. Cosmetic/consistency, no defect behind it.

## Problem `README.md`'s "Building and running" section still tells the reader to run: ```bash go build ./cmd/rogue ``` This is the last raw-toolchain instruction left in the docs. #3 fixed the test path (`go test ./game/` → `make test`) but deliberately left this one alone, correctly: there is no `build:` target to point it at, and adding one inside a docs-only commit would have broken the docs-only review exception that PR relied on. So the target has to come first. The org standard expects the Makefile to be the interface to the toolchain — `make build` is one of the standard targets, and this repo's Makefile is otherwise a complete (if minimal) set: `fmt`, `fmt-check`, `lint`, `test`, `check`. ## Definition of done 1. A `build:` target in the Makefile that builds the binary, following the file's existing conventions (a short comment above it like its neighbors, listed in `.PHONY`). 2. `build` is wired into **neither** `check` nor `test`. `make check` must stay exactly `fmt-check lint test`, and must continue not to modify any file in the repo — verify by running `make check` and confirming `git status` is clean afterwards. 3. The build output goes somewhere git-ignored; update `.gitignore` if the binary would otherwise land in the working tree. A stray `rogue` binary must not be committable. 4. `README.md`'s "Building and running" block uses `make build`, and the make-target list in the "Code layout" section mentions it. 5. No raw `go` invocation remains anywhere in `README.md` — grep and confirm. 6. `make check` fully green. 7. `TODO.md` updated in the same commit — add a Completed Steps entry and **do not rotate "Next Step"** (precedent ratified on PR #9: out-of-band issue work leaves Next Step alone). 8. Commit title ends with ` (closes #N)`. ## Implementation requirements - `make` targets only for verification — never run `go build`/`go test` directly, including to check your own target works. Invoke `make build`. - Do NOT add a Dockerfile, CI config, or `script/` entrypoints — this repo is explicitly exempt. - Do NOT modify `.golangci.yml`. - No Go source changes; this is build tooling plus a README edit. - Leave the `c-master` and `modern-rogue` branches alone. - Run `make fmt` for the markdown and include the result in the commit. - Never mention Claude or Anthropic anywhere. ## Explicitly out of scope The org Go styleguide also wants the git commit hash embedded into the binary and surfaced at startup (the `-X main.Version` pattern). That is a real gap here, but it is a separate concern with its own design questions — do **not** fold it in. If you think it is worth doing, say so on this issue and I will file it separately. ## Priority Low. Cosmetic/consistency, no defect behind it.
Author
Collaborator

Done in 60442ce on next, in #46.

make build builds to build/rogue. build/ is the one place generated artifacts go and .gitignore covers the whole directory, so a stray binary is not committable. build is in neither check nor test; check is still exactly fmt-check lint test, and its recipe now carries a comment saying only non-writing targets belong in that list.

README.md: the "Building and running" block uses make build / ./build/rogue, the four run examples and the wizard-mode example follow, and the make-target list in "Code layout" names build. grep -nE '\bgo (build|test|run|vet|tool|install|get|mod|fmt|generate)\b' README.md returns nothing.

TODO.md has a Completed Steps entry in the same commit; "Next Step" is untouched.

Verification, make targets only:

  • make build printed go build -o build/rogue ./cmd/rogue and produced the binary; git status --porcelain empty with it present.
  • GOFLAGS=-count=1 make check green in 22.5s. The lint layer reported DONE 13.2s with 0 issues., not CACHED, so it executed; the test lines carry real durations (cmd/rogue 1.075s, game 4.049s) with no (cached) marker. git status --porcelain empty afterwards.

One thing outside what the issue asked for: .dockerignore now excludes /build/. The new target puts a 5.4MB binary inside the repo, which was otherwise shipped into the lint build context — the context transferred 6.25MB with the binary present and 72.32kB after the exclusion. Nothing excluded is a Go source, go.mod/go.sum or .golangci.yml.

On the out-of-scope item: embedding the commit hash via -X main.Version is worth doing, and it is bigger than a linker flag — there is no version surface in the binary at all right now, so it needs a main.Version var, a decision about where it is displayed (startup line, a -v flag, or the score screen), and a fallback for builds from a dirty or absent working tree. Worth its own issue.

Done in `60442ce` on `next`, in https://git.eeqj.de/sneak/rgoue/pulls/46. `make build` builds to `build/rogue`. `build/` is the one place generated artifacts go and `.gitignore` covers the whole directory, so a stray binary is not committable. `build` is in neither `check` nor `test`; `check` is still exactly `fmt-check lint test`, and its recipe now carries a comment saying only non-writing targets belong in that list. `README.md`: the "Building and running" block uses `make build` / `./build/rogue`, the four run examples and the wizard-mode example follow, and the make-target list in "Code layout" names `build`. `grep -nE '\bgo (build|test|run|vet|tool|install|get|mod|fmt|generate)\b' README.md` returns nothing. `TODO.md` has a Completed Steps entry in the same commit; "Next Step" is untouched. Verification, `make` targets only: - `make build` printed `go build -o build/rogue ./cmd/rogue` and produced the binary; `git status --porcelain` empty with it present. - `GOFLAGS=-count=1 make check` green in 22.5s. The lint layer reported `DONE 13.2s` with `0 issues.`, not `CACHED`, so it executed; the test lines carry real durations (`cmd/rogue 1.075s`, `game 4.049s`) with no `(cached)` marker. `git status --porcelain` empty afterwards. One thing outside what the issue asked for: `.dockerignore` now excludes `/build/`. The new target puts a 5.4MB binary inside the repo, which was otherwise shipped into the lint build context — the context transferred 6.25MB with the binary present and 72.32kB after the exclusion. Nothing excluded is a Go source, `go.mod`/`go.sum` or `.golangci.yml`. On the out-of-scope item: embedding the commit hash via `-X main.Version` is worth doing, and it is bigger than a linker flag — there is no version surface in the binary at all right now, so it needs a `main.Version` var, a decision about where it is displayed (startup line, a `-v` flag, or the score screen), and a fallback for builds from a dirty or absent working tree. Worth its own issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/rgoue#19