Skip to content

Incorrect document regarding default value of --target-dir of cargo install #9137

@seamlik

Description

@seamlik

Problem

In the manual, it says the default value of --target-dir is target in the root of the workspace. However when I install a crate, the build cache is actually somewhere else. Only if I add --target-dir target to the command would Cargo put the build cache there.

Motivation

When running the verification on a CI, I expected that we can cache the build of a cargo install as well which saves a lot of time. However I was misguided by the document.

Steps

  1. cd into a workspace
  2. cargo clean
  3. cargo install cargo-audit
  4. Observe that no target directory is created

Possible Solution(s)

  • Let cargo install place the build cache at target
  • Document the actual default place of the build cache

Output of cargo version:

cargo 1.51.0-nightly (783bc43c6 2021-01-20)
Linux 5.8.0-41-generic #46-Ubuntu SMP Mon Jan 18 16:48:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions