Skip to content

Don't rely on the target directory being named 'target' #88

Closed
@fbeutel

Description

@fbeutel

Currently, paths::target_dir() tries to find the target directory by looking at the name.
This has two problems:

  1. The user might have specified a different target directory by using the Cargo config option target-dir (https://doc.rust-lang.org/cargo/reference/config.html)
  2. The target directory might be called target, but actually be a symlink to something else that isn't called target - and canonicalize resolves symlinks.

In both cases, paths::target_dir() fails.

What is the rationale for not putting all the generated code etc. in the OUT_DIR or a subdirectory thereof directly? If the latter is acceptable, I'm happy to submit a pull request changing the behavior...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cargoIssues affecting Cargo-based use of cxx

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions