Skip to content

cargo vendor does not include license-file if not in package list #9575

Closed
@zbraniecki

Description

@zbraniecki

Describe the problem you are trying to solve

Mono-repos usually have a single LICENSE file in the top directory and they reference it from all crates via some license-file = "../../LICENSE".

At the moment, cargo will not package file from such path.

Since the license file needs to be packaged into the crate for it to be able to be vendored in into other projects.

We encountered that problem when trying to vendor in ICU4X (rust mono repo) into Firefox.

In order to comply with the vendor policy of Mozilla, we need to duplicate the LICENSE file to each component of the mono repo and introduce a maintenance script to ensure the licenses stay in sync.

See the issue, and the PR.

Describe the solution you'd like

It would help such projects if files referenced in Cargo.toml were packaged even if they live in the parent directory to the crate root.

The file could be copied to the root directory of the package.

Notes

If that's impossible, I'd at least suggest displaying a warning that cargo skips packaging of the file.

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`Command-vendorE-mediumExperience: MediumS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions