nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

cargo install-update -a panics #222

Closed tommythorn closed 1 year ago

tommythorn commented 1 year ago

I think this is different from the other cargo install-update -a panic issue, if not feel free to close.

I've hit this a few times, currently:

$ RUST_BACKTRACE=1 cargo install-update -a
    Updating registry 'https://github.com/rust-lang/crates.io-index'

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "package rtx-cli not found"', /home/tommy/.cargo.x86_64-linux/registry/src/index.crates.io-6f17d22bba15001f/cargo-update-11.1.1/src/ops/mod.rs:216:149
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f77bfb7336f21bfe6a5fb5f7358d4406e2597289/library/std/src/panicking.rs:579:5
   1: core::panicking::panic_fmt
             at /rustc/f77bfb7336f21bfe6a5fb5f7358d4406e2597289/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/f77bfb7336f21bfe6a5fb5f7358d4406e2597289/library/core/src/result.rs:1750:5
   3: cargo_update::ops::RegistryPackage::pull_version
   4: cargo_install_update::actual_main
   5: cargo_install_update::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Is there something else I can provide that would help?

tommythorn commented 1 year ago

Manually updating rtx-cli worked fine:

$ cargo install rtx-cli          
    Updating crates.io index                                                   
  Downloaded rtx-cli v1.22.5                                                   
...
   Compiling rtx-cli v1.22.5
    Finished release [optimized] target(s) in 23.78s
   Replacing /home/tommy/.cargo.x86_64-linux/bin/rtx
    Replaced package `rtx-cli v1.21.5` with `rtx-cli v1.22.5` (executable `rtx`)

but it still panics:

$ cargo install-update -a
    Updating registry 'https://github.com/rust-lang/crates.io-index'

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "package rtx-cli not found"', /home/tommy/.cargo.x86_64-linux/registry/src/index.crates.io-6f17d22bba15001f/cargo-update-11.1.1/src/ops/mod.rs:216:149
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tommythorn commented 1 year ago
$ rustc -Vv
rustc 1.70.0-nightly (e3dfeeaa4 2023-03-07)
binary: rustc
commit-hash: e3dfeeaa45f117281b19773d67f3f253de65cee1
commit-date: 2023-03-07
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7
nabijaczleweli commented 1 year ago

Different outcome, same root cause probably. Seeing as rtx-cli is in the index per se, and cargo install-update -i rtx-cli works for me, this means that cargo updated the index in some freshly weird way. Would love a tarball of ~/.cargo/registry/index for diagnosis.

tommythorn commented 1 year ago

It's 2.3 GiB compressed so I'm uploading it to pCloud. Will share once it's available.

tommythorn commented 1 year ago

https://u.pcloud.link/publink/show?code=XZHYyCVZxFi2ze9o1TmgjC1CAl4F3ypeSudy

nabijaczleweli commented 1 year ago

hm. yeah:

nabijaczleweli@tarta:~/uwu/.cargo.x86_64-linux/registry/index/github.com-1ecc6299db9ec823$ git log -1 origin/HEAD
commit 0dba131014e0b4e7c6b35f0ffc9af288b663b9e7 (origin/HEAD)
Author: bors <bors@rust-lang.org>
Date:   Tue Dec 27 23:47:14 2022 +0000

    Yanking crate `pyo3-pylogger#0.1.1`
nabijaczleweli@tarta:~/uwu/.cargo.x86_64-linux/registry/index/github.com-1ecc6299db9ec823$ git log -1 FETCH_HEAD
commit 75125a6e5cfbf6013f0b0cf0ce3c8ccb645bedc5
Author: bors <bors@rust-lang.org>
Date:   Wed Mar 8 02:13:45 2023 +0000

    Updating crate `horner-eval#0.1.0`

nabijaczleweli@tarta:~/uwu/.cargo.x86_64-linux/registry/index/github.com-1ecc6299db9ec823$ git ls-tree FETCH_HEAD rt/x-/rtx-cli
100644 blob e28ff2fb661a8939fa8720f9ae505db78f2f36fe    rt/x-/rtx-cli
nabijaczleweli@tarta:~/uwu/.cargo.x86_64-linux/registry/index/github.com-1ecc6299db9ec823$ git ls-tree origin/HEAD rt/x-/rtx-cli
nabijaczleweli commented 1 year ago

Can you try the current master branch (at least 326a5b90a392198383a20f59d37e47a11202bae9)? That fixed it for me with your .cargo

tommythorn commented 1 year ago

Looks like my reply didn't stick? Your fix "Works For Me™"

Thanks!

nabijaczleweli commented 1 year ago

Great; released in v11.1.2