rust-lang / rust-lang/cargo

Cargo-installing a binary within a workspace shows warnings about profile overrides

Open
#8,328 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-workspaces C-bug Command-install S-triage
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Situation:

  • A workspace is composed of two packages: a and b.
  • b depends on the crate smallvec.
  • The workspace has a section mentioning [profile.dev.package] smallvec = { opt-level = 3 }.

When running cargo install --path ./a, I'm getting a warning:

warning: profile package spec `smallvec` in profile `dev` did not match any packages

This warning is printed as the package a doesn't depend on smallvec.
Running cargo install --path ./b works fine.

I believe that this is an issue with Cargo, as I don't think that there's a clean way to silence this warning.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the workspace with packages a and b, the smallvec dependency, and the [profile.dev.package] override, then compare cargo install --path ./a with ./b. Trace how profile package specs are matched during installation; done means the irrelevant smallvec override no longer emits a warning when installing a, while the relevant case remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.