nix: name the crane derivations, instead of "cargo-package"

The root manifest is a pure [workspace], so crane finds no [package].name
to name its derivations after and falls back to a placeholder — every
build of crabidy logged two "crane will use a placeholder value" warnings
and produced cargo-package-0.1.0.drv, which says nothing about what was
built.

Name it in [workspace.metadata.crane], the spelling crane itself
suggests. Cargo ignores unknown workspace metadata, so this is a build
label and nothing more.

The cross build takes its name from the same root, which would leave the
native and aarch64 derivations both called crabidy-0.1.0; give it an
explicit pname so a build log can tell them apart.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Test User 2026-07-28 08:11:20 +02:00
parent a2e3da6aa5
commit 2bfdac25a7
2 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,12 @@ members = [
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
# This root manifest is a pure workspace, so crane finds no `[package].name` to
# name its derivations after and warns that it is using a placeholder
# ("cargo-package-0.1.0.drv" in the build log). Name it here instead.
[workspace.metadata.crane]
name = "crabidy"
[workspace.dependencies] [workspace.dependencies]
anyhow = "1" anyhow = "1"
argon2 = { version = "0.5", features = ["std"] } argon2 = { version = "0.5", features = ["std"] }

View File

@ -201,6 +201,10 @@
crossArgs = { crossArgs = {
inherit src; inherit src;
strictDeps = true; strictDeps = true;
# Both builds take their name from the workspace root, so name this
# one for its target — otherwise the native and cross derivations are
# both "crabidy-0.1.0" and a build log cannot tell them apart.
pname = "crabidy-server-aarch64";
# web-ui is a default feature; keep it on so the embedded UI ships. # web-ui is a default feature; keep it on so the embedded UI ships.
cargoExtraArgs = "--locked -p crabidy-server"; cargoExtraArgs = "--locked -p crabidy-server";
CARGO_BUILD_TARGET = muslTarget; CARGO_BUILD_TARGET = muslTarget;