Artifact 5682bc9eee458549d0391b89bba10e96a08679388327dbabe40577da52415a16:
- File
Makefile
— part of check-in
[6be29eb1b4]
at
2026-08-25 22:08:06
on branch trunk
— Name the per-machine config .env.local, and ship an example
dev.local.mk said nothing about what it held, so the only way to learn what `make dev` needed was to read someone's copy — and there was no copy to read, because it is not committed.
.env.local now holds one named key per setting instead of a single 1,697-character DEV_ARGS line, and the Makefile composes the flags. A key left empty is omitted from the command line rather than passed as an empty string, which the server would read as a deliberate value. Corpus repositories are named once each and their paths derived, rather than --repo name=path repeated twenty-three times.
.env.example is committed and documents every key, including which two are secrets and which of --data and --oltp survives a rebuild.
dev.local.mk is still included, so an existing checkout keeps working, and both names are ignored. Verified equivalent: the old file and the new one produce the same 8 flags and the same 23 repositories.
`make dev-args` prints the composed flags without starting anything. (user: dmestas, size: 2681) [annotate] [blame] [check-ins using]
# Local gates — run before every commit. CI (dagnats, later) runs the same. .PHONY: check test vet build fixtures fixtures-real spec-lint docs dev check: vet test build # Spec correctness gate (0003 §2): lint the generated OpenAPI document with # an off-the-shelf validator. Dev/CI tool only — never a runtime dep. spec-lint: go run ./cmd/quarry spec > /tmp/quarry-spec.json go run github.com/daveshanley/[email protected] lint --no-banner --no-style --fail-severity error /tmp/quarry-spec.json # API reference, generated from the op registry (0003: docs are a phase # exit criterion). TestDocsCurrent fails the build when this is stale. docs: go run ./cmd/quarry docs > docs/api.md # Synthetic disposability fixture (fast; the CI corpus). fixtures: fixtures/build-synthetic.sh # Real corpus (sqlite, tcl) — large clones, opt-in. fixtures-real: fixtures/build-real.sh test: go test ./... vet: go vet ./... build: go build ./... # Third-party licence inventory served at /licenses. licenses: go run ./cmd/licensegen > internal/legal/licenses.json # Dev loop: rebuild and restart the server whenever a .go file changes # (wgo: go install github.com/bokwoon95/wgo@latest). # # Per-machine settings come from .env.local, which is not committed; copy # .env.example to start one. dev.local.mk is the previous name and is # still read, so an existing checkout keeps working. -include .env.local -include dev.local.mk # Each corpus repository is named once in QUARRY_CORPUS_REPOS and its path # derived, rather than repeating --repo name=path twenty-odd times. corpus_repo_flags = $(foreach r,$(QUARRY_CORPUS_REPOS),--repo $(r)=$(QUARRY_CORPUS)/$(r)) extra_repo_flags = $(foreach r,$(QUARRY_EXTRA_REPOS),--repo $(r)) # Only the settings that were given become flags: an empty key is left out # entirely rather than passed as an empty string, which the server would # read as a deliberate value. optional = $(if $(2),--$(1) $(2)) # ?= so a .env.local that still sets DEV_ARGS wholesale keeps winning. DEV_ARGS ?= \ $(call optional,addr,$(QUARRY_ADDR)) \ $(call optional,data,$(QUARRY_DATA)) \ $(call optional,oltp,$(QUARRY_OLTP)) \ $(call optional,repos-root,$(QUARRY_REPOS_ROOT)) \ $(call optional,tracker,$(QUARRY_TRACKER)) \ $(call optional,dagnats,$(QUARRY_DAGNATS)) \ $(call optional,notify,$(QUARRY_NOTIFY)) \ $(call optional,notify-key,$(QUARRY_NOTIFY_KEY)) \ $(call optional,errorlog,$(QUARRY_ERRORLOG)) \ $(corpus_repo_flags) \ $(extra_repo_flags) dev: wgo run ./cmd/quarry serve $(DEV_ARGS) # Print the composed flags without running anything — the fastest way to # see what .env.local actually amounts to. dev-args: @echo $(DEV_ARGS)