tools/cl: every command resolves features through feature-root, one framework build per target dir

cargo unifies features only over the packages a command selects, so a framework
crate's tests, a domain crate's tests, the gallery and the story renderer each
built their own copy of the framework and of wgpu. feature-root carries the
gallery's dependencies with every domain crate; cl selects it beside every
command's package and names the crate's own targets, so nothing of it builds.
The per-crate feature anchors go; cl check also checks a crate's bins.
This commit is contained in:
aiongg
2026-11-12 14:32:39 +00:00
parent 72a8204117
commit 7410239246
7 changed files with 202 additions and 71 deletions
Generated
+63
View File
@@ -1140,6 +1140,10 @@ dependencies = [
"tempfile",
]
[[package]]
name = "craft-cfb"
version = "0.1.0"
[[package]]
name = "craft-cms"
version = "0.1.0"
@@ -1476,6 +1480,31 @@ dependencies = [
"serde_json",
]
[[package]]
name = "craft-mesh"
version = "0.1.0"
dependencies = [
"serde_json",
]
[[package]]
name = "craft-metafile"
version = "0.1.0"
dependencies = [
"image",
"kurbo 0.13.1",
"thiserror 2.0.21",
]
[[package]]
name = "craft-mime"
version = "0.1.0"
dependencies = [
"chrono",
"encoding_rs",
"proptest",
]
[[package]]
name = "craft-pages"
version = "0.1.0"
@@ -2068,6 +2097,14 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
dependencies = [
"quick-xml 0.41.0",
"thiserror 2.0.21",
]
[[package]]
name = "crc32fast"
version = "1.5.2"
@@ -2652,6 +2689,30 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693"
[[package]]
name = "feature-root"
version = "0.1.0"
dependencies = [
"craft-automation",
"craft-browse",
"craft-color",
"craft-dialogs",
"craft-draw",
"craft-font-manager",
"craft-imaging",
"craft-layers",
"craft-menu",
"craft-pages",
"craft-print",
"craft-review",
"craft-table",
"craft-text",
"craft-theme-store",
"craft-timeline",
"craft-ui-gallery",
"craft-update",
]
[[package]]
name = "filetime"
version = "0.2.29"
@@ -3785,6 +3846,8 @@ checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
dependencies = [
"bytemuck",
"byteorder-lite",
"color_quant",
"gif",
"moxcms",
"num-traits",
"png 0.18.1",
+1 -1
View File
@@ -26,7 +26,7 @@ The `[features]` table in `Cargo.toml` is written by `tests/features.rs` from th
Reached through other crates, not named in the facade: the six library crates (`craft-ui-contract` to `craft-ui-shell`), `craft-ui-macros` and `craft-behavior` through `craft-ui`, and `craft-win32` through `craft-window`.
Not in the facade, because they are tools or test harnesses: `craft-ui-gallery`, `story-render`, `craft-ui-bench`, `craft-ui-test-kit`, `craft-fonts-build` (a build-script helper), `craft-design-lint`, `craft-plate-test`, `craft-media-testkit`.
Not in the facade, because they are tools or test harnesses: `craft-ui-gallery`, `story-render`, `feature-root` (the features local builds resolve with), `craft-ui-bench`, `craft-ui-test-kit`, `craft-fonts-build` (a build-script helper), `craft-design-lint`, `craft-plate-test`, `craft-media-testkit`.
## Family dependencies
+52
View File
@@ -0,0 +1,52 @@
[package]
name = "feature-root"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
publish = false
description = "Never built: the dependency set every local build resolves features with (tools/cl selects it beside each command's package)"
autobins = false
autotests = false
autoexamples = false
autobenches = false
# cargo unifies features over the packages a command selects. tools/cl selects this package in every command, so each
# local build resolves the features of every shared crate (the framework, egui, wgpu, ...) as the gallery with every
# domain crate does, and a target directory holds one build of the framework. No command selects this bin, so nothing
# here is compiled.
[[bin]]
name = "feature-root"
path = "src/main.rs"
test = false
doc = false
bench = false
[lints]
workspace = true
# The gallery's own dependencies, without its domain-crate features: the gallery lib's features stay each command's
# own (`apps` for the gallery, one crate for a render), so a render links one domain crate.
[dependencies]
craft-ui-gallery = { path = "../ui-gallery", default-features = false }
# The gallery's optional domain crates, with the gallery's features (`cl doctor` checks that the lists match).
craft-automation = { workspace = true, features = ["screen-testing"] }
craft-browse = { workspace = true, features = ["screen-testing"] }
craft-color = { workspace = true, features = ["screen-testing"] }
craft-draw = { workspace = true, features = ["screen-testing"] }
craft-imaging = { workspace = true, features = ["screen-testing"] }
craft-layers = { workspace = true, features = ["screen-testing"] }
craft-menu = { workspace = true, features = ["screen-testing"] }
craft-pages = { workspace = true, features = ["screen-testing"] }
craft-print = { workspace = true, features = ["screen-testing"] }
craft-review = { workspace = true, features = ["screen-testing"] }
craft-table = { workspace = true, features = ["screen-testing"] }
craft-text = { workspace = true, features = ["screen-testing"] }
craft-theme-store = { workspace = true, features = ["screen-testing"] }
craft-timeline = { workspace = true, features = ["screen-testing"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
craft-dialogs = { workspace = true, features = ["screen-testing"] }
craft-font-manager = { workspace = true, features = ["screen-testing"] }
craft-update = { workspace = true, features = ["screen-testing"] }
+3
View File
@@ -0,0 +1,3 @@
//! Never built: see the manifest. The package exists for its dependency list.
fn main() {}
+1 -1
View File
@@ -217,7 +217,7 @@ Native-only modules use `#[cfg(not(target_arch = "wasm32"))]`. A crate that cann
| Infrastructure services | Egui-free logic that families and apps share | `craft-theme`, `craft-theme-store`, `craft-host`, `craft-i18n`, `craft-settings`, `craft-keymap`, `craft-menu`, `craft-automation`, `craft-update`, `craft-cms`, `craft-ai-core`, `craft-atomic`, `craft-docpath`, `craft-font-catalog`, `craft-font-store`, `craft-pdf`, `craft-prepress`, `craft-proof` |
| Formats and codecs | Clean-room readers and writers | `craft-audio`, `craft-crw`, `craft-jpeg`, `craft-media`, `craft-doc`, `craft-ecproj-format`, `craft-pcraft-format`, `craft-vectorcraft-format` |
| Platform adapters | One operating-system, window-system or browser service each | `craft-platform`, `craft-dialogs`, `craft-window`, `craft-win32`, `craft-quit`, `craft-print`, `craft-web-api`, `craft-web-host`; next: `craft-gpu` |
| Tooling | Not shipped in apps | `craft-ui-gallery`, `story-render`, `craft-ui-bench`, `craft-ui-test-kit`, `craft-design-lint`, `craft-plate-test`, `craft-fonts-build`, `craft-media-testkit` |
| Tooling | Not shipped in apps | `craft-ui-gallery`, `story-render`, `feature-root`, `craft-ui-bench`, `craft-ui-test-kit`, `craft-design-lint`, `craft-plate-test`, `craft-fonts-build`, `craft-media-testkit` |
`craft-win32` is the one crate that allows `unsafe` code: it wraps the Win32 window-procedure subclassing and window-handle calls behind a safe API, so no other crate needs `unsafe`. The workspace lint table sets `unsafe_code = "forbid"`; craft-win32 sets it to `deny` and allows it in `lib.rs`, and the design-lint rule `contract/unsafe-allow` names it. The benchmark's counting allocator (`craft-ui-bench`, `src/alloc.rs`) is the other allowed site.
+9 -7
View File
@@ -8,13 +8,13 @@ How to build, test and look at this workspace without waiting for it. The rules
| What | Command | Builds |
|---|---|---|
| check the crate you changed | `cl check <crate>` | `cargo check -p <crate> --tests` with the fixed feature set |
| build its tests | `cl test <crate> --no-run` | `cargo test -p <crate> --tests` with the fixed feature set |
| check the crate you changed | `cl check <crate>` | `cargo check` of the crate's lib, bins and tests |
| build its tests | `cl test <crate> --no-run` | `cargo test -p <crate> --tests` |
| run some trials | `cl test <crate> -- <filter> --test-threads 4` | nothing new when warm |
| the debug gallery | `cl build gallery` | the `craft-ui-gallery` binary only |
| one component's stories as PNGs | `cl render <crate\|ui> <Component> [--story <name>] [--out <dir>]` | the `story-render` binary with that crate's feature |
| anything else | `cl cargo <args>` | what you asked for, through the job pool |
| the fixed feature set of a crate | `cl features <crate>` | nothing |
| anything else | `cl cargo <args>` | what you asked for, through the job pool, nothing added |
| the features `cl` adds for a crate | `cl features <crate>` | nothing |
`<crate>` is the package name with or without `craft-` (`color`, `craft-ui-widgets`). `cl` uses `<worktree>-target` as the target directory when that directory exists beside the worktree, else `CARGO_TARGET_DIR`, else `target/`.
@@ -22,11 +22,13 @@ How to build, test and look at this workspace without waiting for it. The rules
A fix to one gallery component, from the edit to its old/new picture on a page: edit the component's crate, then `cl render <crate> <Component>` (about 10–25 s warm: the changed crate, the renderer's link, the render) and compare the PNGs with the previous ones; the box's comparison page does the compare step (`gal-sheet/pair.py`, box only). `story-render` links the framework and only the domain crates its features name, so a change in craft-color rebuilds craft-color and the renderer, not the gallery and its 17 crates. `cl render ui <Component>` renders the framework's own components.
## One fixed feature set
## One feature resolution
cargo compiles a crate once per distinct feature set it is asked for, and every crate above it once more. Before `cl`, local commands differed in craft-ui's `app` (the gallery), `snapshot` (the sheet), `testing` (the tests) and the domain crates' `screen-testing`, so a target directory held two to five copies of the framework and rebuilt it between one agent's test, gallery and sheet commands. `cl` adds the same features to every command: the crate's test feature (`screen-testing`, else `testing`) plus craft-ui's `app` and `testing` (for the facade and the shell: craft-ui-shell's `app`). The runtime's `testing` includes the snapshot renderer, because a feature can be named on the command line only for a direct dependency, and crates above widgets reach the runtime through other framework crates. The proc-macro crate pins syn's and proc-macro2's features to everything other derive crates may add, so the one syn every proc macro shares is the same in every build; craft-ui-contract depends on craft-window with `ui`, so the shell's `app` changes nothing below the shell; and dev-dependency lines ask for no egui features the test kit does not need.
cargo compiles a crate once per distinct feature set, and every crate above it once more, and it unifies features only over the packages a command selects. A framework crate's tests have no eframe in their graph; a domain crate's tests do; the gallery adds every domain crate, whose dependencies turn on more features of egui, wgpu, craft-window, image and others below the framework. Each kind of command would build its own copy of the framework, and wgpu with it.
What still differs, by design: a framework crate's own tests have no eframe in their graph, domain crates do; two domain crates can differ in a few of their own dependencies' features; the gallery with every app enables a few more features below the framework. Each of those is one extra framework build in a target directory, once; `cl` names the crate and the feature set whenever it happens.
`cl` selects the `feature-root` package beside the package of every command (`-p <crate> -p feature-root`). Its dependencies are the gallery's, with every domain crate's `screen-testing`, so every local build resolves features as the gallery does, and a target directory holds one build of each crate. Nothing of `feature-root` is compiled: its one target is a bin no `cl` command selects (`cl` names the crate's own targets), and only the targets a command names are built, so a render still links one domain crate and a framework crate's tests still link no app. On top, `cl` adds the crate's own test feature (`screen-testing`, else `testing`). The Mac's and CI's commands never select `feature-root` and are unaffected.
Three manifest facts keep this true, and `cl doctor` checks them: `feature-root` lists every optional domain crate of the gallery with the gallery's features, and depends on the gallery without its default features (so the gallery lib's own features stay each command's: `apps` for the gallery, one crate for a render); dev-dependency lines ask egui for no features (a feature there differs between a crate's tests and everything else); the proc-macro crate pins syn's and proc-macro2's features to everything other derive crates may add, so the one syn every proc macro shares is the same with or without design-lint in the graph. `cl` names any new build of a framework crate in the target directory after each command; after a manifest change one is expected, otherwise run `cl doctor`.
## What not to run locally
+73 -62
View File
@@ -1,30 +1,32 @@
#!/usr/bin/env -S python3 -I
"""The craft-libs build loop: cargo with one fixed feature set, so every local build shares one variant of each crate.
"""The craft-libs build loop: cargo with one resolution of features, so every local build shares one build of each crate.
cl check <crate> [cargo args] cargo check -p <crate> --tests, canonical features
cl test <crate> [cargo args] [-- test args] cargo test -p <crate> --tests, canonical features
cl check <crate> [cargo args] cargo check of the crate's lib, bins and tests
cl test <crate> [cargo args] [-- test args] cargo test -p <crate> --tests
cl build gallery [cargo args] the debug gallery binary (target/debug/craft-ui-gallery)
cl build <crate> [cargo args] cargo build -p <crate>, canonical features
cl build <crate> [cargo args] cargo build of the crate's lib and bins
cl render <crate|ui> <Component> [--card] [--story <name>] [--out <dir>] [--threads N]
the component's stories (--card: its Overview cards) as PNGs through the story-render bin
cl features <crate> print the canonical --features value for <crate>
cl doctor check the manifests for drift from the one feature set
cl cargo <args...> cargo through the job pool, no features added
cl features <crate> print the --features value cl adds for <crate>
cl doctor check the manifests for drift from the one feature resolution
cl cargo <args...> cargo through the job pool, nothing added
Every cargo command runs through the command in CL_LAUNCHER when it is set (for example a wrapper that gives several
builds on one machine a shared jobserver; docs/development.md "The job pool"), else plain cargo. CARGO_TARGET_DIR defaults to <worktree>-target when that directory exists beside the worktree.
builds on one machine a shared jobserver; docs/development.md "The job pool"), else plain cargo. CARGO_TARGET_DIR
defaults to <worktree>-target when that directory exists beside the worktree.
Why one feature set: cargo builds a crate once per distinct feature set, and everything above it again. The gallery
turns on craft-ui's `app`, the tests `testing` (which includes the snapshot renderer) and the domain crates'
`screen-testing`; a command that leaves one of them off builds a second variant of the framework (minutes) and the
dependants above it. The canonical set for a crate is its own test feature (`screen-testing`, else `testing`) plus,
for every crate that depends on the framework, craft-ui's `app` and `testing` (craft-ui-shell's `app` for the facade
and the shell). Builds that take other features (CI's `--all-features`, wasm checks) belong on GitHub.
docs/development.md has the whole picture.
Why one resolution: cargo builds a crate once per distinct feature set, and everything above it again, and it unifies
features only over the packages a command selects. A framework crate's tests, a domain crate's tests, the gallery and
the story renderer each pull in different crates, which turn on different features of egui, wgpu, craft-window and
others below the framework, so each would build its own copy of the framework (minutes, and wgpu again). cl selects
the `feature-root` package beside every command's package: its dependencies are the gallery's, with every domain
crate, so every command resolves features as the gallery does and builds only the targets it names. The crate's own
test feature (`screen-testing`, else `testing`) is added on top. Builds that take other features (CI's
`--all-features`, wasm checks) belong on GitHub. docs/development.md has the whole picture.
Guards: `--all-features`, `--bins` and workspace-wide builds are refused with the reason; after every command, a new
feature variant of a framework crate in the target directory is named, with its feature set; `cl doctor` (also run
before every command, it reads a few manifests) reports manifest lines that would bring the churn back.
build of a framework crate in the target directory is named, with its feature set; `cl doctor` (also run before every
command, it reads a few manifests) reports manifest lines that would bring a second build back.
"""
import json
@@ -35,16 +37,8 @@ import subprocess
import sys
FRAMEWORK = ["craft-ui-contract", "craft-ui-widgets", "craft-ui-panels", "craft-ui-canvas", "craft-ui-patterns", "craft-ui-shell", "craft-ui"]
ANCHORS = {
# package -> the features of its framework dependencies that every local build keeps on. A feature can only be
# named for a direct dependency (`craft-ui-shell/app` from the facade, not `craft-ui-contract/...` from panels), so
# the runtime's test kit is one feature, `testing`, that every crate's own `testing` reaches.
"craft-ui": ["craft-ui-shell/app"],
"craft-ui-shell": ["app"],
"craft-ui-gallery": ["apps"],
"story-render": [],
}
FACADE_ANCHORS = ["craft-ui/app", "craft-ui/testing"]
# Selected beside every command's package; its dependencies decide every shared crate's features (its manifest).
ROOT = "feature-root"
# Domain crates the story renderer can link, by the crate's short name.
RENDER_FEATURES = {
"automation", "browse", "color", "draw", "imaging", "layers", "menu", "pages", "print", "review", "table", "text",
@@ -100,18 +94,24 @@ def package(packages, name):
def canonical(packages, name):
"""The canonical feature list of a package."""
"""The package's name and the features cl adds for it, qualified: its own test feature."""
p = package(packages, name)
features = []
if "screen-testing" in p["features"]:
features.append("screen-testing")
elif "testing" in p["features"] and p["name"] != "craft-ui-test-kit":
features.append("testing")
if p["name"] in ANCHORS:
features += ANCHORS[p["name"]]
elif any(d["name"] == "craft-ui" for d in p["dependencies"]):
features += FACADE_ANCHORS
return p["name"], features
return p["name"], [p["name"] + "/screen-testing"]
if "testing" in p["features"] and p["name"] != "craft-ui-test-kit":
return p["name"], [p["name"] + "/testing"]
return p["name"], []
def own_targets(p):
"""Target-selection flags naming the package's lib and bins, so the root's bin is never selected."""
flags = []
for t in p["targets"]:
if "lib" in t["kind"] or "rlib" in t["kind"] or "proc-macro" in t["kind"]:
flags.append("--lib")
elif "bin" in t["kind"]:
flags += ["--bin", t["name"]]
return flags
def doctor(top, packages, quiet=False):
@@ -127,24 +127,26 @@ def doctor(top, packages, quiet=False):
if d["name"] == "egui" and d["kind"] == "dev" and d["features"]:
problems.append(f"{manifest}: the egui dev-dependency asks for {d['features']}; a feature on a dev-dependency "
"line changes egui under the framework between a crate's tests and its render")
# Every crate's canonical set must resolve: a plain feature of the crate, or `dep/feature` with `dep` a direct
# dependency (workspace members: a feature it defines), else cargo refuses the command.
for p in packages.values():
direct = {d["name"]: d for d in p["dependencies"]}
for feature in canonical(packages, p["name"])[1]:
if "/" in feature:
dep, feat = feature.split("/", 1)
if dep not in direct:
problems.append(f"{p['name']}: canonical feature {feature} names {dep}, which is not a direct dependency")
elif dep in packages and feat not in packages[dep]["features"] and not any(d["name"] == feat and d["optional"] for d in packages[dep]["dependencies"]):
problems.append(f"{p['name']}: canonical feature {feature}: {dep} has no feature {feat}")
elif feature not in p["features"]:
problems.append(f"{p['name']}: canonical feature {feature} is not a feature of the crate")
gallery = packages.get("craft-ui-gallery")
if gallery:
for d in gallery["dependencies"]:
if d["name"].startswith("craft-") and "screen-testing" in d["features"] and not d["optional"]:
problems.append(f"crates/ui-gallery/Cargo.toml: {d['name']} must be optional (one feature per domain crate), or the story renderer links every crate")
root = packages.get(ROOT)
if not root:
problems.append(f"crates/{ROOT}: missing; without it every kind of command builds its own copy of the framework")
elif gallery:
mine = {d["name"]: d for d in root["dependencies"] if d["kind"] is None}
g = mine.get("craft-ui-gallery")
if not g or g["uses_default_features"] or g["features"]:
problems.append(f"crates/{ROOT}/Cargo.toml: must depend on craft-ui-gallery with default-features = false and no "
"features, or every render links all domain crates")
for d in gallery["dependencies"]:
if d["kind"] is None and d["optional"] and d["name"].startswith("craft-"):
r = mine.get(d["name"])
if not r or not set(d["features"]) <= set(r["features"]):
problems.append(f"crates/{ROOT}/Cargo.toml: must depend on {d['name']} with {d['features']} as the gallery "
"does, or a domain crate's tests and the gallery build different copies of the framework")
for problem in problems:
print(f"cl doctor: {problem}", file=sys.stderr)
if not problems and not quiet:
@@ -192,14 +194,16 @@ def report_new_variants(before, after):
continue
feats = " | ".join(sorted(by_crate[crate]))
same = [f for f in by_crate[crate] if f in olds.get(crate, set())]
why = ("same features as a variant already here, so a crate below it changed its features (another crate's dependencies "
"or dev-dependencies, or the gallery's apps)" if same else "a feature set this target dir had not built")
print(f"cl: new variant of {crate} built, features {feats}: {why}; {len(olds.get(crate, []))} variant(s) were there before. "
"Expected once per crate family (docs/development.md); otherwise check the command against `cl features`.",
why = ("same features as a build already here, so a crate below it changed its features (a dev-dependency line, "
"a manifest change, or a command run outside cl)" if same else "a feature set this target dir had not built")
print(f"cl: new build of {crate}, features {feats}: {why}; {len(olds.get(crate, []))} build(s) were there before. "
"Expected once per target dir after a manifest change (docs/development.md); otherwise run `cl doctor`.",
file=sys.stderr)
def run(top, cargo_args):
def run(top, cargo_args, then=None):
"""Runs cargo through the launcher and reports new framework builds; `then` (a command) runs after a successful
cargo, through the launcher too. Exits with the last return code."""
# cargo fmt builds nothing, so its `--all` is the usual whole-workspace format.
for arg in ([] if cargo_args[:1] == ["fmt"] else cargo_args):
if arg in REFUSED:
@@ -213,6 +217,8 @@ def run(top, cargo_args):
before = variants(target)
rc = subprocess.run(cmd, cwd=top, env=env).returncode
report_new_variants(before, variants(target))
if rc == 0 and then:
rc = subprocess.run(launcher + [os.path.join(target, "debug", then[0])] + then[1:], cwd=top, env=env).returncode
sys.exit(rc)
@@ -220,6 +226,10 @@ def with_features(args, features):
return args + (["--features", ",".join(features)] if features else [])
def selected(pkg):
return ["-p", pkg, "-p", ROOT]
def main():
if len(sys.argv) < 2 or sys.argv[1] in ("-h", "--help"):
print(__doc__.strip())
@@ -242,14 +252,13 @@ def main():
fail(f"cl {command} <crate> [args]")
name, args = rest[0], rest[1:]
if command == "build" and name == "gallery":
pkg, features = canonical(packages, "craft-ui-gallery")
run(top, with_features(["build", "-p", pkg, "--bin", "craft-ui-gallery"], features) + args)
run(top, ["build"] + selected("craft-ui-gallery") + ["--bin", "craft-ui-gallery"] + args)
pkg, features = canonical(packages, name)
if command == "check":
run(top, with_features(["check", "-p", pkg, "--tests"], features) + args)
run(top, with_features(["check"] + selected(pkg) + ["--tests"] + own_targets(packages[pkg]), features) + args)
if command == "test":
run(top, with_features(["test", "-p", pkg, "--tests"], features) + args)
run(top, with_features(["build", "-p", pkg], features) + args)
run(top, with_features(["test"] + selected(pkg) + ["--tests"], features) + args)
run(top, with_features(["build"] + selected(pkg) + own_targets(packages[pkg]), features) + args)
if command == "render":
if len(rest) < 2:
fail("cl render <crate|ui> <Component> [--card] [--story <name>] [--out <dir>] [--threads N]")
@@ -259,10 +268,12 @@ def main():
if short != "ui":
if short not in RENDER_FEATURES:
fail(f"{crate} is not a crate the story renderer links; one of: ui, " + ", ".join(sorted(RENDER_FEATURES)))
features = [short]
features = ["story-render/" + short]
if "--out" not in options:
options += ["--out", os.path.join(os.environ.get("CL_RENDER_DIR", os.path.expanduser("~/.cache/story-render")), component)]
run(top, with_features(["run", "-q", "-p", "story-render", "--bin", "story-render"], features) + ["--", "--only", component] + options)
# `cargo run` takes one package, so the bin is built with the root selected and then run.
run(top, with_features(["build", "-q"] + selected("story-render") + ["--bin", "story-render"], features),
then=["story-render", "--only", component] + options)
fail(f"unknown command {command}; see cl --help")