cargo-unlock

Crates.iocargo-unlock
lib.rscargo-unlock
version
sourcesrc
created_at2022-07-01 11:45:22.834247
updated_at2024-10-31 19:03:29.384771
descriptionRemove Cargo.lock lockfile
homepage
repositoryhttps://github.com/dtolnay/cargo-unlock
max_upload_size
id617096
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Lanthanum (github:zxtn:lanthanum)

documentation

https://github.com/dtolnay/cargo-unlock

README

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.
Commit count: 85

cargo fmt