Skip to content

Conversation

@edwtjo
Copy link

@edwtjo edwtjo commented Oct 3, 2025

No description provided.

Comment on lines 78 to 81
name = cargoToml.package.name or cargoToml.workspace.package.name;
description =
cargoToml.package.description or cargoToml.workspace.package.description
or (builtins.throw "Missing description in ${name}'s Cargo.toml");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to an example project here? AFAIU, workspace.package.* are common attributes to use in all workspace packages:

Image

So, why would anyone want to use workspace.package.name when that means every workspace crate gets the same package name?

The same question kinda goes for description; since each package/crate normally has distinct description.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for some background; I used your template which doesn't work if you omit the root description and name. This is also related to the cargo-doc PR. If you want to use a virtual root crate then nix develop fails.

At any rate, the name and description are inherited by member crates which means that you can always override the virtual root one. For my cases, they are always set, as you say. I don't see name mentioned as a supported key.. Perhaps instead relying on workspace.metadata.package-name and workspace.metadata.description for virtual-root is a more suitable fix, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants