7 stable releases

1.0.10 Oct 31, 2024
1.0.9 Jan 2, 2024
1.0.8 Aug 5, 2023
1.0.7 Jul 4, 2023
1.0.4 Jul 1, 2022

#150 in Cargo plugins

Download history 13/week @ 2024-08-19 16/week @ 2024-08-26 22/week @ 2024-09-02 20/week @ 2024-09-09 18/week @ 2024-09-16 40/week @ 2024-09-23 23/week @ 2024-09-30 30/week @ 2024-10-07 33/week @ 2024-10-14 16/week @ 2024-10-21 131/week @ 2024-10-28 61/week @ 2024-11-04 27/week @ 2024-11-11 32/week @ 2024-11-18 31/week @ 2024-11-25 21/week @ 2024-12-02

121 downloads per month

MIT/Apache

11KB
77 lines

cargo unlock

github crates.io build status

New Cargo versions sometimes write out a lockfile that triggers parse failures in old Cargo versions.

$  cargo +1.41.0 check
...
    Finished dev [unoptimized + debuginfo] target(s) in 0.91s

$  cargo +1.37.0 check
error: failed to parse lock file at: /git/testing/Cargo.lock

Caused by:
  invalid serialized PackageId for key `package.dependencies`

The cargo unlock subcommand simply deletes the offending lockfile so that the old Cargo can proceed. Install by running cargo install cargo-unlock.


vs rm Cargo.lock

cargo unlock has three advantages:

  • It still works if run from a workspace member, where the lockfile would be located at the workspace root rather than the current directory.

  • It works if run from a subdirectory of a crate rather than the crate root.

  • If like me you use export FIGNORE=argo.lock in your shell so that all autocompletes prefer Cargo.toml over Cargo.lock, this is easier to type.


License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~3–12MB
~161K SLoC