-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: add setupHook for deterministic build of .pyc in dependents #25707
Comments
AFAIK this turns off hashdos attack protection |
Is it not possible to turn (the equivalent of) If not, I imagine it shouln't be too hard to add that to upstream python, or patch this functionality in (but I assume a lot of people would like it)? |
Randomization is only turned off when building packages. Afterwards, this reproducible .pyc is used but the algorithms should then start doing randomization, not already during build-time. |
Relevant issue on Python bug tracker: http://bugs.python.org/issue13703 |
I asked on |
The |
The Python interpreters are patched so they can build .pyc bytecode free of certain indeterminism. When building Python packages we currently set ``` compiling python files. in nix store. DETERMINISTIC_BUILD=1; PYTHONHASHSEED = 0; ``` Instead if setting these environment variables in the function that builds the package, this commit sets the variables instead in the Python setup hook. That way, whenever Python is included in a derivation, these variables are set. See also the issue NixOS#25707.
Closing because this is merged in staging (#25916). |
Issue description
The Python interpreters are patched so they can build .pyc bytecode free of certain indeterminism.
When building Python packages we currently set
Instead of keeping it just in this function, I propose that we move this to the
setupHook
of the interpreters.cc @domenkozar @Mic92 @abbradar @bennofs @lsix and whoever I forgot to whom this may be relevant.
The text was updated successfully, but these errors were encountered: