-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-environment-variablesArea: environment variablesArea: environment variablesC-bugCategory: bugCategory: bugO-windowsOS: WindowsOS: WindowsS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Description
Problem
Behavior differs on Windows compared to macOS and Linux when building a workspace where a crate produces binaries. Only on Windows, binaries are placed in target/debug AND target/debug/deps. macOS and Linux only place binaries in target/debug.
target/debug/deps is prepended to the PATH for build scripts. If a workspace produces a binary with the same name as one invoked by a subprocess in a build script, builds after the first will fail on Windows.
Steps
- Build workspace.
- Touch build.rs of workspace crate that invokes $binary in its build script.
- Build workspace.
Possible Solution(s)
Notes
Output of cargo version:
cargo 1.41.0 (626f0f40e 2019-12-03)
Windows, windows-msvc toolchain.
This issue moved here from rust-lang/rust#69318.
jokeyrhyme
Metadata
Metadata
Assignees
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-environment-variablesArea: environment variablesArea: environment variablesC-bugCategory: bugCategory: bugO-windowsOS: WindowsOS: WindowsS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.