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

MGS1048: a layers entry magus cannot honor

layers on magus\project({...}) maps a workspace-relative directory, or a glob of directories, to a layer name. The knowledge graph stamps that name on each directory, magus query "layer=<name>" filters by it, and magus\layer(name) returns every directory in it.

This code fires when an entry cannot be honored:

  • the directory does not exist, or the glob matches no directory;
  • the path escapes the workspace;
  • the layer name is blank or not a lowercase slug (^[a-z][a-z0-9-]*$);
  • one directory is declared under two layer names.

Why

A layer that silently covers nothing reads as a boundary the tree keeps when nothing checks it. The load stops so the declaration and the tree agree.

Resolution

The message names the entry and the cause.

  • A moved or deleted directory. Point the entry at the directory's new path, or delete the entry.
  • A glob that matches nothing. Check the pattern against magus ls and the tree; a glob matches directories, not files.
  • A malformed name. Use a lowercase slug such as handler or transport.
  • Two names for one directory. Keep one; a directory sits in one layer.
MGS1048magusfilelayersknowledge graphfigures
Last updated (479ce5c7)
Glossary

Workspace

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

Project

A directory magus recognizes as a unit of work (it has a magusfile); the unit of caching, scheduling, and dependency tracking. 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.

Knowledge graph

The queryable graph of a workspace's spells, targets, docs, and code relationships; query it with magus query/explain/path. See knowledge.

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.