diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-08-11 20:40:00 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-08-11 20:40:00 +0900 |
| commit | 2218efc0cf81aa64827a907de5ceb2e028f5d3f1 (patch) | |
| tree | 100003b558e824b90b1fa1ddfdae0dfaae8c9cef /internal/rosa | |
| parent | 30c5525d7bc61a3e0ee8e74f500d60b939fe69e0 (diff) | |
internal/rosa: improve nil-exec error reporting
This panics with a more descriptive error instead of relying on the SIGSEGV handler.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa')
| -rw-r--r-- | internal/rosa/state.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 73a40b6e..ab1868f4 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -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, |
