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

[moved] Redefine CARGO_TARGET_DIR to be only an artifacts directory #3664

Closed
kornelski opened this issue Jun 21, 2024 · 3 comments
Closed

[moved] Redefine CARGO_TARGET_DIR to be only an artifacts directory #3664

kornelski opened this issue Jun 21, 2024 · 3 comments

Comments

@kornelski
Copy link
Contributor

kornelski commented Jun 21, 2024

Moved rust-lang/cargo#14125

@epage
Copy link
Contributor

epage commented Jun 21, 2024

Is an RFC Issue the best place to move this conversation forward? If it wasn't for the link here, I would never have seen this.

This has a lot of overlap with --artfact-dir, so I would lean towards that.

@kornelski
Copy link
Contributor Author

kornelski commented Jun 21, 2024

Oops, I forgot to check which repo is this, assumed it was Cargo's. Should that be a Cargo issue, or an RFC PR?

@poliorcetics
Copy link

poliorcetics commented Jun 21, 2024

Yes, the issue should be moved to cargo I think.

I'm not convinced at all this won't break backwards compatibility in some way.

It makes ./target contain only workspace-unique files, which makes it justified for every workspace to have one.

And I don't want one in any cargo project while still keeping isolation, which is entirely different from what you are proposing.

It enables moving registry deps to a shared build directory, without side effect of local projects overwriting each others' files. Sharing of dependencies matches users' expectation that the same dependencies shouldn't be redundantly rebuilt for each local project.

Once again, the RFC I wrote and original issue I inspired myself from do not ask for that, it asks for the opposite: myself and many others want separate targets dirs for every project.

There are probably as many reasons as there are users for it but common ones are different sets of features amongst projects, sharing of build caches for specific projects, CI builds wanting to separate projects for security, or one project pinning 1.2.3 in a dep B of a dep A and the other project pinning 1.2.4: A can have the same version for both but it's dependencies won't and cargo is not made to handle the case at the moment.

You are fundamentally solving a different issue, one that the RFC I posted is not trying to solve.

@kornelski kornelski changed the title Redefine CARGO_TARGET_DIR to be only an artifacts directory [moved] Redefine CARGO_TARGET_DIR to be only an artifacts directory Jun 21, 2024
@kornelski kornelski closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
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

No branches or pull requests

3 participants