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

MGS1039: magus is called without being imported

A file calls magus\ and has no import "magus";:

[error] [MGS1039] [BZZ1001] buzz: line 1:1: undefined: magus: add `import "magus";`
to the file; magus is an imported module since v0.5.0

Why

Before v0.5.0 magus bound magus into every magusfile, spell and script whether or not the file imported it. It is now an ordinary host module, imported like fs or http, so a program's own declarations are not shadowed by a name it never asked for. A file that relied on the implicit binding fails to load, and the checker's own error (BZZ1001, an undefined name) reads like a typo rather than a migration.

What to do

Add the import at the top of the file, beside the others:

import "magus";

Nothing else changes: every magus\ call keeps its name and signature.

MGS1039magusfilespellsimportsupgradebuzz
Last updated (79e6c198)
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.

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. See the module reference.

Buzz

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

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.

Conventions

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