Skip to content

ICE; wrapping a library search path in quotes causes Rust to panic. #23667

Closed
@dradtke

Description

@dradtke

If I set up a Cargo project with a simple build.rs file like this:

fn main() {
    println!("cargo:rustc-link-search=native=\".\"");
}

then I get this compiler error when trying to build:

   Compiling ice-test v0.0.1 (file:///C:/Users/dradtke/carhole/rust/ice-test)
     Running `rustc src\main.rs --crate-name ice-test --crate-type bin -g --out-dir C:\Users\dradtke\carhole\rust\ice-test\target\debug --emit=dep-info,link -L dependency=C:\Users\dradtke\carhole\rust\ice-test\target\debug -L dependency=C:\Users\dradtke\carhole\rust\ice-test\target\debug\deps -L native="."`
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
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: JoinPathsError { inner: JoinPathsError }', C:/bot/slave/nightly-dist-rustc-win-32/build/src/libcore\result.rs:751

stack backtrace:
   1: 0x6316dc46 - rt::unwind::register::h27ef7cd182e9296cKUI
   2: 0x630c37dc - rt::unwind::begin_unwind_inner::hefe36366e50f3af8URI
   3: 0x630c3b57 - rt::unwind::begin_unwind_fmt::h97d5284c0d9beb8cvQI
   4: 0x6316d920 - rust_begin_unwind
   5: 0x6318aaa8 - panicking::panic_fmt::h6bc794081905f967eXA
   6: 0x6cd602c6 - driver::collect_crate_metadata::h58b83019adfc1339R1a
   7: 0x6cd10f51 - driver::phase_2_configure_and_expand::hfb9ddf7f7541ae2dXsa
   8: 0x6cd01842 - driver::compile_input::hb1aac2c29f5a3486Rba
   9: 0x6cdc3c48 - run_compiler::he240a1462e2271ebv2b
  10: 0x6cdc1aad - run::h34c87f0e8759e7f3b2b
  11: 0x6cdc0e9b - run::h34c87f0e8759e7f3b2b
  12: 0x631623a4 - sys::tcp::TcpListener::bind::hc51fae06b1861148xkH
  13: 0x762e338a - BaseThreadInitThunk
  14: 0x770a9f72 - RtlInitializeExceptionChain

Could not compile `ice-test`.

Caused by:
  Process didn't exit successfully: `rustc src\main.rs --crate-name ice-test --crate-type bin -g --out-dir C:\Users\dradtke\carhole\rust\ice-test\target\debug --emit=dep-info,link -L dependency=C:\Users\dradtke\carhole\rust\ice-test\target\debug -L dependency=C:\Users\dradtke\carhole\rust\ice-test\target\debug\deps -L native="."` (exit code: 101)

Taking out the quotes around the search path fixes the issue and it compiles fine. The example above is contrived, but when I ran into this error, I added the quotes to avoid any possible issues with spaces in the file name, as I'm developing on Windows and that's a common problem.

Rust version:

rustc 1.0.0-nightly (809a554fc 2015-03-23) (built 2015-03-24)
binary: rustc
commit-hash: 809a554fca2d0ebc2ba50077016fe282a4064752
commit-date: 2015-03-23
build-date: 2015-03-24
host: i686-pc-windows-gnu
release: 1.0.0-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions