From 65c5efd14e57afbc8152cadf09fc30076c60532a Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 22 Jul 2021 00:05:45 +0200 Subject: gnu: Python: Delete existing compiled files before compiling bytecode. * gnu/packages/python.scm (python-3.9)[arguments]: Delete existing pycs before calling "compileall". --- gnu/packages/python.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gnu/packages') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 0b763af924..8a8fe2bd2a 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -533,6 +533,14 @@ data types.") ;; Disable hash randomization to ensure the generated .pycs ;; are reproducible. (setenv "PYTHONHASHSEED" "0") + + ;; XXX: Delete existing auto-generated pycs beforehand because + ;; the -f argument does not necessarily overwrite all files, + ;; leading to indeterministic results. + (for-each (lambda (pyc) + (delete-file pyc)) + (find-files out "\\.pyc$")) + (apply invoke `(,,(if (%current-target-system) "python3" -- cgit v1.2.3