Gunnar

nordisk/gunnar-ui

xtask/Cargo.toml

[package]
name = "xtask"
description = "gunnar-ui's repository tasks. Invoked as a tool, never as a dependency of anything."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish = false

[[bin]]
name = "xtask"
path = "src/main.rs"

[lib]
name = "xtask"
path = "src/lib.rs"

# ONE dependency: this repository's own build declaration.
#
# ## The rule this replaces, and what is left of it
#
# This list was EMPTY, with the reason written here: repository tooling is
# invoked as a tool, never as a dependency, and a workspace member takes part in
# resolver-2 feature unification for `cargo build --workspace`, so a dependency
# added here could turn a feature on in a crate the BFF links.
#
# The fear is real and it is narrower than the rule was. Feature unification is
# per INVOCATION: `cargo build --release -p gunnar-ui-server --target
# x86_64-unknown-linux-musl` — the one command that produces the shipped binary,
# in `deploy/deploy.sh` and in `cargo xtask build` alike — resolves that
# package's graph and nothing else, so nothing added here can reach it. What the
# rule really protects is `cargo build --workspace` and `cargo test
# --workspace`, which is CI.
#
# ## What made it worth paying
#
# The alternative was a second copy of the build knowledge. `xtask` cannot
# build, check or publish anything without knowing which package, which feature
# and which triple — and until 2026-09-17 it either hard-coded them
# (`cargo check -p gunnar-ui-server` in `publish.rs`) or left them to
# `deploy/deploy.sh` to spell in shell. `gunnar-ui-recipe` is the one place any
# of that is written down, so depending on it is what makes `xtask/src/build.rs`
# able to carry no package name, no feature string and no triple of its own.
#
# The same argument applies to `lib.rs`'s `workspace_root` — a function
# `nornir_xtask_support::workspace_root_of` already holds, re-implemented here
# because of the rule above. That twin is now removable; it is deliberately left
# alone in this change, which is about the build declaration and not about
# rewriting the publish verb's plumbing.
#
# ONE entry, not two: the recipe re-exports `nornir_build_thing`, which is the
# seam `build.rs` is written against, so the xtask and the declaration cannot
# resolve to different versions of the declaration types.
[dependencies]
gunnar-ui-recipe = { version = "1.5.0", path = "../crates/gunnar-ui-recipe" }
# `cargo xtask ci`: the shared plan runner, receipt and lock check (std only); the
# ci module is 0.1.3, patched in from ../edda beside nornir-git.
nornir-xtask-support = "0.1.2"

[lints.rust]
unsafe_code = "forbid"