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

Support CARGO_TARGET_DIR environment variable #9

Closed
thomcc opened this issue Jul 10, 2019 · 0 comments · Fixed by #11
Closed

Support CARGO_TARGET_DIR environment variable #9

thomcc opened this issue Jul 10, 2019 · 0 comments · Fixed by #11

Comments

@thomcc
Copy link
Contributor

thomcc commented Jul 10, 2019

Cargo supports letting you specify a single directory for use for all projects via the CARGO_TARGET_DIR environment variable.

See this reddit post for a reason someone might want to do this (I had 170GB in various target files across my machine), although I've heard it can to speed up build times too, since it improves dep cache hits.

I think we would just want to change

val targetDirectory = targetDirectory ?: "${module!!}/target"
, but

  1. I haven't tested this, and maybe it's a little more complex.
  2. It's unclear to me what should happen if both targetDirectory and that variable is specified. I kind of think that the variable should take precedence, as it's what cargo will actually use. But, maybe there's a use case for targetDirectory that I'm missing.
@thomcc thomcc changed the title Support global cargo target directories Support CARGO_TARGET_DIR environment variable Jul 10, 2019
thomcc pushed a commit to thomcc/rust-android-gradle-1 that referenced this issue Aug 5, 2019
thomcc pushed a commit to thomcc/rust-android-gradle-1 that referenced this issue Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant