Skip to content

"cargo install" should be robust against deny(warnings) #17339

Description

@RalfJung

More than once have I encountered issues where I wanted to cargo install a crate that unfortunately had #![deny(warnings)] among its attributes. This is generally considered a bad thing for crates to do, but sadly that does not stop people from doing it. Now I have to wait until upstream fixes their code or fiddle with RUSTFLAGS=-Asomething which will also rebuild all dependencies, it's all not very nice.

As of right now, one example of a command that fails due to this issue is

cargo +stable install --git https://github.com/rust-lang/measureme --branch stable summarize

When building dependencies, cargo uses --cap-lints to make this a non-issue. However, when installing a crate from crates.io or from a git repo, then as far as I am concerned even the binary crate I am installing is a "dependency" -- it is not code I wrote or can do much about. It would be nice if cargo could treat it as such and apply --cap-lints. (I don't care whether it caps the lints to "allow" or "warn" as long as installation isn't blocked by a misplaced #![deny(warnings)].)

Related issues:

  • cargo install should use --cap-lints #3453 seems to be the exact same issue and was closed as having been implemented. But I do see cargo install failing due to #![deny(warnings)] today so either that did not work or it did get reverted.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gitArea: anything dealing with gitC-bugCategory: bugCommand-installS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions