summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-04-06 12:00:29 +0200
committerLudovic Courtès <ludo@gnu.org>2016-04-06 12:00:29 +0200
commit933d2fe4cfb380f66af631a2203ec23c367e5b1a (patch)
treef10581ed0da1911eed9b02e69d999ba481d9d3c6 /guix/build
parentf8835ff4b3dd59d59bf44838d05d3d60114d15d2 (diff)
parent998afc3608242b75051f43ece36d52474c51e285 (diff)
downloadguix-patches-933d2fe4cfb380f66af631a2203ec23c367e5b1a.tar
guix-patches-933d2fe4cfb380f66af631a2203ec23c367e5b1a.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/ant-build-system.scm29
-rw-r--r--guix/build/cvs.scm11
-rw-r--r--guix/build/syscalls.scm12
3 files changed, 34 insertions, 18 deletions
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index d302b948b5..27277af34b 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -65,13 +65,8 @@
(target (@ (name "jar")
(depends "compile"))
(mkdir (@ (dir "${jar.dir}")))
- ;; We cannot use the simpler "jar" task here, because
- ;; there is no way to disable generation of a
- ;; manifest. We do not include a generated manifest
- ;; to ensure determinism, because we cannot easily
- ;; reset the ctime/mtime before creating the archive.
(exec (@ (executable "jar"))
- (arg (@ (line ,(string-append "-Mcf ${jar.dir}/" jar-name
+ (arg (@ (line ,(string-append "-cf ${jar.dir}/" jar-name
" -C ${classes.dir} ."))))))
(target (@ (name "install"))
@@ -105,16 +100,15 @@ INPUTS."
(zero? (apply system* `("ant" ,build-target ,@make-flags))))
(define* (strip-jar-timestamps #:key outputs
- #:allow-other-keys)
+ #:allow-other-keys)
"Unpack all jar archives, reset the timestamp of all contained files, and
repack them. This is necessary to ensure that archives are reproducible."
(define (repack-archive jar)
(format #t "repacking ~a\n" jar)
- (let ((dir (mkdtemp! "jar-contents.XXXXXX")))
+ (let* ((dir (mkdtemp! "jar-contents.XXXXXX"))
+ (manifest (string-append dir "/META-INF/MANIFEST.MF")))
(and (with-directory-excursion dir
(zero? (system* "jar" "xf" jar)))
- ;; The manifest file contains timestamps
- (for-each delete-file (find-files dir "MANIFEST.MF"))
(delete-file jar)
;; XXX: copied from (gnu build install)
(for-each (lambda (file)
@@ -122,8 +116,19 @@ repack them. This is necessary to ensure that archives are reproducible."
(unless (eq? (stat:type s) 'symlink)
(utime file 0 0 0 0))))
(find-files dir #:directories? #t))
- (unless (zero? (system* "jar" "-Mcf" jar "-C" dir "."))
- (error "'jar' failed"))
+
+ ;; The jar tool will always set the timestamp on the manifest file
+ ;; and the containing directory to the current time, even when we
+ ;; reuse an existing manifest file. To avoid this we use "zip"
+ ;; instead of "jar". It is important that the manifest appears
+ ;; first.
+ (with-directory-excursion dir
+ (let* ((files (find-files "." ".*" #:directories? #t))
+ (command (if (file-exists? manifest)
+ `("zip" "-X" ,jar ,manifest ,@files)
+ `("zip" "-X" ,jar ,@files))))
+ (unless (zero? (apply system* command))
+ (error "'zip' failed"))))
(utime jar 0 0)
#t)))
diff --git a/guix/build/cvs.scm b/guix/build/cvs.scm
index bd5c50a51a..9976e624b3 100644
--- a/guix/build/cvs.scm
+++ b/guix/build/cvs.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -51,14 +52,20 @@
"Fetch REVISION from MODULE of CVS-ROOT-DIRECTORY into DIRECTORY. REVISION
must either be a date in ISO-8601 format (e.g. \"2012-12-21\") or a CVS tag.
Return #t on success, #f otherwise."
- (and (zero? (system* cvs-command "-z3"
+ ;; Use "-z0" because enabling compression leads to hangs during checkout on
+ ;; certain repositories, such as
+ ;; ":pserver:anonymous@cvs.savannah.gnu.org:/sources/gnustandards".
+ (and (zero? (system* cvs-command "-z0"
"-d" cvs-root-directory
"checkout"
(if (string-match "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" revision)
"-D" "-r")
revision
module))
- (rename-file module directory)
+ ;; Copy rather than rename in case MODULE and DIRECTORY are on
+ ;; different devices.
+ (copy-recursively module directory)
+
(with-directory-excursion directory
(for-each delete-file-recursively (find-cvs-directories)))
#t))
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index ea68b22bb7..69a507def8 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -767,10 +767,14 @@ the same type as that returned by 'make-socket-address'."
(format port "#<interface ~s " name)
(unless (zero? (logand IFF_UP flags))
(display "up " port))
- (if (member (sockaddr:fam address) (list AF_INET AF_INET6))
- (format port "~a " (inet-ntop (sockaddr:fam address)
- (sockaddr:addr address)))
- (format port "family:~a " (sockaddr:fam address)))
+
+ ;; Check whether ADDRESS really is a sockaddr.
+ (when address
+ (if (member (sockaddr:fam address) (list AF_INET AF_INET6))
+ (format port "~a " (inet-ntop (sockaddr:fam address)
+ (sockaddr:addr address)))
+ (format port "family:~a " (sockaddr:fam address))))
+
(format port "~a>" (number->string (object-address interface) 16)))))
(set-record-type-printer! <interface> write-interface)