magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
1 min read

MGS1044: a spell override replaces nothing usable

A path: entry in magus.yaml redirects a spell import to a workspace directory, and that directory cannot stand in for the spell:

[error] [MGS1044] magus.yaml spells.magus/spell/go: path spells/go holds no spell.buzz,
so there is no spell to replace it with

The same code covers an embedded spell's replacement that declares another name (holds the spell "mygo", not "go"), and an override of magus/spell/<name> for a name this magus does not ship.

Why

An override is declared, like Go's replace, so the import string never changes and the one line in magus.yaml is what a reviewer sees. That line has to point at a real replacement. A copy of an embedded spell takes over the embedded spell's registry entry, so every use of the name runs the copy; a copy under another name would leave the name bound to nothing it declares.

What to do

Point path at the directory holding the copy's spell.buzz, relative to magus.yaml. For an embedded spell, keep mgs_getName() returning the embedded spell's name, and check the name exists with magus describe spells. See Remote spells.

MGS1044magusfilespellsimportsoverridereplacemagus.yaml
Last updated (139df068)
Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. See workspace.

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. See targets.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). See operations.

Spell

A language/runtime adapter (e.g. go, md) that maps generic targets onto a toolchain's real commands. See spells.

Buzz

The language magusfiles are written in (the .buzz engine). See engines.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate.

Conventions

Placeholders

Angle brackets mark a value you replace with your own - never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.