Cargo: --out-dir Tracking Issue

Created on 28 Mar 2019  路  7Comments  路  Source: rust-lang/cargo

Original issue: #4875
Implementation PR: #5203
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#out-dir

Summary
Adds --out-dir=PATH flag to cargo build to specify a directory to place final artifacts.

Unresolved questions

  • [ ] #6100 鈥斅燾oncern about similarity with --target-dir, proliferation of flags
  • [ ] #6313 鈥斅燾oncern about name collisions in workspaces or with examples
C-tracking-issue Z-out-dir

Most helpful comment

When will this feature be available in the stable release? It would greatly simplify my build/CI pipeline.

All 7 comments

I find this feature very helpful, since I get output in a directory named like this ./target/debug/build/mylib-79d5eadf36eadf53 and with a build.rs file there are two similarly named directories.

However, it doesn't seem that OUT_DIR environment variable is set to the value of --out-dir when build.rs is executed. Is that intentional? is there some other way to discover the value of --out-dir?

+1 on this issue. I have a program that uses a template directory for rust compilation and would like to now have to recompile everything. Yes I could symlink all the folders within target, but it would be nicer to be able to specify the binary output path. I'm not sure why this is such an overlooked issue.

When will this feature be available in the stable release? It would greatly simplify my build/CI pipeline.

+1 on this. This greatly improves the workflow on our CI, and we'd like to avoid using a nightly compiler just for this.

What needs to happen for this to move forward?

This issue makes nmattia/naersk unusable on stable rust. (another build system issue)

This would streamline some of my Dockerfiles and build scripts quite nicely.

Is there a reason this doesn't work with cargo rustc?

Was this page helpful?
0 / 5 - 0 ratings