Familiarity with rustc code


#1

I have an issue on Win7 where I try to compile my project and I get an Internal Compiler Error.

I think most rustc developers are currently busy with the impl sprint, since there has not been any response yet on the linked issue. The problem is, I need my project compilable on windows as it’s a Company project, and since it compiles fine on OSX, and I get an ICE on Windows, I’m strongly inclined to believe it’s a bug in rustc.

Given the lack of response on the issue so far, I figured I might be able to fix it myself, but I’ll need a little information on rustc, especially surrounding rustc_metadata::creader::CrateLoader and syntax::ext::expand::MacroExpander.

Anyone here with that knowledge?


#2

After searching through similar issues it looks like the problem is somehow caused by the location (F:\quip) in which the build is done (is it a network drive by chance?).

See https://github.com/rust-lang/cargo/issues/2990 https://github.com/rust-lang-nursery/rustup.rs/issues/682 https://github.com/rust-lang-nursery/rustup.rs/issues/999 https://github.com/rust-lang/rust/issues/40282 https://github.com/rust-lang/rust/issues/43801 and https://github.com/rust-lang/rust/issues/40282#issuecomment-330097638 in particular.

So the immediate workaround could be to move the project somewhere else.


#3

Thank you for this!

In fact it is a network drive of sorts: My win7 is a VM image that accesses the project directory on the host machine, and in the Win7 VM that shows up as a mounted network device.

I did see the warning: could not canonicalize path: 'F:\quip' notifications, but never thought anything of it as the abstraction of a file system should not break on a detail like “network vs local drive”. I’ll go try your solution right now.


#4

Your workaround works marvelously, the project compiles as it should now.


#5

The canonicalize implementation on Windows strikes me as odd, plus it uses an API introduced in Vista even though I’ve seen comments around here about supporting XP. I’m looking through MSDN a bit to see what’s wrong with mapped drives.

Is someone familiar with that code and can explain why that implementation was chosen? I’m curious why GetFullPathName won’t work.


#6

Ok, I might have this one figured out - the code is really similar to libuv but a couple of flags are different. I’ll see if I can get a network share set up to test this.