Documentation
¶
Overview ¶
Package hostcap reports what the host a build runs on can do beyond the language itself, so a capability that is not there is named rather than failing obscurely.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSpawnUnsupported = errors.New("a WebAssembly build cannot start external processes")
ErrSpawnUnsupported is the cause every external-process operation reports on a host that can start no process: every Go WebAssembly target (GOOS=js and GOOS=wasip1, both GOARCH=wasm). Callers reach it through errors.Is, wrapped into whichever typed error their layer answers with.
Functions ¶
func CheckSpawn ¶
CheckSpawn names subject as unable to run. No Go WebAssembly target starts a process: os/exec resolves the executable, then fails when it comes to starting one, reporting the platform's own "pipe: not implemented" with no word of the tool or the reason for it — so the reason is answered before that, and the lookup's own "not found" advice, which installing cannot satisfy, never appears.
Types ¶
type UnsupportedError ¶
type UnsupportedError struct {
// Subject is what was to run: a solver, an engine's executable, a compiler.
Subject string
}
UnsupportedError names what cannot run on this host.
func (*UnsupportedError) Error ¶
func (e *UnsupportedError) Error() string
Error names the subject and the cause it cannot run for.
func (*UnsupportedError) Unwrap ¶
func (e *UnsupportedError) Unwrap() error
Unwrap returns ErrSpawnUnsupported.