-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
.nonadmin
files in pre-menuinst v2 conda installations
#150
Comments
Does any other package use
Maybe we consider two possible solutions:
|
I personally dislike the "admin unless a file has been found" approach and would rather see a ".admin" file instead. But that may be too much of a breaking change since it also affects how constructor works. Adding a The tricky part for Linux is indeed an HPC environment where there is an all-users installation but every user has a shortcut that they can remove. I wonder if a check like
This could be a promising approach, but which package environment? The |
The problem is that most of the time menuinst is called by conda behind the scenes; it's not the user dictating that directly. So we need some kind of heuristic to decide without user intervention.
That's promising, but it's breaking the previous assumptions for Windows (where root env is checked). Maybe we would check package env first and then only base if absent, but since absence could be both meaningful (is admin) and lack of signal (we didn't try to establish whether admin is needed or not), it'll be ambiguous. The more I think about it the more I believe that in Unix systems we can get away with a different strategy. In Windows, requesting super user permissions is more involved than prepending On Unix, users could just rerun the command with sudo in-front if they reaaally need an all-users shortcut. If they are installing something for all users, that probably requires sudo anyway at that point. So I'd say we check for the user id and if it's root we go for all users; otherwise, we default to the current user location.
Yea, this (or a similar variation) is essentially what I think we should do. |
Conceded.
What if we disambiguated by always creating a file, i.e. |
That can work for new environments, but we have to figure out a way for old environments too. I am going to start prototyping something in a PR and we'll see how ugly that looks :D |
#156 is now ready for review implementing the discussed approach (sans |
The context:
menuinst
v1 has some super user permissions elevation logic to enable the creation of shortcut items in the Start Menu for "All Users" installations.menuinst
anticipates whether it needs superuser permissions or not is by checking the presence of a.nonadmin
file in the root conda installation (aka%PREFIX%\.nonadmin
). The presence of the file dictates that no extra permisions are needed. The absence means superuser was needed at installation time..nonadmin
doesn't exist in Linux or macOS, even if no special permissions were needed to installconda
.The problem:
menuinst
v2 extends shortcut creation to all platforms, Linux and macOS included..nonadmin
file even if no special permissions were needed.menuinst
believe that, since.nonadmin
is absent, it indeed NEEDS superuser permissions, and will requestsudo
powers, when it doesn't technically need them.Possible solutions:
post-link.sh
script to themenuinst
v2 package to add the.nonadmin
file to$CONDA_ROOT
in Unix systems. The logic would be something like "if it's not there, try to add it; if we could do it, it was a nonadmin install; if we failed, that's ok, it was an admin install"..nonadmin
file and instead check whether theCONDA_ROOT
path is in a system-wide location (/opt
,/usr/local
...), outside of the current user home (~/
), while handling if we are sudo already or not. This might have a few rough edges though; e.g. what if the user installed to a non-standard location like/my-stuff/conda
. Is that user-only? All users? Maybe it's world writable but, does that mean that the shortcuts I am processing should be available to all users?I feel we need to rethink how this is approached outside Windows, specially because HPC users will probably run Linux and in those setups you can find system-wide conda installations with per-user environments that should NOT ask for superuser permissions to process their own shortcuts.
Maybe it's all way simpler: if the installation is running with superuser permissions already, then install to an "All users" location. If it's not, we'll install to current user directories. But we should not depend on the state of the
$CONDA_ROOT
folder.Thoughts? Tagging a few folks that have shown interest in the project or the superuser elevation issue before: @aganders3 @mrclary @marcoesters. Thanks!
The text was updated successfully, but these errors were encountered: