Repository navigation
feat(config): Stabilize resolver.lockfile-path config - #16694
Conversation
|
r? @ehuss rustbot has assigned @ehuss. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@rfcbot fcp merge cargo |
|
Team member @epage has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
@rfcbot fcp concern install
Should we remove install support or have this inconsistent? |
In which cases would we need to specify the lockfile path and install binaries? This configuration is primarily for using read-only source directories. I couldn't wrap my head around coming up with a use case for it. |
This comment has been minimized.
This comment has been minimized.
Just remind that we also have an inconsistency of install not respecting |
|
Do we think the support of unsetting the lockfile path a blocker? Currently there is no way to do that. And without that, it is hard for people to unset if a global |
|
I'm not quite clear which inconsistency we're talking about.
Also, is there a more detailed description of this feature? Overall I'd like to see a more detailed stabilization report. For example, it seems to reserve |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Thanks! |
Update cargo submodule 26 commits in eb94155a9a60943bd7b1cb04abec42f5d0de6ddc..3bf1388b8823ec4eab622340036593381d8871aa 2026-04-09 13:10:20 +0000 to 2026-04-17 23:27:26 +0000 - Add global HTTP timeout tracking to http_async (rust-lang/cargo#16903) - feat(config): Stabilize `resolver.lockfile-path` config (rust-lang/cargo#16694) - chore(deps): update msrv (1 version) to v1.95 (rust-lang/cargo#16897) - fix: rebuild rustdoc json for different versions of a same crate (rust-lang/cargo#16773) - Add effective_url to http_async (rust-lang/cargo#16899) - Make crate downloads process as a queue rather than a stack (rust-lang/cargo#16898) - fix: sparse registry fetch progress reporting (rust-lang/cargo#16900) - chore: bump to 0.98.0; update changelog (rust-lang/cargo#16892) - docs(semver-check): update diagnostics to Rust 1.95 (rust-lang/cargo#16895) - docs(ref): Better highlight 'package --list' for include/exclude (
View all comments
What does this PR try to resolve?
Closes #14421
Overall, this seems like a low policy knob for users to tweak in config (ie out of the way) so this seems relatively safe to stabilize.
resolver.lockfile-pathis a mechanism to override the default location for lockfiles for local developmentCargo.lock{and}are reserved to keep this a two-way door--lockedworks'resolver.incompatible-rust-version,resolver.lockfile-pathdoes not apply tocargo install.cargos parent directory if.cargo/config.tomlis used and the current working directory for env variables and CLI.This started out as a principled workaround to no or outdated lockfiles on read-only filesystems. This could also help with users who juggle multiple lockfiles (e.g. "latest" vs "msrv") particularly when they can have dedicated config files for the different lockfiles and override other relevant resolver settings in the same config file.
Alternatives
--lockfile-path: which this feature started its life as, see RFE: add option to specify path to Cargo.lock #5707lockfile-pathvia an environment variable #15510 has a use case for this also to be done via an env variable (pain on user to always specify the flag)--out-dirjustified or can we find another way of accomplishing it? #6100)cargo install --lockfile-path fooimply--locked?"See also
lockfile-pathvia an environment variable #15510 (comment)Unresolved questions from the tracking issue:
cargo installno longer respectsresolver.lockfile-pathso we remain consistent on[resolver]never applying tocargo install.This was from when the we had
--lockfile-pathinstead which added its own set of policy questions.By having this be a config that just overrides the default, all other policies should remain the same.
How to test and review this PR?