Skip to content

Don't warn when both license and license-file are specified #9908

@brettcannon

Description

@brettcannon

Describe the problem you are trying to solve

Right now cargo warns if you define both license and license-file:

if project.license_file.is_some() && project.license.is_some() {
manifest.warnings_mut().add_warning(
"only one of `license` or \
`license-file` is necessary"
.to_string(),
);
}

This is a bit unfortunate as it means any tools that try to collect license files (e.g. for a 3rd-party notices file) have to write their own logic to try and figure out where the license is. But if projects could specify both the SPDX expression in license to know if a project meets any licensing requirements while also specifying license-file so it's easy to collect the license text as well would be helpful.

Describe the solution you'd like

  1. No longer warn when both license and license-file are specified.
  2. Update the docs to state that at least_ one of the two fields should be specified, but specifying both is encouraged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions