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

Make the rust-version error recommend cargo update --precise -p crate@ver #10891

Merged
merged 2 commits into from
Aug 9, 2022

Conversation

joshtriplett
Copy link
Member

People encountering a dependency with a newer rust-version requirement
may not know about cargo update --precise, or may consider alternate
approaches that may be harmful (such as pinning with a = dependency).

Provide specific guidance in the error message.

@rust-highfive
Copy link

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 23, 2022
@ehuss
Copy link
Contributor

ehuss commented Jul 23, 2022

Thanks! I'm concerned that this hint may be confusing for people using cargo install, where there is no project to run cargo update with. From what I've seen, a lot of users that run into stale Rust versions are using cargo install or are otherwise not proficient with Rust or Cargo.

I wondering if maybe this hint to run cargo update should not be mentioned in that situation? It's not particularly easy to detect, but maybe it could check if the workspace is_ephemeral?

It could also check ignore_lock, in which case running cargo update will have no effect.

@joshtriplett joshtriplett force-pushed the rust-version-recommend-precise branch from eb4bea0 to 931bb6c Compare July 23, 2022 19:53
@joshtriplett
Copy link
Member Author

@ehuss Good point; done.

src/cargo/ops/cargo_compile.rs Outdated Show resolved Hide resolved
tests/testsuite/rust_version.rs Outdated Show resolved Hide resolved
@joshtriplett joshtriplett force-pushed the rust-version-recommend-precise branch from b10e9ab to 0b002e4 Compare July 26, 2022 07:35
@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 1, 2022
@joshtriplett
Copy link
Member Author

Fixing...

@joshtriplett joshtriplett force-pushed the rust-version-recommend-precise branch from 2e44a65 to df6e2cc Compare August 3, 2022 21:46
…precise ...`

People encountering a dependency with a newer `rust-version` requirement
may not know about `cargo update --precise`, or may consider alternate
approaches that may be harmful (such as pinning with a `=` dependency).

Provide specific guidance in the error message.

If the user is using `cargo install`, suggest `cargo install --locked` instead.
Packages in the local workspace can't get updated this way; the user
just needs to point to a different source, or otherwise update the
package themselves.
@joshtriplett joshtriplett force-pushed the rust-version-recommend-precise branch from df6e2cc to 934e790 Compare August 8, 2022 18:55
@joshtriplett joshtriplett added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Aug 8, 2022
@ehuss
Copy link
Contributor

ehuss commented Aug 9, 2022

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 9, 2022

📌 Commit 934e790 has been approved by ehuss

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 9, 2022
@bors
Copy link
Contributor

bors commented Aug 9, 2022

⌛ Testing commit 934e790 with merge 104df2e...

bors added a commit that referenced this pull request Aug 9, 2022
…=ehuss

Make the `rust-version` error recommend `cargo update --precise -p crate@ver`

People encountering a dependency with a newer `rust-version` requirement
may not know about `cargo update --precise`, or may consider alternate
approaches that may be harmful (such as pinning with a `=` dependency).

Provide specific guidance in the error message.
@bors
Copy link
Contributor

bors commented Aug 9, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 9, 2022
@ehuss
Copy link
Contributor

ehuss commented Aug 9, 2022

@bors retry

apt network error

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 9, 2022
@bors
Copy link
Contributor

bors commented Aug 9, 2022

⌛ Testing commit 934e790 with merge ce40690...

@bors
Copy link
Contributor

bors commented Aug 9, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing ce40690 to master...

@bors bors merged commit ce40690 into rust-lang:master Aug 9, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 10, 2022
Update cargo

7 commits in 4fd148c47e733770c537efac5220744945d572ef..ce40690a5e4e315d3dab0aae1eae69d0252c52ac
2022-08-03 15:03:52 +0000 to 2022-08-09 22:32:17 +0000
- Make the `rust-version` error recommend `cargo update --precise -p crate@ver` (rust-lang/cargo#10891)
- resolver docs: link to version requirements syntax full explanation (rust-lang/cargo#10946)
- Bump os_info to 3.5.0 (rust-lang/cargo#10943)
- Mark --timings=html unstable in the document (rust-lang/cargo#10941)
- Mention that aliases are recursive (rust-lang/cargo#10935)
- Test if reserved filenames are allowed in Windows (rust-lang/cargo#10322)
- improve error message for `no such subcommand` (rust-lang/cargo#10924)
@joshtriplett joshtriplett deleted the rust-version-recommend-precise branch August 10, 2022 07:56
@ehuss ehuss added this to the 1.65.0 milestone Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants