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

"the lock file needs to be updated but --locked was passed to prevent this" error message is unhelpful #4603

Closed
nnethercote opened this issue Oct 10, 2017 · 6 comments · Fixed by #6061
Assignees
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.

Comments

@nnethercote
Copy link
Contributor

While working on Stylo, several times I have hit this error message:

error: the lock file needs to be updated but --locked was passed to prevent this

This is an unhelpful error message. At the very least, it should print the path to the lock file, because when building Stylo there are multiple lock files and it's not obvious which one is the problem.

If it can print more than that -- e.g. identifying how the lock file needs changing -- that would be even better.

@alexcrichton alexcrichton added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Oct 10, 2017
@soig
Copy link

soig commented Nov 10, 2017

I have the same issue

@stale
Copy link

stale bot commented Sep 19, 2018

As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it.

I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect?

The team would be especially grateful if such a comment included details such as:

  • Is this still relevant?
  • If so, what is blocking it?
  • Is it known what could be done to help move this forward?

Thank you for contributing!

(The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.)

If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable!

@stale stale bot added the stale label Sep 19, 2018
@nnethercote
Copy link
Contributor Author

This is still relevant.

Also, I'm not a fan of closing bugs/PRs merely due to inactivity. It's too close to CADT for comfort: https://www.jwz.org/blog/2003/02/the-cadt-model/.

@stale stale bot removed the stale label Sep 19, 2018
@dwijnand
Copy link
Member

I think if someone shared a reproduction of this issue it would help it being resolved.

@ehuss
Copy link
Contributor

ehuss commented Sep 19, 2018

@dwijnand There are many ways to hit this. A very simple repro:

  1. Create a project.
  2. Build it to create a lock file.
  3. Edit Cargo.toml and change the version of your project (or any change that requires updating the lock file).
  4. cargo build --locked

Imagine step 3 happened due to pulling in new changes that you are unaware of the details.

@dwijnand
Copy link
Member

Lovely, thank you @ehuss!

Perhaps I'll be able to solve this (no promises).

@dwijnand dwijnand self-assigned this Sep 20, 2018
bors added a commit that referenced this issue Sep 20, 2018
…r, r=alexcrichton

Specify lockfile path in --locked error msg

Fixes #4603
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants