rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.16k stars 12.69k forks source link

compiler panic 'called `Result::unwrap()` on an `Err` value: JoinPathsError { inner: JoinPathsError }' #32891

Closed gwselke closed 7 years ago

gwselke commented 8 years ago

I tried to compile libsqlite3-sys v0.4.0.

I expected to see this happen: compilation without compiler panic

Instead, this happened: above message (see title) from ../src/libcore/result.rs:688; then message "Could not compile libsqlite3-sys"

Meta

rustc --version --verbose: rustc 1.7.0 (a5d1e7a59 2016-02-29) binary: rustc commit-hash: a5d1e7a59a2a3413c377b003075349f854304b5e commit-date: 2016-02-29 host: x86_64-pc-windows-gnu release: 1.7.0

Backtrace: stack backtrace: 0: 0x622bbbba - strncmp 1: 0x622c4262 - strncmp 2: 0x62285398 - strncmp 3: 0x62285c6b - strncmp 4: 0x622b82b2 - strncmp 5: 0x622d7588 - strncmp 6: 0x6fb0bc4e - strncmp 7: 0x6fab4219 - strncmp 8: 0x6fa93004 - strncmp 9: 0x6fa864d4 - strncmp 10: 0x6fa8395e - strncmp 11: 0x622aebef - strncmp 12: 0x6fa83e3c - strncmp 13: 0x622c230d - strncmp

14: 0x770159ec - strncmp

This may or may not be related to issue #23667 (ICE wrapping a library search path in quotes); in that case, this issue answers Jlghtuse's request (in #23667), for a check on Windows

whostolemyhat commented 8 years ago

I got the same error with Rust 1.9:

rustc --version --verbose
rustc 1.9.0 (e4e8b6668 2016-05-18)
binary: rustc
commit-hash: e4e8b666850a763fdf1c3c2c142856ab51e32779
commit-date: 2016-05-18
host: x86_64-pc-windows-gnu
release: 1.9.0

I added rustqlite = "0.7.3" to Cargo.toml dependencies, and ran cargo run; I expected the project to compile.

Instead, I got this error:

 Compiling libsqlite3-sys v0.5.0
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: JoinPathsError { inner: JoinPathsError }', ../src/libcore\result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: Could not compile `libsqlite3-sys`.

Running with --verbose:

cargo run --verbose
       Fresh winapi v0.2.7
       Fresh libc v0.2.11
       Fresh rustc-serialize v0.3.19
       Fresh bitflags v0.7.0
       Fresh winapi-build v0.1.1
       Fresh pkg-config v0.3.8
       Fresh linked-hash-map v0.0.9
       Fresh lru-cache v0.0.7
       Fresh kernel32-sys v0.2.2
   Compiling libsqlite3-sys v0.5.0
     Running `rustc C:\Users\james.tease\.cargo\registry\src\github.com-88ac128001ac3a9a\libsqlite3-sys-0.5.0\src\lib.rs --crate-name libsqlite3_sys --crate-type lib -g -C metadata=b72bcb022ad64b13 -C extra-filename=-b72bcb022ad64b13 --out-dir C:\Users\james.tease\Documents\todo\target\debug\deps --emit=dep-info,link -L dependency=C:\Users\james.tease\Documents\todo\target\debug\deps -L dependency=C:\Users\james.tease\Documents\todo\target\debug\deps --extern libc=C:\Users\james.tease\Documents\todo\target\debug\deps\liblibc-38919d24e617a235.rlib --cap-lints allow -L "\"C:\Program Files\sqlite3\"" -l sqlite3`
       Fresh time v0.1.35
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: JoinPathsError { inner: JoinPathsError }', ../src/libcore\result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: Could not compile `libsqlite3-sys`.

Caused by:
  Process didn't exit successfully: `rustc C:\Users\james.tease\.cargo\registry\src\github.com-88ac128001ac3a9a\libsqlite3-sys-0.5.0\src\lib.rs --crate-name libsqlite3_sys --crate-type lib -g -C metadata=b72bcb022ad64b13 -C extra-filename=-b72bcb022ad64b13 --out-dir C:\Users\james.tease\Documents\todo\target\debug\deps --emit=dep-info,link -L dependency=C:\Users\james.tease\Documents\todo\target\debug\deps -L dependency=C:\Users\james.tease\Documents\todo\target\debug\deps --extern libc=C:\Users\james.tease\Documents\todo\target\debug\deps\liblibc-38919d24e617a235.rlib --cap-lints allow -L "C:\Program Files\sqlite3" -l sqlite3` (exit code: 101)

Sqlite3 was installed on my machine under C:\Program Files\sqlite3, which was also added to my Path env variable. I moved the Sqlite installation folder to C:\sqlite, updated the Path variable and ran cargo run again, but got the same error - the Path variable in my shell showed the new location (C:\sqlite), but cargo was still using the old location (C:\Program Files\sqlite3).

I deleted the 'target' folder in my project and ran cargo run again; this time the new path was picked up and the project compiled.

Mark-Simulacrum commented 7 years ago

Without a stack backtrace or location in the code, and with this being suspiciously only with sqlite3, I'd suspect that while we shouldn't ICE here it's not really actionable to keep this around. If anyone can reproduce with RUST_BACKTRACE=1 we'd gladly reopen.