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

MGS1046: a MAGUS_* environment variable that is provably wrong

The environment carries a MAGUS_* variable that magus retired, or that misspells one it reads. Every command, magus version included, stops before doing any work:

magus: [MGS1046] MAGUS_CACHE_DIRR is set, but magus does not read it; did you mean MAGUS_CACHE_DIR?
MAGUS_NO_WAIT was removed in v0.5.0; delete it; magus never waits on another invocation, a held lock or budget refuses at once with exit 75
  see: https://eli.gladman.cc/magus/reference/codes/magusfile/MGS1046/

Each variable gets its own line. A variable set to the empty string counts as unset.

magus shell, the command an agent host runs as its guard hook, answers with a deny carrying the same text instead of exiting, because a hook that exits without a verdict is read as allow. magus buzz carries on, so the hook glue it runs reaches that deny.

Why

A variable exported for magus and then not read looks exactly like one that applied. When MAGUS_NO_WAIT was removed, scripts and agents kept setting it: 462 commands in one day exported a value no magus honored, and nothing said so.

Only the two cases magus can prove are refused. A MAGUS_* name that is neither retired nor close to one magus reads may belong to a newer magus or to a repository's own tooling, so it runs; magus doctor lists it under environment-variables as advice.

What to do

The tail of each line says which case it is:

  • was renamed to ... Rename the variable; the value means the same thing.
  • was removed in ... Delete it. The line says what replaced the behavior, if anything did.
  • did you mean ...? Fix the spelling.

docs/reference/config lists every variable that has a magus.yaml key, and man magus lists all of them under ENVIRONMENT.

See also

  • MGS1040: the same stop for a magus.yaml key this magus does not know.
MGS1046environmentenv varconfigretiredtypoguard
Last updated (a9ff8609)
Glossary

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.

Cache

The content-addressed store magus consults before running a target, so unchanged work is skipped. See cache.

Invocation

One magus process's recorded facts - the targets it finished, their outcomes, the lease it acted as, and the session it ran in when a host delivered one - kept in a repo-scoped store every worktree shares. magus session lists them; the store prunes itself by last-fact age.

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

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