You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RFE: add option to specify path to Cargo.lock #5707
In Fedora we package all crate sources (including tests) in /usr/share/cargo/registry which is not user-writable. However, we would like to run tests for them after installation. There is already option for target-dir and it would be very nice to get option to put Cargo.lock in some other directory so that we could run cargo test from there.
@epage sorry it took me some time, but the PR is ready for review.
I followed the guideline you posted in your comment (thank you very much!)
1 slight difference is I haven't added --lockfile-path on cargo install yet, as it's not one of the command that takes the --manifest-path.
I think the main usage of the lockfile-path is to enable folks to run commands on readonly folders (and adding it to almost all --manifest-path commands for consistency is a good idea). However, cargo install doesn't really fit into this category, so I doubt there's going to be any demand for that.
That being sad, adding it is very easy (and to be completely honest I just completely missed your suggestion up until I opened the PR), so if you think it'd be a nice addition it's not a problem to add it to the set of supported commands.
How this should work if the lockfile or a parent directory is not present
In #14326, missing parent directories will be created when Cargo is about to write the lockfile. This minimizes the chance of creating dangling directories.
Main question is how this should work if the lockfile or a parent directory is not present
Personally, I wouldn't make a checkbox for that. That is enough of an open question that it should be carried forward to stabilization with a call out of what was chosen for the implementation.
Thanks for your reviews! I will do the follow ups for cargo install (sorry actually just forgot about it 😅 ) and tests in separate PRs.
As for GSoC shell completion, from my understanding it's an ongoing effort, as of now. I don't see why would it be conflicting with the new flag, but if any help needed I would be happy to be involved!
As for GSoC shell completion, from my understanding it's an ongoing effort, as of now. I don't see why would it be conflicting with the new flag, but if any help needed I would be happy to be involved!
I believe the intent was to call out the potential for it being throwaway work which it would be if it was close to being merged and stabilized. However, we do not know how close we are to stabilization until we merge and do a couple rounds of call-for-testing, so any completion work that is pending should still be done.
Activity
igor-raits commentedon Jul 11, 2018
@alexcrichton any idea how the option could be named? I'm thinking about making a patch.
alexcrichton commentedon Jul 12, 2018
Perhaps
--lockfile-pathto mirror--manifest-path?epage commentedon Jul 16, 2024
We talked about this in the Cargo team meeting and are open to people experimenting with this
--lockfile-path <path>-Zunstable-optionsand docs--helpshould have(unstable)in them--manifest-pathexceptcargo locate-projectcargo installshould make--lockfile-pathimply--lockedfile_namebeCargo.lock(like we do for--manifest-path). We can always re-evaluate this in the futureifropc commentedon Jul 16, 2024
@rustbot claim
ifropc commentedon Jul 31, 2024
@epage sorry it took me some time, but the PR is ready for review.
I followed the guideline you posted in your comment (thank you very much!)
1 slight difference is I haven't added
--lockfile-pathoncargo installyet, as it's not one of the command that takes the--manifest-path.I think the main usage of the
lockfile-pathis to enable folks to run commands on readonly folders (and adding it to almost all --manifest-pathcommands for consistency is a good idea). However,cargo installdoesn't really fit into this category, so I doubt there's going to be any demand for that.That being sad, adding it is very easy (and to be completely honest I just completely missed your suggestion up until I opened the PR), so if you think it'd be a nice addition it's not a problem to add it to the set of supported commands.
weihanglo commentedon Jul 31, 2024
@ifropc No worry. As
--lockfile-pathis not going to be insta-stable, that seems fine to me. We can always discuss use cases later.Auto merge of #14326 - Ifropc:5707-lock-path, r=weihanglo
weihanglo commentedon Aug 16, 2024
Most major tasks in #5707 (comment) were addressed via #14326. Below are remaining tasks:
cargo installshould make--lockfile-pathimply--locked--lockfile-pathtocargo-install. This should be addressed before stabilization.Open questions before stabilization
epage commentedon Aug 16, 2024
Personally, I wouldn't make a checkbox for that. That is enough of an open question that it should be carried forward to stabilization with a call out of what was chosen for the implementation.
We should not be blocking completion work on that effort. We'll likely have that start as a nightly-only opt-in so we can do acceptance testing on it.
ifropc commentedon Aug 16, 2024
Thanks for your reviews! I will do the follow ups for
cargo install(sorry actually just forgot about it 😅 ) and tests in separate PRs.As for GSoC shell completion, from my understanding it's an ongoing effort, as of now. I don't see why would it be conflicting with the new flag, but if any help needed I would be happy to be involved!
epage commentedon Aug 16, 2024
I believe the intent was to call out the potential for it being throwaway work which it would be if it was close to being merged and stabilized. However, we do not know how close we are to stabilization until we merge and do a couple rounds of call-for-testing, so any completion work that is pending should still be done.
weihanglo commentedon Aug 18, 2024
Close in favor of the tracking issue #14421
feat(config): Stabilize `resolver.lockfile-path` config (#16694)