Skip to content

ICE on unwrap on windows #38933

Closed
Closed
@GuillaumeGomez

Description

@GuillaumeGomez

Here is the full output:

D:\process-viewer> cargo build
   Compiling process_viewer v0.0.4 (file:///D:/process-viewer)
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-gnu-64\build\src\libcore\result.rs:845
stack backtrace:
   0:         0x6eab09f2 - <unknown>
   1:         0x6eab01d1 - <unknown>
   2:         0x6eab1bba - <unknown>
   3:         0x6eab1a56 - <unknown>
   4:         0x6eab1979 - <unknown>
   5:         0x6eab18fb - <unknown>
   6:         0x6eac1a55 - <unknown>
   7:         0x6cf0d86f - <unknown>
   8:         0x6cfc95e5 - <unknown>
   9:         0x6cfbfbd3 - <unknown>
  10:         0x6cfb7806 - <unknown>
  11:         0x6d006e56 - <unknown>
  12:         0x6cf0ae35 - <unknown>
  13:         0x6eab4fb8 - <unknown>
  14:         0x6cf29054 - <unknown>
  15:         0x6eaae482 - <unknown>
  16:     0x7ffa36618363 - <unknown>

error: Could not compile 'process_viewer'.

To learn more, run the command again with --verbose.

I'm running on windows with the following version:

D:\process-viewer>rustc --version
rustc 1.16.0-nightly (4ecc85beb 2016-12-28)

And here is the "problematic" code:

#[cfg(target_os = "windows")]
extern crate pkg_config;

#[cfg(target_os = "windows")]
fn main() {
    use std::env;
    let libs_to_find = ["glib-2.0", "gobject-2.0", "pango-1.0", "gio-2.0", "atk-1.0",
                        "gdk-pixbuf-2.0", "cairo", "gdk-3", "gtk-3"];
    if let Ok(lib_dir) = env::var("GTK_LIB_DIR") {
        for lib_ in libs_to_find.iter() {
            println!("cargo:rustc-link-lib=dylib={}", lib_);
        }
        println!("cargo:rustc-link-search=native={}", lib_dir);
    } else {
        for lib in libs_to_find.iter() {
            pkg_config::probe_library(lib).unwrap();
        }
    }
}

#[cfg(not(target_os = "windows"))]
fn main() {}

I have put the problematic branch/PR here.

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