Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --ignore-rust-version for cargo install #11718

Closed
ensc opened this issue Feb 15, 2023 · 3 comments · Fixed by #11859
Closed

add --ignore-rust-version for cargo install #11718

ensc opened this issue Feb 15, 2023 · 3 comments · Fixed by #11859
Labels
A-rust-version Area: rust-version in Cargo.toml C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@ensc
Copy link

ensc commented Feb 15, 2023

Problem

Subcommands like build allow to ignore the minimum rust version of dependencies by the --ignore-rust-version flag.

Because build is a step of cargo install, this flag should be available there too.

Proposed Solution

Index: cargo/src/bin/cargo/commands/install.rs
===================================================================
--- cargo.orig/src/bin/cargo/commands/install.rs
+++ cargo/src/bin/cargo/commands/install.rs
@@ -78,6 +78,7 @@ pub fn cli() -> App {
                 .conflicts_with_all(&["git", "path", "index"]),
         )
         .arg_message_format()
+        .arg_ignore_rust_version()
         .arg_timings()
         .after_help("Run `cargo help install` for more detailed information.\n")

Notes

No response

@ensc ensc added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Feb 15, 2023
@weihanglo
Copy link
Member

This seems good to have to me.

BTW, Could you provide some crates that fail to compile due to their rust-version being set?

@weihanglo weihanglo added A-rust-version Area: rust-version in Cargo.toml I-nominated-to-discuss To be discussed during issue triage on the next Cargo team meeting labels Feb 27, 2023
@ensc
Copy link
Author

ensc commented Feb 27, 2023

BTW, Could you provide some crates that fail to compile due to their rust-version being set?

clap-4.0.x builds fine with RUSTC_BOOTSTRAP=1 and rust-1.59 (update to a newer version is not possible). But cargo install fails due to rust-version and binaries must be installed manually.

@weihanglo weihanglo added S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review and removed I-nominated-to-discuss To be discussed during issue triage on the next Cargo team meeting labels Mar 14, 2023
@weihanglo
Copy link
Member

The Cargo team talked about this in today's triage meeting. This is likely just an oversight and wasn't intended to not add it. That is to say, we are open to a pull request for adding this flag for cargo install.

Note that this flag is designed for low-level or exceptional circumstances. It is not something expected people use regularly.

@weihanglo weihanglo added the E-easy Experience: Easy label Mar 14, 2023
bors added a commit that referenced this issue Mar 16, 2023
Add --ignore-rust-version flag to cargo install

`@weihanglo` Added the flag to cargo install
fixes #11718
@bors bors closed this as completed in f2f4496 Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust-version Area: rust-version in Cargo.toml C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants