Never regenerate mf.pb.go during checks; fail when it is stale (closes #71)
check / check (push) Failing after 1s
check / check (push) Failing after 1s
The test and format scripts regenerated mfer/mf.pb.go whenever mfer/mf.proto looked newer by mtime, which a fresh checkout often causes, so make check could rewrite a committed file and needed protoc. Nothing regenerates it any more except make generate (script/generate), which refuses to run unless protoc 33.4 and protoc-gen-go v1.36.11, the versions that wrote the committed file, are on PATH, and records the hash of mf.proto in mfer/mf.proto.sha256. A Go test compares that hash with mf.proto and fails, naming make generate, when they differ. The mtime rule, the unused protoc-gen-go v1.28.1 install rule, make clean's deletion of mf.pb.go and the Dockerfile's touch workarounds are removed. Model: opus-5-5
This commit was merged in pull request #138.
This commit is contained in:
@@ -72,8 +72,19 @@ provide:
|
||||
`script/bootstrap`, then `script/install-precommit`
|
||||
- `script/projectname` — output the project name (`mfer`); used by other scripts
|
||||
such as `script/docker`
|
||||
- `script/test` — run the test suite (`go test`), regenerating the protobuf code
|
||||
first if it is stale
|
||||
- `script/test` — run the test suite (`go test`); one test fails when
|
||||
`mfer/mf.proto` no longer matches the hash `script/generate` recorded
|
||||
- `script/generate` (`make generate`) — regenerate `mfer/mf.pb.go` from
|
||||
`mfer/mf.proto` and record the hash of that `mfer/mf.proto` in
|
||||
`mfer/mf.proto.sha256`; the only thing that regenerates the committed
|
||||
`mfer/mf.pb.go`. It needs the exact versions that wrote the committed file,
|
||||
and refuses to run with any other: `protoc` 33.4 (unpack
|
||||
`protoc-33.4-<platform>.zip` from
|
||||
[its release](https://github.com/protocolbuffers/protobuf/releases/tag/v33.4)
|
||||
and put its `bin/protoc` on `PATH`) and `protoc-gen-go` v1.36.11
|
||||
(`go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.11`, which
|
||||
installs it in `$(go env GOPATH)/bin`; `make generate` adds that directory to
|
||||
`PATH`)
|
||||
- `script/fuzz` — fuzz the manifest parser for one minute; run by hand
|
||||
(`make fuzz`), never by CI, while `script/test` runs its committed seed corpus
|
||||
as ordinary tests
|
||||
|
||||
Reference in New Issue
Block a user