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
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:
@@ -994,6 +994,13 @@ type evalContext struct {
|
|||||||
t Toolchain
|
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].
|
// pf implements [azalea.PF].
|
||||||
func (ctx *evalContext) pf(
|
func (ctx *evalContext) pf(
|
||||||
name azalea.Ident,
|
name azalea.Ident,
|
||||||
@@ -1172,6 +1179,10 @@ func (ctx *evalContext) pf(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if helper == nil {
|
||||||
|
panic(HelperError(name))
|
||||||
|
}
|
||||||
|
|
||||||
v = cachedArtifact{&meta, ctx.t.New(
|
v = cachedArtifact{&meta, ctx.t.New(
|
||||||
meta.Name,
|
meta.Name,
|
||||||
meta.Version,
|
meta.Version,
|
||||||
|
|||||||
Reference in New Issue
Block a user