hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Hatch install bug on Windows when filtering environment variables

Open Midnighter opened this issue 1 year ago • 3 comments

When you filter the environment variables, then hatch fails to install into environments on Windows, please see my MRE and in particular the last Actions run. Please note that on Python <=3.10 the error is:

Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python

And on Python >3.10:

OSError: [WinError 10106] The requested service provider could not be loaded or initialized

I did some digging and found this issue https://github.com/python/cpython/issues/120836. My best guess is that when filtering environment variables, hatch does not maintain variables that are critical to subprocess' functioning on Windows as mentioned in the linked issue.

Midnighter avatar Jul 04 '24 19:07 Midnighter

Thanks, feel free to open a PR if you have time!

ofek avatar Jul 04 '24 19:07 ofek

I'm afraid I don't have the mindspace to learn hatch internals at the moment.

Midnighter avatar Jul 11 '24 21:07 Midnighter

This will be fixed in the next release.

ofek avatar Jul 11 '24 22:07 ofek