-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Rename Cargo.lock #8498
Comments
With the benefit of hindsight, perhaps we would have used another name for the lockfile. (And in particular, we ideally would have used a name that ended in Also, I don't think we should use a hidden file for something that appears in every crate, affects the build of the crate, and will often be checked into version control. I could imagine using Given the amount of churn this would entail, and the fact that for the foreseeable future we'd have two names rather than one, versus the amount of benefit this would provide, I don't think we should rename this file. |
In addition we would need a plan for the transition. One that does not have different versions of Cargo successfully building the same project but using different lockfiles. |
I think a hidden file is appropriate, since at least from the user's perspective Cargo.lock is merely an implementation detail of Cargo. Most users will never even touch it, so it makes sense to hide it. If someone tries manually editing their Cargo.lock, having it be a dotfile lets them know what they're getting in to - something that you don't have to think about in 99% of cases. I don't see what churn this would cause. Most external Cargo tools rely on the cargo crate and don't implement Cargo.lock finding themselves. No existing crates would have to change, and new crates wouldn't even notice the difference. |
Crates that commit their Cargo.lock would have to stick to the old system for a while to support old Cargo versions. Maybe cargo new --bin would use the old Cargo.lock for a while until everyone has updated their Cargo. |
See #5707 (comment) There is no plan to support different filename at this moment. |
Cargo.lock as a name has a few problems:
.toml
extension despite being TOML (although this doesn't matter too much).To solve this, I recommend adding support for another name as well as
Cargo.lock
that will solve the above three problems.Cargo.lock
will continue to be supported forever, but the new name will take precedence andcargo new
will use the new name.This new name should start with
.
, to emphasize that it is only used by programs and not people. Doing this will also reduce clutter in root directories as it will be hidden or tucked away at the top. It should also not drastically change the name (e.g. addingpackage
/Lockfile
etc), so that existing Rustaceans won't be confused. Something like.cargo.lock.toml
,.Cargo.lock.toml
or.cargo-lock.toml
would be ideal.The text was updated successfully, but these errors were encountered: