~ chicken-core (chicken-5) 4c0b5f77038186df71a6c55493acdd9ffce67776
commit 4c0b5f77038186df71a6c55493acdd9ffce67776 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Mon Apr 29 14:44:09 2013 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Thu May 2 10:31:27 2013 +0200 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 <peter.bex@xs4all.nl> Signed-off-by: felix <felix@call-with-current-continuation.org> diff --git a/chicken-install.scm b/chicken-install.scm index 4283d038..cba7765b 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)))Trap