diff --git a/.gitignore b/.gitignore index b6d1dc33..a16c4404 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ modules/mesh-build-image/cmd/mesh-build-image/mesh-build-image /checks/paths/paths /modules/mesh-build-go/mesh-build-go /modules/mesh-delivery-gate/mesh-delivery-gate +modules/mesh-config/cmd/mesh-config/mesh-config +checks/placement/placement diff --git a/checks/noscripts/noscripts_test.go b/checks/noscripts/noscripts_test.go index a96022c4..78c16391 100644 --- a/checks/noscripts/noscripts_test.go +++ b/checks/noscripts/noscripts_test.go @@ -1,12 +1,21 @@ package noscripts import ( + "bytes" "errors" "os" + "os/exec" "path/filepath" "testing" ) +// builtKnown are the compiled programs tracked on main the day the refusal below began (2026-10-26), each to be removed +// from the tree; the list only shrinks. +var builtKnown = map[string]bool{ + "modules/forticlient/cmd/forticlient-tools/forticlient-tools": true, + "modules/networkmanager/uplink-tools": true, +} + // The catalogue's checks are Go tests (novox/hq ADR 0529 clause 5, ADR 0445): the checker runs every nested Go module's tests by // the language's convention and no script at the root says what else to run. A script back at the root would be a check nobody // runs (ADR 0503 ยง3: since R4e the checker has not run them), so it is refused. @@ -16,4 +25,27 @@ func TestNoScriptOfTheOldCheckStandsAtTheRoot(t *testing.T) { t.Errorf("%s stands at the catalogue's root (%v): what it ran is a Go test in checks/ or a step of the build module", name, err) } } + + // Nor does a compiled program stand in the tree (issue 1126: a `go build` in place committed twice in one day, 5 and + // 6 MB each, which only a rewrite of the branch takes out of its history): the build module builds what runs. + out, err := exec.Command("git", "-C", filepath.Join("..", ".."), "ls-files", "-z").Output() + if err != nil { + t.Fatalf("the tracked files cannot be listed, so no compiled program can be refused: %v", err) + } + for _, name := range bytes.Split(bytes.TrimRight(out, "\x00"), []byte{0}) { + f, err := os.Open(filepath.Join("..", "..", string(name))) + if err != nil { + continue // a tracked file the checkout lacks (deleted, not yet committed) + } + magic := make([]byte, 4) + n, _ := f.Read(magic) + f.Close() + if n == 4 && string(magic) == "\x7fELF" && !builtKnown[string(name)] { + t.Errorf("%s is a compiled program: remove it with git rm --cached, and build with -o outside the tree", name) + } + delete(builtKnown, string(name)) + } + for name := range builtKnown { + t.Errorf("%s is no longer tracked: take it off builtKnown", name) + } } diff --git a/checks/placement/placement b/checks/placement/placement deleted file mode 100755 index f93f9a00..00000000 Binary files a/checks/placement/placement and /dev/null differ diff --git a/modules/mesh-config/cmd/mesh-config/mesh-config b/modules/mesh-config/cmd/mesh-config/mesh-config deleted file mode 100755 index 1c04a06a..00000000 Binary files a/modules/mesh-config/cmd/mesh-config/mesh-config and /dev/null differ