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 --git panics #104

Closed heidezomp closed 5 years ago

heidezomp commented 5 years ago

Probably related to #99.

As of today updating crates installed from a git repository started failing:

heidezomp@raggel ~> env RUST_BACKTRACE=1 cargo install-update --all --git
    Updating registry 'https://github.com/rust-lang/crates.io-index'

Package       Installed  Latest   Needs update
bindgen       v0.48.1    v0.48.1  No
cargo-asm     v0.1.16    v0.1.16  No
cargo-bloat   v0.6.2     v0.6.2   No
cargo-tree    v0.25.0    v0.25.0  No
cargo-update  v1.7.0     v1.7.0   No
cargo-watch   v7.2.0     v7.2.0   No

No packages need updating.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: -3, klass: 7, message: "remote \'origin\' does not exist" }', libcore/result.rs:1009:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::result::unwrap_failed
   9: cargo_update::ops::GitRepoPackage::pull_version
  10: cargo_install_update::actual_main
  11: cargo_install_update::main
  12: std::rt::lang_start::{{closure}}
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  16: main
  17: __libc_start_main
  18: _start

I run this command as part of my daily upgrade routine, and it has always worked fine before.

The failing repository is cargo-outdated, since that's the only git repository in my config:

heidezomp@raggel ~> cat .cargo/.crates.toml
[v1]
"bindgen 0.48.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["bindgen"]
"cargo-asm 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-asm", "cargo-llvm-ir"]
"cargo-bloat 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-bloat"]
"cargo-outdated 0.8.0 (git+https://github.com/kbknapp/cargo-outdated#899a3d4457d65ac93a8f557bb09f2475c7e4a942)" = ["cargo-outdated"]
"cargo-tree 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-tree"]
"cargo-update 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-install-update", "cargo-install-update-config"]
"cargo-watch 7.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-watch"]

I've never dug into the way cargo handles git repositories before, but as far as I can tell the repository on my disk is fine:

heidezomp@raggel ~> cd .cargo/git/checkouts/
heidezomp@raggel ~/.c/g/checkouts> ls
cargo-outdated-cb22c4b2a8aff03f/
heidezomp@raggel ~/.c/g/checkouts> cd cargo-outdated-cb22c4b2a8aff03f/
heidezomp@raggel ~/.c/g/c/cargo-outdated-cb22c4b2a8aff03f> ls
899a3d4/  8c3b1ce/  c9b710a/  e5af011/
heidezomp@raggel ~/.c/g/c/cargo-outdated-cb22c4b2a8aff03f> cd 899a3d4/
heidezomp@raggel ~/.c/g/c/c/899a3d4> ls
Cargo.lock  Cargo.toml  CHANGELOG.md  CONTRIBUTING.md  CONTRIBUTORS.md  justfile  LICENSE-MIT  README.md  rustfmt.toml  src/
heidezomp@raggel ~/.c/g/c/c/899a3d4> git remote -v
origin  file:///home/heidezomp/.cargo/git/db/cargo-outdated-cb22c4b2a8aff03f (fetch)
origin  file:///home/heidezomp/.cargo/git/db/cargo-outdated-cb22c4b2a8aff03f (push)
heidezomp@raggel ~/.c/g/c/c/899a3d4> cd ~/.cargo/git/db/cargo-outdated-cb22c4b2a8aff03f/
heidezomp@raggel ~/.c/g/d/cargo-outdated-cb22c4b2a8aff03f> ls
config  description  FETCH_HEAD  HEAD  hooks/  info/  objects/  refs/

This is using cargo-install-update 1.7.0 on Arch Linux.

heidezomp commented 5 years ago

Update: cargo-install-update started working correctly again today, even though the latest commit for the previously failing repository has remained the same:

heidezomp@raggel ~> cargo install-update --all --git
    Updating registry 'https://github.com/rust-lang/crates.io-index'

Package       Installed  Latest   Needs update
bindgen       v0.48.1    v0.48.1  No
cargo-asm     v0.1.16    v0.1.16  No
cargo-bloat   v0.6.2     v0.6.2   No
cargo-tree    v0.25.0    v0.25.0  No
cargo-update  v1.7.0     v1.7.0   No
cargo-watch   v7.2.0     v7.2.0   No

No packages need updating.
Package         Installed                                 Latest                                    Needs update
cargo-outdated  899a3d4457d65ac93a8f557bb09f2475c7e4a942  899a3d4457d65ac93a8f557bb09f2475c7e4a942  No

No git packages need updating.

I'll close this ticket and reopen it if it ever reoccurs.