constructor icon indicating copy to clipboard operation
constructor copied to clipboard

Windows system-wide permissions do not work for Numba

Open larsoner opened this issue 2 years ago • 6 comments

Checklist

  • [X] I added a descriptive title
  • [X] I searched open reports and couldn't find a duplicate

What happened?

  • When doing a system-wide install on Windows, if you have numba installed, Spyder can hang when importing a package that uses @numba.jit (as it tries to compile I think). Maybe this is in part a numba bug since it should be able to figure out if it can create the .so in the given package directory (e.g., mne/<something>.so.
  • Users can also have problems installing packages in the env unless they used an elevated-permissions prompt

See e.g. https://github.com/mne-tools/mne-installers/issues/182

Conda Info

See for example:

https://github.com/mne-tools/mne-installers/blob/main/recipes/mne-python_1.4/construct.yaml

Conda Config

No response

Conda list

No response

Additional Context

Is there a way to disable system-wide installs on Windows? That might be enough to at least avoid the bug for now.

larsoner avatar Apr 20 '23 19:04 larsoner

Hi!

I'd say this is expected. All users installations need superuser, and changes to that location will require superuser by design. It's supposed to be used by IT administrators. I agree numba should try to to find a writable location for their (temporary?) files.

Are you asking for feature where we allow to create installers without the All Users option? Before we consider that, how about these workarounds:

  • Hack something together via https://conda.github.io/constructor/construct-yaml/#default-prefix-all-users (e.g. redirect to a known writable location in the user directory)
  • Add some verbiage to the Welcome text alerting users
  • Use some preinstall logic where you refuse "All Users" installs from the beginning?

jaimergp avatar Apr 21 '23 09:04 jaimergp

I'd say this is expected

Agreed -- to me it's both expected based on permissions and how system-wide installs work, but also problematic based on user expectations and experiences (unusable modules in at least some cases -- for us we build MNE-Python installers and import mne hangs :disappointed: ).

Are you asking for feature where we allow to create installers without the All Users option?

Yes it seems like the cleanest option to me assuming it's easy in NSIS to disable the option in the GUI

Hack something together via https://conda.github.io/constructor/construct-yaml/#default-prefix-all-users (e.g. redirect to a known writable location in the user directory)

It's possible that this would still get permissions that are too restrictive, we'd have to check. I don't see too much advantage to this over hacking together a post-install script that chowns or chmods after installation completes -- you end up with a single-user (or all-user) writable version, which doesn't seem all that secure or intuitive for a system-wide/all-users install.

Use some preinstall logic where you refuse "All Users" installs from the beginning?

At the end of the day just getting the option out of the installer GUI on Windows is good enough I think. But if what you suggest here is to keep it in the GUI but then somehow raise an error after the user selects all-users install, then that doesn't seem as good. But I'm guessing you mean something else?

larsoner avatar Apr 21 '23 13:04 larsoner

I was mostly proposing some solutions while we provide a way to remove "All Users". My intuition right now tells me that parts of the code assume the option will be available so it's not going to be a super obvious PR where we just put things inside an if clause.

We've also seen things in PKG installers where "All Users" equivalent installations are being problematic, so by all means this feedback is welcome and we'll probably add a flag somewhere.

jaimergp avatar Apr 21 '23 14:04 jaimergp

We've also seen things in PKG installers where "All Users" equivalent installations are being problematic

Indeed for macOS we currently do some post-install permissions hacks to get around the issue. If the fix here isn't easy we'll probably do some chown/chmod stuff to get the All Users installs at least working on Windows even if it's not ideal!

larsoner avatar Apr 21 '23 14:04 larsoner

Can we not just disable system-wide installs somehow?

hoechenberger avatar Apr 21 '23 14:04 hoechenberger

Yea, that's the feature request. There's no easy config to get that out the way right now 😬

jaimergp avatar Apr 21 '23 17:04 jaimergp

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include: - What OS and version you reproduced the issue on - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

github-actions[bot] avatar Apr 21 '24 04:04 github-actions[bot]