guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

47/49: gnu: Python: Delete existing compiled files before compiling byte


From: guix-commits
Subject: 47/49: gnu: Python: Delete existing compiled files before compiling bytecode.
Date: Fri, 23 Jul 2021 11:33:14 -0400 (EDT)

mbakke pushed a commit to branch core-updates
in repository guix.

commit 65c5efd14e57afbc8152cadf09fc30076c60532a
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Thu Jul 22 00:05:45 2021 +0200

    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(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0b763af..8a8fe2b 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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]