Scoop
Scoop copied to clipboard
Private environment variables in shims
Hi.
I'd like to suggest a feature - possibility to specify environment variables right in shim. It will allow to not pollute system variables with application-specific data and make ideally isolated application packages.
For example, I wish to install Python 2.7 and allow user to use his own Python installation as well (many packages like Anaconda, MSVC, Jupyter install Python as part of itself). In this case, I make following shims:
pip2.shim:
path = C:\Users\Chebotarev_V\scoop\apps\python27\current\python.exe
args = -m pip
env::PYTHONHOME = C:\Users\Chebotarev_V\scoop\apps\python27\current\
python2.shim:
path = C:\Users\Chebotarev_V\scoop\apps\python27\current\python.exe
env::PYTHONHOME = C:\Users\Chebotarev_V\scoop\apps\python27\current\
And depending on executable I call, my packages will be kept completely intact by foreign Python. I can install two versions of Python to the same user and be sure everything is fine.
I hope you get the idea, some applications can have non-compatible requirements for environment variables and this patch enables possibility to use them.
Suggestions are welcome.
One more example (and test shim):
path = python3
args = -c "import os; print(os.environ)"
env::Path = my_custom_path;%Path%
Also, I want to note, that shim is a critical piece of Scoop. I guess we should have tests somewhere in separate PR.
Also my patch will allow to fix this #2693 .
@r15ch13 Please, let's make JSON in separate PR if needed.
By the way, currently perl package pollutes PATH in very bad way, overriding default gcc.
Hi @r15ch13. Is there anything that prevents us from merging it? I can see that people react in good way about this change.
This requires changes to shim() to function.
Hi, I came to bascially ask for this exact feature, are there any reason this wasn't merged?
The shim code in this PR is no longer used
Probably not ideal but I overcome my needs by making a "bin wrapper" to use in manifests