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

Puro unexpectedly modifies PUB_CACHE env variable globally #90

Open
DanTup opened this issue Jul 3, 2024 · 4 comments
Open

Puro unexpectedly modifies PUB_CACHE env variable globally #90

DanTup opened this issue Jul 3, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@DanTup
Copy link

DanTup commented Jul 3, 2024

I was surprised to see paths in C:\Users\danny\.puro\shared\pub_cache showing up in projects where I had not used Puro. It appears that during installation, the PUB_CACHE env variable is changed globally.

This was rather unexpected to me - I don't think tools like this should modify variables that affect projects that aren't using them. It's also unclear to me why Puro can't just use the cache at the default location.

@pingbird
Copy link
Owner

The reason this was added is because there's unfortunately no other mechanism to tell pub which cache directory to use, particularly when invoked from an IDE (the IntelliJ / vscode plugins bypass the flutter/dart scripts and use the dart sdk directly). Perhaps a mistake in hindsight because it didn't end up fixing issues with pub global activate not being aware of which version of dart they were compiled with, a difficult problem to fix without replacing dart executables in the cache with a custom shim.

@DanTup
Copy link
Author

DanTup commented Oct 11, 2024

the IntelliJ / vscode plugins bypass the flutter/dart scripts and use the dart sdk directly

For VS Code, I think Puro is already writing a .vscode/settings.json with the SDK path in? If so, it could write dart.env to set the PUB_CACHE for that project too.

If it has to be set globally, it could at least make it clear during installation. I was using Puro just to try to reproduce some bugs and I was surprised to find I had a second Pub Cache (and now I'm using a Windows Dev Drive for better performance, this change would actually move my cache back onto a non-Dev Drive and undo my performance gains).

(that said, it's still not clear to me what moving the folder gains at all.. if it's still a single fixed folder for SDKs, how does the custom location differ from the default?)

@pingbird pingbird added the enhancement New feature or request label Dec 5, 2024
@pingbird
Copy link
Owner

pingbird commented Dec 5, 2024

I will be reverting this in the next release, new installs will use the default pub cache

@feinstein
Copy link

@pingbird so how active installs should proceed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants