Skip to content

Allow place holders in build.target-dir #6210

Closed as not planned
Closed as not planned
@ensc

Description

@ensc

I would like to configure CARGO_TARGET_DIR globally so that build happens on a faster/larger partition than ${HOME} (usually on NFS).

Setting

[build]
target-dir = "/home/ensc/.cache/cargo"

in global ~/.cargo/config causes bad effects because builds of different software packages are mixed in a single directory.

It would be nice when target-dir accepts some place holders like

[build]
target-dir = "/home/ensc/.cache/cargo/%X"

where %X can be

  • %C ... the hash of the directory with Cargo.toml
  • %P ... the full path of the directory with Cargo.toml
  • %N ... the package.name (seems to be difficult with recent code)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions