diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2017-05-19 14:21:58 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2017-05-19 16:28:11 +0200 |
commit | acd32a4caf533ca6202afad07c085450649dbe4a (patch) | |
tree | 65a6371aaa7f5db5caf583d55a657620aa66ce9f /pkgs/development/interpreters/python/mk-python-derivation.nix | |
parent | 5aa530f2a8f6ee640b166786a32fbf6788993516 (diff) |
Python: set DETERMINISTIC_BUILD and PYTHONHASHSEED in setupHook
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 https://github.com/NixOS/nixpkgs/issues/25707.
Diffstat (limited to 'pkgs/development/interpreters/python/mk-python-derivation.nix')
-rw-r--r-- | pkgs/development/interpreters/python/mk-python-derivation.nix | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 5d710fcad8828..1a388bfe4afa0 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -57,13 +57,6 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled"] // { inherit pythonPath; - - # Determinism: The interpreter is patched to write null timestamps when compiling python files. - # This way python doesn't try to update them when we freeze timestamps in nix store. - DETERMINISTIC_BUILD=1; - # Determinism: We fix the hashes of str, bytes and datetime objects. - PYTHONHASHSEED = 0; - buildInputs = [ wrapPython ] ++ buildInputs ++ pythonPath ++ [ (ensureNewerSourcesHook { year = "1980"; }) ] ++ (lib.optional (lib.hasSuffix "zip" attrs.src.name or "") unzip) |