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

MGS1041: a remote spell import is not declared

A magusfile imports a spell by registry path, and magus.yaml has no entry for it:

[error] [MGS1041] import "ghcr.io/team/spells/lint" names a remote spell magus.yaml does
not declare; add `spells: {ghcr.io/team/spells/lint: {tag: <tag>}}` to magus.yaml, then
run the target that writes magus.lock with the update charm (`magus run spell-lock:update`)

Why

A remote spell runs code magus did not ship, so the workspace has to say exactly which bytes. The import names only the repository; magus.yaml names the tag it tracks, and magus.lock pins the manifest digest that tag resolved to. An import with no declaration has no pin, and resolving the path at load would let the bytes change with no diff to review. The import is also never handed to the file search, where a directory in the workspace could answer for it.

What to do

Declare the spell in magus.yaml with the tag you want:

spells:
  ghcr.io/team/spells/lint:
    tag: "1.4"

Then pin it: run the target that declares magus.lock as its output with the update charm (magus run spell-lock:update in this repository), or magus spell lock --update when that target's own magusfile imports the spell. Commit magus.yaml and magus.lock together. To use a local copy instead, declare path: <dir> rather than a tag. See Remote spells.

MGS1041magusfilespellsimportsremoteocimagus.yamldeclaration
Last updated (139df068)
Earlier changes on this page (1)

Full history ↗ · Blame source ↗

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.

Target

A named operation (build, test, ...) you invoke with magus run <target>; it may compose a spell's tool-native operations and depend on other targets. 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.

Charm

An execution modifier attached with : (lint:rw) that changes how a target runs, not which one; the built-in rw flips a check-only target to mutate in place, and ci always strips it. See charms.

CI

An ordinary magusfile-defined target you compose yourself with magus\needs - magus does not hardcode its stages. Magus.RunCI treats it specially only in that it strips the rw charm, it is the anchor magus affected ci keys off, and a selected scope with no project declaring it is a load error rather than a silent no-op. See targets.

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.