Skip to content

ICE from attempting to build cargo hello world on wsl filesystem but from windows #77327

@lahwran

Description

@lahwran

Code

create a new cargo project in windows (I did this via jetbrains ui), then move it to //wsl$/... somewhere. try to run it with cargo run from windows. the windows rust compiler will likely crash with an internal error.

Meta

rustc --version --verbose:

C:\Windows>rustc --version --verbose
rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-pc-windows-msvc
release: 1.46.0
LLVM version: 10.0

Error output

I did this with jetbrains clion. its run output:

C:/Users/Lauren/.cargo/bin/cargo.exe run --color=always --package milkrs-server --bin milkrs-server
   Compiling milkrs-server v0.1.0 (\\wsl$\Ubuntu-20.04\home\lahwran\milkshell2\milkrs-server)
error: incremental compilation: could not create session directory lock file: Incorrect function. (os error 1)

thread 'rustc' panicked at 'trying to get session directory from `IncrCompSession`: NotInitialized', src\librustc_session\session.rs:838:48
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: <std::io::IoSliceMut as core::fmt::Debug>::fmt
   3: std::panicking::take_hook
   4: std::panicking::take_hook
   5: rustc_driver::report_ice
   6: std::panicking::rust_panic_with_hook
   7: rust_begin_unwind
   8: std::panicking::begin_panic_fmt
   9: rustc_session::session::Session::incr_comp_session_dir
  10: rustc_incremental::persist::fs::garbage_collect_session_directories
  11: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::compile
  12: rustc_interface::queries::Queries::register_plugins
  13: <rustc_lint::BuiltinCombinedLateLintPass as rustc_lint::passes::LateLintPass>::check_stmt
  14: <env_logger::filter::inner::Filter as core::fmt::Display>::fmt
  15: <rustc_driver::DEFAULT_HOOK as core::ops::deref::Deref>::deref
  16: <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_middle::ty::query::keys::Key>::default_span
  17: std::sys::windows::thread::Thread::new
  18: BaseThreadInitThunk
  19: RtlUserThreadStart
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: rustc 1.46.0 (04488afe3 2020-08-24) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: aborting due to previous error

error: could not compile `milkrs-server`.

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

Process finished with exit code 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions