rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.32k stars 2.33k forks source link

called `Option::unwrap()` ona a `None` value in `cargo update` #13568

Open orhid opened 4 months ago

orhid commented 4 months ago

Problem

while calling cargo update the main thread panics. the explanation is thread 'main' panicked at src/cargo/core/workspace.rs:1573:39: called `Option::unwrap()` on a `None` value though i suspect the issue lies much deeper, since calling with RUST_BACKTRACE=full results in this stack backtrace:

stack backtrace:
   0: 0x572b81b6 - <unknown>
   1: 0x572e9dad - <unknown>
   2: 0x572b2426 - <unknown>
   3: 0x572b7fe6 - <unknown>
   4: 0x572b9c4c - <unknown>
   5: 0x572b999d - <unknown>
   6: 0x572ba21d - <unknown>
   7: 0x572ba0cb - <unknown>
   8: 0x572b8646 - <unknown>
   9: 0x572b9e2e - <unknown>
  10: 0x565d0052 - <unknown>
  11: 0x565d0113 - <unknown>
  12: 0x56ba6ecc - <unknown>
  13: 0x5665f955 - <unknown>
  14: 0x5662ce46 - <unknown>
  15: 0x56627391 - <unknown>
  16: 0x56662d04 - <unknown>
  17: 0x565ea873 - <unknown>
  18: 0x565f91db - <unknown>
  19: 0x572a8228 - <unknown>
  20: 0x565d57da - <unknown>
  21: 0x566688a5 - <unknown>
  22: 0xf7f74fdf - <unknown>

Steps

call cargo update

Possible Solution(s)

No response

Notes

i suspect this is very specific to my environment. i am running alpine linux on an emulated x86 machine using the iSH app on an m1 iPad. i have installed both rust and cargo from the alpine repository, since rustup is not supported with this architecture.

Version

cargo 1.75.0
release: 1.75.0
host: i586-alpine-linux-musl
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.5.0 (sys:0.4.68+curl-8.4.0 system ssl:OpenSSL/3.1.4)
os: Alpine Linux 3.14.3 [32-bit]
weihanglo commented 4 months ago

Could you provide a minimal set of steps to reproduce this?

weihanglo commented 4 months ago

Also, could you help check if the panic remains in

orhid commented 4 months ago

Could you provide a minimal set of steps to reproduce this?

Own an iOS device, install the iSH app, run apk add cargo, run cargo update.

orhid commented 4 months ago

Also, could you help check if the panic remains in

  • 1.76

  • current beta

  • current nightly

unfortunately, i don't think so. those are not on the alpine repos, rustup is not available for the architecture and i am not nearly fluent enough to compile it from source.

weihanglo commented 4 months ago

That's unfortunate, and I don't have iOS device to test either. Worth noting that i586-alpine-linux-musl is in the list of "tier-2 without host tools", so no guarantee cargo works on that platform. Let alone it's on emulators. People may need to help themselves and submit a patch as we lack for the infra to test against those platforms. Besides, I would also suggest one of the user forums such as https://users.rust-lang.org/ to see if someone can help.