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

MGS6002: a charm is spelled by its retired name

A run asked for a built-in charm by a name magus no longer answers to:

[MGS6002] charm "relock" was renamed "update" in v0.5.0 and nothing answers to the old
name; spell it `:update`
  see: https://eli.gladman.cc/magus/reference/codes/charms/MGS6002/

The name can come from the target suffix (magus run generate:relock .), from default_charms in magus.yaml, or from any other source of active charms.

Why

v0.5.0 renamed the relock charm to update with no alias. A charm no selected target declares is normally only a warning, because a function target may still read it. The old name is different: nothing reads it any more, so the run would go ahead without the grant it asked for, and a lockfile you meant to re-resolve would stay pinned while the run reported success.

A target that declares a charm of its own named relock keeps it. The stop applies only when no selected target declares the name.

What to do

Rename the charm wherever it is spelled:

retired since use
relock v0.5.0 update
# before
magus run generate:relock .
# after
magus run generate:update .

In magus.yaml, change default_charms: [relock] to default_charms: [update]. A magusfile that reads the charm by name, has_charm("relock"), reads has_charm("update").

update behaves as relock did: ci strips it, and rw does not include it. See charms.

MGS6002charmsrelockupdateupgraderenamed
Last updated (32a02b72)
Glossary

Magusfile

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

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. Target in full.

Op

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

Spell

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

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. Charm in full.

CI

An ordinary target you compose yourself with ctx.needs; magus does not hardcode its stages. It is the anchor magus affected ci keys off, and ci strips the rw charm. CI in full.

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. Run in full.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.