Skip to content

Need a reliable way to get the target dir from the build script #9661

Open
@kennykerr

Description

The problem: I need to locate the target dir from the build script.

The solution: I'd love a CARGO_TARGET_DIR environment variable. There's clearly precedent for this as cargo doc depends on such a thing today.

@jyn514 suggested I reach out to the Cargo team for advice.

Currently the Windows crate has been using various hacky solutions that are problematic.

rust-lang/docs.rs#1444 (comment)

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsA-layoutArea: target output directory layout, naming, and organizationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-propose-closeStatus: A team member has nominated this for closing, pending further input from the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions