Gunnar

nordisk/gunnar

.cargo/config.toml

# ── NO SIBLING PATCHES AT THE ROOT (G-B7, owner order G-BOTH-1, 2026-10-26) ─────────
#
# The root workspace builds from crates.io in EVERY checkout, a lone clone and an estate
# checkout alike, and its committed lock is the crates.io lock: a plain `git clone`,
# `cargo build --locked` and `cargo install --locked --path crates/gunnar-cli --features
# client` work with nothing beside it (`cargo xtask lone-clone`, on every push).
#
# This file used to include `siblings.toml` (the estate's sibling table). A cargo config is
# found from the directory cargo runs in, so that include reached the root too, and the
# root lock was the estate's. It is gone. The estate workspaces (crates/gunnar-front, the
# guest, the benches, installtest) carry the sibling patches they take as
# `[patch.crates-io]` in their OWN manifests (`xtask::siblings::ESTATE_WORKSPACES`,
# `xtask/tests/lone_clone.rs`). A sibling change (edda, monetize, Skidbladnir ...) reaches
# the root after it is published; the estate workspaces see it at once. Lockbot must not
# follow the root lock with sibling patches.

# `cargo xtask <task>`, gunnar's repository tasks.
#
# Repository tooling is invoked as a tool, never as a dependency. The rule is
# the point of the xtask pattern. The alias is the whole mechanism; `xtask` is a
# workspace member that nothing depends on, so the default build never resolves,
# downloads or compiles it.
#
#
# ── `fmt` is aliased AWAY from `cargo fmt`, on purpose ──────────────────────
#
# DO NOT DELETE THE `fmt` LINE BELOW. `xtask/tests/fmt.rs` fails if it goes.
#
# `cargo fmt --all` follows LOCAL PATH DEPENDENCIES out of this repository —
# its own `--help` says so — and honours nothing that would stop it: not
# `optional`, not features, not the workspace `exclude` list. It escaped on the
# first hop, `gunnar-cli` → the old znippy engine crate (which was BOTH optional AND
# excluded) → `../../../znippy/*` → onward.
#
# That hop was removed on 2026-08-05: `gunnar-cli` names the old znippy engine crate
# nowhere now, and the znippy engine lives in the detached `crates/gunnar-znippy`.
# The alias STAYS, for the second reason below it — `--all` is also too narrow,
# and there are now four detached trees it cannot reach — and because a landmine
# that has been defused once is defused until the next optional path dependency
# is added, which is a one-line change nobody would think to check.
#
# MEASURED 2026-08-04, rustfmt 1.9.0-stable, `cargo fmt --all --check` from the
# repository root, with that edge still in place: 13139 diffs, of which 583 are
# ours and 12556 belong to five repositories gunnar does not own — facett 8459, znippy-zoomies 2614, znippy
# 1262, Skidbladnir 218, nornir 3. The WRITING form is not hypothetical: it
# rewrote 680 files in facett, 76 in znippy and 167 in znippy-zoomies, applying
# this repo's edition-2021 import sorting to edition-2024 repositories, and all
# of it had to be reverted from saved patches. `cargo metadata --no-deps` listed
# zero packages outside this tree and there is no parent workspace, so nothing
# about the workspace definition warned you first.
#
# So the command is taken away rather than documented-against. Inside this
# repository `cargo fmt` runs `cargo xtask fmt`, which formats every package
# manifest on disk — including the four trees `--all` never reaches (`bench/`,
# the old znippy engine bench, `installtest/`, `crates/gunnar-znippy`; 608
# more diffs when there were three) — and refuses `--all` by name with the
# measurement above.
#
# TWO THINGS TO KNOW ABOUT THIS MECHANISM:
#
#  1. cargo prints `warning: user-defined alias 'fmt' is shadowing an external
#     subcommand` and notes it "will become a hard error in the future"
#     (rust-lang/cargo#10049, open since 2021). That trade was taken with eyes
#     open: if cargo ever makes it an error, `cargo fmt` stops working in this
#     repository — which is REFUSAL, not damage. It is the correct direction to
#     fail in, and the failure names this file, which is where the reason is.
#     If you are here because of that hard error: MOVE the protection, do not
#     just delete the line. The landmine did not go away.
#  2. Nothing outside this directory tree is affected. Cargo discovers this file
#     by walking up from the current directory, so `cargo fmt` in any other repo
#     is untouched.
#
# `--manifest-path` and `-p` were both measured NOT to leak, so they remain the
# escape hatch for formatting one package: `cargo xtask fmt` is the whole tree.
[alias]
xtask = "run --quiet --package xtask --"
fmt = "run --quiet --package xtask -- fmt"
# The SITE TEST — a walk of a LIVE site with stock `git` as the client under
# test — is not in this repository: it is one deployment's addresses and
# accounts from end to end, so it lives in the private operations repository as
# `<ops>/sitetest/` (see `deploy/README.md`). It is a detached workspace like
# `installtest/`, and is run with `cargo run --manifest-path <ops>/sitetest/Cargo.toml --`.