fix(build): keep the index tools free of the Wails application

The v3 migration put application.Get() in backend/events and a
ServiceStartup hook in backend/explore, both of which cmd/indexbuild
reaches. v3's application package is GTK/WebKit bindings on Linux, so
the index-artifact job — a plain golang container with CGO_ENABLED=0,
on the stated grounds that neither command imports the app — stopped
compiling with "undefined: pointer". That job owns the ~205 GB dump
checkpoint, so it is the worst place to learn this.

Both are behind the indexbuild tag now: the one app.Event.Emit lives in
runtime_wails.go, runtime_indexbuild.go answers ErrNoRuntime (what the
app itself returns before Run, so Deliver's callers need no second
path), and explore's ServiceStartup moves to its own tagged file.

TestIndexToolsDoNotImportWails walks `go list -deps -tags indexbuild`
so the claim the workflow makes is checked rather than assumed.
This commit is contained in:
2026-08-16 14:51:01 -04:00
parent dd17a4d8eb
commit b98840ee37
9 changed files with 173 additions and 31 deletions
+5 -2
View File
@@ -8,9 +8,12 @@ import (
)
// allowedEmitters are the only files permitted to call the Wails
// runtime's event emitter directly.
// runtime's event emitter directly. There is one call and it lives in
// runtime_wails.go rather than emit.go because naming the application
// package is what forces cgo, and cmd/indexbuild builds this package
// without it.
var allowedEmitters = map[string]bool{
filepath.Join("backend", "events", "emit.go"): true,
filepath.Join("backend", "events", "runtime_wails.go"): true,
}
// TestNoDirectRuntimeEmits fails if anything outside backend/events