Skip to content

Cargo should support explicitly specifying a host target for build scripts #3915

Open

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-configurationArea: cargo config files and env varsArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-buildS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions