internal/rosa: improve nil-exec error reporting
Test / Create distribution (push) Successful in 1m9s
Test / Sandbox (push) Successful in 3m28s
Test / Hakurei (push) Successful in 5m54s
Test / Sandbox (race detector) (push) Successful in 6m42s
Test / Hakurei (race detector) (push) Successful in 8m13s
Test / ShareFS (push) Successful in 8m39s
Test / Flake checks (push) Successful in 1m16s

This panics with a more descriptive error instead of relying on the SIGSEGV handler.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
cat
2026-08-11 20:40:00 +09:00
parent 30c5525d7b
commit 2218efc0cf
+11
View File
@@ -994,6 +994,13 @@ type evalContext struct {
t Toolchain
}
// HelperError describes a package with nil helper.
type HelperError string
func (e HelperError) Error() string {
return "package " + strconv.Quote(string(e)) + " has no exec helper"
}
// pf implements [azalea.PF].
func (ctx *evalContext) pf(
name azalea.Ident,
@@ -1172,6 +1179,10 @@ func (ctx *evalContext) pf(
}
}
if helper == nil {
panic(HelperError(name))
}
v = cachedArtifact{&meta, ctx.t.New(
meta.Name,
meta.Version,