chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Delete stale binaries when cross-building eggs


From: Felix
Subject: [Chicken-hackers] [PATCH] Delete stale binaries when cross-building eggs
Date: Mon, 29 Apr 2013 15:41:11 +0200 (CEST)

When cross-building extensions from a local directory (instead of
downloading) and the setup script uses make(1) or the "make" egg, or
may otherwise be influenced by files produced during the build, then
the 2nd (target) build may fail due to binaries left by the 1st build,
or the 1st may have leftover binaries from a previously built target
... you get the idea.

This change modifies "chicken-install.scm" to delete binary files
(with the extensions "so", "dll", "o", and a few others) before
building the host- or target-variant of an egg.


cheers
felix
>From d9d6aa93c059c95d9df0c9ed711294217734b0e9 Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Mon, 29 Apr 2013 14:44:09 +0200
Subject: [PATCH] Delete stale binaries in cross build of egg.

When cross-building extensions from a local directory (instead of
downloading) and the setup script uses make(1) or the "make" egg, or
may otherwise be influenced by files produced during the build, then
the 2nd (target) build may fail due to binaries left by the 1st build,
or the 1st may have leftover binaries from a previously built target
... you get the idea.

This change modifies "chicken-install.scm" to delete binary files
(with the extensions "so", "dll", "o", and a few others) before
building the host- or target-variant of an egg.
---
 chicken-install.scm |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/chicken-install.scm b/chicken-install.scm
index 1ba5b97..6e86aff 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -610,6 +610,8 @@
                      (lambda (dir)
                        (print "changing current directory to " dir)
                        (parameterize ((current-directory dir))
+                         (when *cross-chicken*
+                           (delete-stale-binaries))
                          (let ((cmd (make-install-command e+d+v (> i 1)))
                                (name (car e+d+v)))
                            (print "  " cmd)
@@ -639,6 +641,15 @@
         (map (cut assoc <> *eggs+dirs+vers*) dag)
         (iota num num -1)))))
 
+  (define (delete-stale-binaries)
+    (print* "deleting stale binaries ...")
+    (for-each
+     (lambda (f)
+       (print* " " f)
+       (delete-file* f))
+     (glob "*.so" "*.dll" "*.o" "*.a"))
+    (newline))
+
   (define (cleanup)
     (unless *keep*
       (and-let* ((tmpdir (temporary-directory)))
-- 
1.7.9.5


reply via email to

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