Description
We ran into a situation in the Mozilla build system, when doing a Windows 32-bit build (using 32-bit MozillaBuild shell) on a 64-bit Windows machine. In this situation the MozillaBuild shell has invoked vcvars.bat to set up a 32-bit build environment, but cargo still tries to do a 64-bit build for build scripts. This results in failure.
More context in bug 1350001. I'm filing this bug as a result of comment 9 in that thread, by @alexcrichton. Specifically:
Cargo could support explicitly specifying a host target (or build target I guess is the autotools name) where it "cross compiles" build scripts.
Although we fixed bug 1350001 by running cargo build
in a "clean" environment (with env vars stripped out) that is not ideal and caused other breakages (such as bug 1355464). Fixing this in cargo would be a better solution.