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

MGS1016: workspace-local Go replace directives drifted

A Go module requires a module declared by another project in this workspace, but its go.mod does not replace that dependency at the relative project path.

Magus derives only replacements whose left-hand module path belongs to this workspace. Replacements for upstream forks, vendored patches, and other external modules are left untouched.

Resolution

Run the owning project's generate target with the write charm:

magus run generate:rw <project>

The target runs go mod edit; magus never writes go.mod directly.

rw rather than relock, even though the file written is go.mod. The replacements are derived from the workspace layout on disk, and go mod edit "reads only go.mod; it does not look up information about the modules involved", so the same tree always yields the same bytes. relock is for writes whose result depends on what a registry serves, such as go mod tidy.

MGS1016magusfilegogo.modreplaceworkspace
Last updated (99421d40)
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.

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.

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.

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.

Module

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

Conventions

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