Sunday, July 24, 2016

Another little MSVC Rust gotcha.

I've now set up VSCode with Rust on three machines -- the first two went without a hitch; the latest simply refused when running cargo install racer to compile kernel32-sys, with a x86/x64 mismatch.

And running dumpbin /headers on the system libraries mentioned in the dump of the failing link command, sure enough the x86 versions were being picked up by default. Now, going in and doing environment surgery started to unblock the system, but I wanted to figure out why this machine was giving problems.

Much scratching of head later, I realised that the first machine I'd run the command in a PowerShell window without running the Visual Studio VSVARS32.BAT, and that on the second, though I had run that environment set-up as part of my PowerShell profile, that one was running WinX/x86.

Moral of the story -- don't run cargo install from a Visual Studio prompt.

Post a Comment