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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user