Skip to content

Workspace binary artifacts are added to target/debug/deps on Windows #7919

@lopopolo

Description

@lopopolo

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

  1. Build workspace.
  2. Touch build.rs of workspace crate that invokes $binary in its build script.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsA-environment-variablesArea: environment variablesC-bugCategory: bugO-windowsOS: WindowsS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions