Puro unexpectedly modifies PUB_CACHE env variable globally
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.
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.
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?)
I will be reverting this in the next release, new installs will use the default pub cache
@pingbird so how active installs should proceed?
@pingbird since this was closed, could you provide some instructions on how previous installations could be modified to match the new behaviour? Or is this going to be automatic?