mcgoo / cargo-vcpkg

Get external dependencies in one step by specifying vcpkg details in Cargo.toml
Apache License 2.0
39 stars 6 forks source link

`rev_tag_branch` Error handler #12

Closed oovm closed 2 years ago

oovm commented 2 years ago

This is an occasional error, I manually git pull vcpkg and the problem disappeared.

This is my configuration at the time:

[dependencies.tectonic]
version = "0.8.0"

[package.metadata.vcpkg]
git = "https://github.com/microsoft/vcpkg"
branch = "master"

I think unwrap here is untrusted and requires error handling:

https://github.com/mcgoo/cargo-vcpkg/blob/e63a81591d23714f48823d2966e9199c25e8f6b5/src/main.rs#L205

$ RUST_BACKTRACE=full cargo vcpkg build
    Fetching vcpkg
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', C:\Users\ausu\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-vcpkg-0.1.6\src\main.rs:205:41
stack backtrace:
   0:     0x7ff7fc6bf84f - <unknown>
   1:     0x7ff7fc6db51a - <unknown>
   2:     0x7ff7fc6ba568 - <unknown>
   3:     0x7ff7fc6c1e46 - <unknown>
   4:     0x7ff7fc6c192c - <unknown>
   5:     0x7ff7fc6c24a5 - <unknown>
   6:     0x7ff7fc6c205f - <unknown>
   7:     0x7ff7fc6c0177 - <unknown>
   8:     0x7ff7fc6c1fe9 - <unknown>
   9:     0x7ff7fc6e8430 - <unknown>
  10:     0x7ff7fc6e837c - <unknown>
  11:     0x7ff7fc60df05 - <unknown>
  12:     0x7ff7fc6099c5 - <unknown>
  13:     0x7ff7fc61bd86 - <unknown>
  14:     0x7ff7fc5fdaec - <unknown>
  15:     0x7ff7fc6bf197 - <unknown>
  16:     0x7ff7fc610fc7 - <unknown>
  17:     0x7ff7fc6e2620 - <unknown>
  18:     0x7ff94e197034 - BaseThreadInitThunk
  19:     0x7ff94f2e2651 - RtlUserThreadStart
kornelski commented 2 years ago

I've added a nicer error message for this in 00d4694bc733a1b14c00e85743b676e51b9bbcc4, but I'm not sure why it is failing.