-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Not planned
Not planned
Copy link
Labels
A-licenseArea: license handlingArea: license handlingC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-initCommand-newCommand-packageCommand-publishS-needs-team-inputStatus: Needs input from team on whether/how to proceed.Status: Needs input from team on whether/how to proceed.
Description
Problem
I just ran cargo new
in a workspace and I had to manually copy over the license files.
Proposed Solution
LICENSE
/ LICENSE-*
file names are a fairly strong convention that automatically linking them into a new package automatically seems to fit in along with our other workspace inheritance logic.
iirc we automatically move workspace.package.license-file
into the package on publish, so we could skip this if that is set.
Notes
No response
andrewbanchichandrewbanchich
Metadata
Metadata
Assignees
Labels
A-licenseArea: license handlingArea: license handlingC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-initCommand-newCommand-packageCommand-publishS-needs-team-inputStatus: Needs input from team on whether/how to proceed.Status: Needs input from team on whether/how to proceed.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
BatmanAoD commentedon Nov 8, 2024
weihanglo commentedon Nov 8, 2024
BatmanAoD commentedon Dec 8, 2024
weihanglo commentedon Dec 9, 2024
weihanglo commentedon Dec 9, 2024
epage commentedon Mar 11, 2025
We discussed this in today's meeting.
The underlying need is "include license files in
.crate
"license-file
is automatically copied over oncargo package
andcargo new
will inherit the field if in the workspace butlicense-file
is intended for custom licenses and is discouraged (via warning) to mix withlicense
That behavior around
license-file
is often confusing to users (e.g. #9908) and there are improvements we should probably make around it.For example, what if we had
(with us doing extra serde work to provide a good error message for
Apache-2.0
which would be["Apache-2", "0"]
)See also #8537 (comment) for ideas that get into changes to SPDX
So what does that mean in the short-term? Most things we do with
cargo new
are two-way doors so we could do this now and then pivot in the future.workspace.package.license
.We could create a generalized solution, like
package.extra-files
for publishing but then we need to map where files come from to where they goworkspace.new-files
for saying what files to copy but then we are getting even more into templating which we're hesitant on.For me, it seems like a short-term solution is not worth it. Hopefully someone (@joshtriplett ?) takes on a long-term solution.
8 remaining items