>From affc097e4191cfa03ebf6f135f878b59d9553fc7 Mon Sep 17 00:00:00 2001 From: felix Date: Mon, 29 Apr 2013 14:44:09 +0200 Subject: [PATCH 2/2] 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. Signed-off-by: Peter Bex --- chicken-install.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chicken-install.scm b/chicken-install.scm index 4283d03..cba7765 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -611,6 +611,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) @@ -640,6 +642,15 @@ (map (cut assoc <> *eggs+dirs+vers*) dag) (iota num num -1))))) + (define (delete-stale-binaries) + (print* "deleting stale binaries ...") + (print* "deleting stale binaries ...") + (find-files "." test: `(seq (* any) "." (or "o" "so" "dll" "a")) + action: (lambda (f _) + (print* " " f) + (delete-file* f))) + (newline)) + (define (cleanup) (unless *keep* (and-let* ((tmpdir (temporary-directory))) -- 1.8.0.1