summaryrefslogtreecommitdiff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2021-07-22 00:05:45 +0200
committerMarius Bakke <marius@gnu.org>2021-07-23 17:26:47 +0200
commit65c5efd14e57afbc8152cadf09fc30076c60532a (patch)
treed52786c601122db2c8d5f33b4292ed80c3db8af7 /gnu/packages/python.scm
parent7c2c69886275895f6030b47c76078abfe62edf82 (diff)
gnu: Python: Delete existing compiled files before compiling bytecode.
* gnu/packages/python.scm (python-3.9)[arguments]: Delete existing pycs before calling "compileall".
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0b763af9243..8a8fe2bd2ae 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -533,6 +533,14 @@ data types.")
533 ;; Disable hash randomization to ensure the generated .pycs 533 ;; Disable hash randomization to ensure the generated .pycs
534 ;; are reproducible. 534 ;; are reproducible.
535 (setenv "PYTHONHASHSEED" "0") 535 (setenv "PYTHONHASHSEED" "0")
536
537 ;; XXX: Delete existing auto-generated pycs beforehand because
538 ;; the -f argument does not necessarily overwrite all files,
539 ;; leading to indeterministic results.
540 (for-each (lambda (pyc)
541 (delete-file pyc))
542 (find-files out "\\.pyc$"))
543
536 (apply invoke 544 (apply invoke
537 `(,,(if (%current-target-system) 545 `(,,(if (%current-target-system)
538 "python3" 546 "python3"