-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cargo should support explicitly specifying a host target for build scripts #3915
Comments
Note that a key aspect here is that the host toolchain was 64-bit. Cargo didn't detect 64-bit or anything like that, it just didn't pass This would likely look like a |
Cargo should probably determine from the environment about what target should be used for build script, or probably just special case 32bit Windows: because you need linker anyway, and in a given PATH there is only one linker, so probably it is better building the build script in the same target in target platform rather than host platform if both are Windows. |
MSVC has a toolchain with 32bit host and 64bit target, and in that case the strategy may not work, because 32bit Windows cannot run 64bit executable. But I wonder whether anyone would actually do that in practice... |
Ran into a similar situation last week where specifying an explicit The current behavior is certainly convenient in some scenarios, but I think drawing a stronger line between host configuration and target configuration would be a good idea. |
@froydnj were you compiling for Can you also clarify what flags were causing problems? |
@alexcrichton I was compiling for |
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:
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.The text was updated successfully, but these errors were encountered: