all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Build tarballs with deterministic file ordering
@ 2015-09-03 16:58 Mark H Weaver
  2015-09-03 21:52 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Mark H Weaver @ 2015-09-03 16:58 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 38 bytes --]

This is for core-updates.

    Mark



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Build tarballs with deterministic file ordering --]
[-- Type: text/x-patch, Size: 4326 bytes --]

From 92226a470ddc980e54863632e5b179bf40444bd7 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Thu, 3 Sep 2015 12:51:47 -0400
Subject: [PATCH] Build tarballs with deterministic file ordering.

* guix/packages.scm (patch-and-repack)[build],
  gnu/system/install.scm (self-contained-tarball)[build],
  gnu/packages/make-bootstrap.scm (tarball-package),
  gnu/packages/admin.scm (isc-dhcp),
  gnu/packages/video.scm (avidemux): Pass "--sort=name" to 'tar'.
---
 gnu/packages/admin.scm          | 1 +
 gnu/packages/make-bootstrap.scm | 3 ++-
 gnu/packages/video.scm          | 3 ++-
 gnu/system/install.scm          | 7 ++++++-
 guix/packages.scm               | 1 +
 5 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 53cf65e..512d604 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -428,6 +428,7 @@ connection alive.")
                      (zero? (system* "tar" "cf" "bind.tar.gz"
                                      "bind-9.9.5-P1"
                                      ;; avoid non-determinism in the archive
+                                     "--sort=name"
                                      "--mtime=@0"
                                      "--owner=root:0"
                                      "--group=root:0"))))
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 904aaed..d215a02 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -629,7 +629,8 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                                               ".tar.xz")
                                "."
                                ;; avoid non-determinism in the archive
-                               "--mtime=@0" "--owner=root:0" "--group=root:0"))))))))))
+                               "--sort=name" "--mtime=@0"
+                               "--owner=root:0" "--group=root:0"))))))))))
 
 (define %bootstrap-binaries-tarball
   ;; A tarball with the statically-linked bootstrap binaries.
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 79119ef..c2f88e2 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1015,7 +1015,8 @@ for use with HTML5 video.")
                (("#! /bin/sh") (string-append "#!" (which "bash"))))
              (system* "tar" "cjf" "ffmpeg-2.6.1.tar.bz2" "ffmpeg-2.6.1"
                       ;; avoid non-determinism in the archive
-                      "--mtime=@0" "--owner=root:0" "--group=root:0")
+                      "--sort=name" "--mtime=@0"
+                      "--owner=root:0" "--group=root:0")
              (delete-file-recursively "ffmpeg-2.6.1")))
          (alist-replace 'configure
           (lambda _
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index e7e5d4a..8802368 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -74,8 +74,13 @@ under /root/.guix-profile where GUIX is installed."
           ;; length limitation.
           (with-directory-excursion %root
             (zero? (system* "tar" "--xz" "--format=gnu"
-                            "--owner=root:0" "--group=root:0"
+
+                            ;; avoid non-determinism in the archive
+                            "--sort=name"
                             "--mtime=@0"          ;for files in /var/guix
+                            "--owner=root:0"
+                            "--group=root:0"
+
                             "--check-links"
                             "-cvf" #$output
                             ;; Avoid adding / and /var to the tarball,
diff --git a/guix/packages.scm b/guix/packages.scm
index d338ad2..d73e6b0 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -482,6 +482,7 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
                       (zero? (system* (string-append #+tar "/bin/tar")
                                       "cvfa" #$output directory
                                       ;; avoid non-determinism in the archive
+                                      "--sort=name"
                                       "--mtime=@0"
                                       "--owner=root:0"
                                       "--group=root:0")))))))
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Build tarballs with deterministic file ordering
  2015-09-03 16:58 [PATCH] Build tarballs with deterministic file ordering Mark H Weaver
@ 2015-09-03 21:52 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-09-03 21:52 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> From 92226a470ddc980e54863632e5b179bf40444bd7 Mon Sep 17 00:00:00 2001
> From: Mark H Weaver <mhw@netris.org>
> Date: Thu, 3 Sep 2015 12:51:47 -0400
> Subject: [PATCH] Build tarballs with deterministic file ordering.
>
> * guix/packages.scm (patch-and-repack)[build],
>   gnu/system/install.scm (self-contained-tarball)[build],
>   gnu/packages/make-bootstrap.scm (tarball-package),
>   gnu/packages/admin.scm (isc-dhcp),
>   gnu/packages/video.scm (avidemux): Pass "--sort=name" to 'tar'.

Good catch, OK for ‘core-updates’.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-03 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-03 16:58 [PATCH] Build tarballs with deterministic file ordering Mark H Weaver
2015-09-03 21:52 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.