Clean up the Makefile: add make build, remove superseded targets #73

Open
opened 2026-08-09 03:41:47 +02:00 by clawbot · 0 comments
Collaborator

Context

Policy: "The Makefile is authoritative documentation for how the repo is
used... If someone checks out the repo and types make<tab>, they should
see every meaningful operation available. A new contributor should be able
to understand the entire development workflow by reading the Makefile."

The current Makefile fails that test in both directions.

Missing. There is no build target. Policy names make build as an
expected target for building artifacts. The closest thing is a file rule,
bin/mfer: $(SOURCEFILES) mfer/mf.pb.go, which a new contributor will not
discover.

Superseded cruft still present, all predating the scripts-to-rule-them-all
migration and the current hash-pinned multistage Dockerfile:

  • vendor.tzst, modcache.tzst, sneak-mfer.$(ARCH).tzst.dockerimage — a
    manual pre-BuildKit tarball-caching workflow the Dockerfile replaced. The
    vendor.tzst rule runs rm -rf vendor, which is a destructive operation
    sitting in a file nobody reads.
  • DOCKER_IMAGE_CACHE_DIR := $(HOME)/Library/Caches/Docker/... — macOS-only,
    referenced nowhere else.
  • devprereqs — duplicates script/bootstrap with a weaker unpinned install
    path (also covered by #68).
  • $(PROTOC_GEN_GO) at Makefile:35-36 — no target depends on it;
    mfer/mf.pb.go: mfer/mf.proto does not list it as a prerequisite. Dead.
  • godoc — shells out to macOS open.
  • ci: test — leftover from before the Gitea workflow called
    script/cibuild directly, and it is now actively misleading: make ci
    runs only tests, not the real CI gate.
  • fixme — a grep wrapper; harmless but unreferenced by any policy or doc.

Definition of done

  • A make build target exists, is documented in the README Entrypoints
    section, and produces the mfer binary. It goes through a script/build
    entrypoint like every other target, per scripts-to-rule-them-all — the
    Makefile target is a thin shim.
  • Every target listed above is either deleted or justified in a comment
    explaining why it survives. Default to deleting.
  • make<tab> shows only operations that work and that a contributor would
    actually run.
  • All remaining targets are declared in .PHONY where appropriate — the
    current .PHONY line omits several and lists run, which has a real file
    prerequisite.
  • make check, make build, and docker build . all succeed. TODO.md
    updated in the same commit.

Implementation requirements

  • Verify nothing you delete is referenced before deleting it. Check the
    Dockerfile, every file in script/, .gitea/workflows/check.yml,
    README.md, AGENTS.md, and contrib/usage.sh. grep for each target
    name across the whole repo.
  • make run depends on ./bin/mfer and the bin/ build rule; if you change
    how the binary is built, keep make run working.
  • The build must keep the existing ldflags version/gitrev injection and the
    urfave_cli_no_docs build tag. Losing either silently breaks
    mfer --version, which the release checklist depends on.
  • Do not change the Dockerfile's build invocation to use the new target in
    this PR unless you verify the Docker build still succeeds end to end.
  • script/build must be POSIX sh, set -eu, no bashisms, and locate the
    repo root the same way the other scripts do.
  • Commit title must end with (closes #73).
## Context Policy: "The Makefile is authoritative documentation for how the repo is used... If someone checks out the repo and types `make<tab>`, they should see every meaningful operation available. A new contributor should be able to understand the entire development workflow by reading the Makefile." The current Makefile fails that test in both directions. **Missing.** There is no `build` target. Policy names `make build` as an expected target for building artifacts. The closest thing is a file rule, `bin/mfer: $(SOURCEFILES) mfer/mf.pb.go`, which a new contributor will not discover. **Superseded cruft still present**, all predating the scripts-to-rule-them-all migration and the current hash-pinned multistage Dockerfile: - `vendor.tzst`, `modcache.tzst`, `sneak-mfer.$(ARCH).tzst.dockerimage` — a manual pre-BuildKit tarball-caching workflow the Dockerfile replaced. The `vendor.tzst` rule runs `rm -rf vendor`, which is a destructive operation sitting in a file nobody reads. - `DOCKER_IMAGE_CACHE_DIR := $(HOME)/Library/Caches/Docker/...` — macOS-only, referenced nowhere else. - `devprereqs` — duplicates `script/bootstrap` with a weaker unpinned install path (also covered by #68). - `$(PROTOC_GEN_GO)` at `Makefile:35-36` — no target depends on it; `mfer/mf.pb.go: mfer/mf.proto` does not list it as a prerequisite. Dead. - `godoc` — shells out to macOS `open`. - `ci: test` — leftover from before the Gitea workflow called `script/cibuild` directly, and it is now actively misleading: `make ci` runs only tests, not the real CI gate. - `fixme` — a `grep` wrapper; harmless but unreferenced by any policy or doc. ## Definition of done - A `make build` target exists, is documented in the README Entrypoints section, and produces the `mfer` binary. It goes through a `script/build` entrypoint like every other target, per scripts-to-rule-them-all — the Makefile target is a thin shim. - Every target listed above is either deleted or justified in a comment explaining why it survives. Default to deleting. - `make<tab>` shows only operations that work and that a contributor would actually run. - All remaining targets are declared in `.PHONY` where appropriate — the current `.PHONY` line omits several and lists `run`, which has a real file prerequisite. - `make check`, `make build`, and `docker build .` all succeed. `TODO.md` updated in the same commit. ## Implementation requirements - Verify nothing you delete is referenced before deleting it. Check the `Dockerfile`, every file in `script/`, `.gitea/workflows/check.yml`, `README.md`, `AGENTS.md`, and `contrib/usage.sh`. `grep` for each target name across the whole repo. - `make run` depends on `./bin/mfer` and the `bin/` build rule; if you change how the binary is built, keep `make run` working. - The build must keep the existing ldflags version/gitrev injection and the `urfave_cli_no_docs` build tag. Losing either silently breaks `mfer --version`, which the release checklist depends on. - Do not change the `Dockerfile`'s build invocation to use the new target in this PR unless you verify the Docker build still succeeds end to end. - `script/build` must be POSIX sh, `set -eu`, no bashisms, and locate the repo root the same way the other scripts do. - Commit title must end with ` (closes #73)`.
clawbot added this to the 1.0.0 milestone 2026-08-09 03:41:47 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#73