Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fbeutel opened this issue Apr 7, 2020 · 2 comments · Fixed by #276
Closed

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

fbeutel opened this issue Apr 7, 2020 · 2 comments · Fixed by #276
Labels
cargo Issues affecting Cargo-based use of cxx

Comments

@fbeutel
Copy link

fbeutel commented Apr 7, 2020

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...

@dtolnay
Copy link
Owner

dtolnay commented Apr 8, 2020

I would appreciate a PR to improve this.

@dtolnay dtolnay added the cargo Issues affecting Cargo-based use of cxx label Aug 30, 2020
@dtolnay
Copy link
Owner

dtolnay commented Sep 2, 2020

Fixed in 0.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cargo Issues affecting Cargo-based use of cxx
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants