about summary refs log tree commit diff
path: root/doc/languages-frameworks
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2020-12-30 14:49:10 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2021-03-13 13:11:50 +0100
commit9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb (patch)
tree84395442f1491ca4af7cb580c9176a87ae8dc4fc /doc/languages-frameworks
parent1adc69d4aa89fae7868d522914b4fb200267a90e (diff)
downloadnixlib-9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb.tar
nixlib-9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb.tar.gz
nixlib-9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb.tar.bz2
nixlib-9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb.tar.lz
nixlib-9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb.tar.xz
nixlib-9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb.tar.zst
nixlib-9d03ff52229f36ff4b4e9d0ee2db4a46b90512bb.zip
python: reproducible builds
Achieve reproducible builds of the interpreter. Note this meant
disabling optimizations again.
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r--doc/languages-frameworks/python.section.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index e569cdaa9357..ff039b5e6380 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -788,6 +788,23 @@ Each interpreter has the following attributes:
 - `executable`. Name of the interpreter executable, e.g. `python3.8`.
 - `pkgs`. Set of Python packages for that specific interpreter. The package set can be modified by overriding the interpreter and passing `packageOverrides`.
 
+### Optimizations
+
+The Python interpreters are by default not build with optimizations enabled, because
+the builds are in that case not reproducible. To enable optimizations, override the
+interpreter of interest, e.g using
+
+```
+let
+  pkgs = import ./. {};
+  mypython = pkgs.python3.override {
+    enableOptimizations = true;
+    reproducibleBuild = false;
+    self = mypython;
+  };
+in mypython
+```
+
 ### Building packages and applications
 
 Python libraries and applications that use `setuptools` or