crates/holger-ui-recipe/Cargo.toml
# holger-ui's **recipe** — the one Rust declaration of this repository's build space.
#
# ## Why a plain rlib beside `holger-ui-build-thing`
#
# dwarves' code road refuses a package named `<repo>-build-thing` whose `[lib]
# crate-type` does not contain `cdylib` (a wasm32 build of an rlib emits no
# `.wasm`). And a lib whose crate-type contains `cdylib` gets NO
# `--extra-filename` from cargo, so two units of it — the lib's own resolution
# and a consumer's, which differ as soon as any dev-dependency turns a feature
# on — write the same `deps/lib<name>.rlib` and one link picks the loser
# (cargo#6313; measured in gunnar 2026-09-03 and again in holger 2026-09-16 as
# `error[E0460]: found possibly newer version of crate …`).
#
# `xtask` depends on the declaration (see `xtask/Cargo.toml`), so the
# declaration must live in a crate that is safe to depend on. That is this one.
# NOTHING depends on `holger-ui-build-thing`.
#
# ## `nornir-build-thing` FROM THE REGISTRY, never a sibling path
#
# holger and gunnar spell this dependency `{ version = "0.1.18", path =
# "../../edda/crates/nornir-build-thing" }`. This repository may not, for the
# same reason `build.rs` no longer reads `../holger/proto/holger.proto`: a path
# dependency escaping the checkout is read at RESOLVE time, so it would make an
# edda checkout a hard requirement of `cargo metadata` on this whole workspace,
# and `git clone <holger-ui> && cargo build` is the only build a hosted CI can do.
[package]
name = "holger-ui-recipe"
description = "holger-ui's build recipe as code: every build point of the holger console declared in Rust through nornir-build-thing, and the emitter of .nornir/build-variants.toml (code -> toml, one-directional). holger-ui-build-thing is its wasm32 cdylib shim."
version.workspace = true
edition = "2021"
rust-version = "1.85"
license = "AGPL-3.0-only"
repository = "https://git.gunnar.rs/nordisk/holger-ui"
authors = ["Henrik Torp <henrik@vetra.se>"]
publish = false
[lib]
name = "holger_ui_recipe"
[dependencies]
# The declaration types (`BuildVariant`, `BuildVariantSet`), the
# `plugin::BuildThing` trait and the ONE emitter (`emit::emitted_toml`, which
# round-trips through the one loader). No features: the recipe declares and
# computes nothing, and must build for wasm32.
nornir-build-thing = { version = "0.2.0", default-features = false }
anyhow = "1"
[lints.rust]
unsafe_code = "forbid"
# **The EXECUTION leg, off by default.**
#
# `cargo_container::CargoToolchain` — the type `lib.rs`'s `toolchain()` returns —
# is always available; `DraupnirCargoRunner`, the thing that actually STARTS the
# pinned container, is behind `nornir-build-thing/cargo-container` (it pulls
# draupnir's OCI backend). It is optional HERE for one reason: this crate must
# build for `wasm32-unknown-unknown`, because `holger-ui-build-thing` is a wasm32
# cdylib over it and the dwarves forge loads that. draupnir does not build for
# wasm32 and never will.
#
# So the split is: the DECLARATION (wasm-safe, always on) and the RUNNER
# (native-only, opt-in). `xtask` turns it on — `holger-ui-recipe = { …, features
# = ["cargo-container"] }` — which is how the xtask keeps ONE dependency while
# reaching the runner. The forge's wasm32 build of the shim turns it off and
# still reads the same `[build.toolchain]`.
[features]
cargo-container = ["nornir-build-thing/cargo-container"]