unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#28017] [PATCH] Reproducible issue for skalibs
@ 2017-08-08  7:33 Z. Ren
  2017-08-22 12:59 ` bug#28017: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Z. Ren @ 2017-08-08  7:33 UTC (permalink / raw)
  To: 28017

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

Hi!
While conducting a study inspired by the "reproducible builds" practice [1], we have noticed that the package skalibs could not be built reproducibly.

After investigation, we observe that the unreproducibility is caused by "Makefile", in which the order of ALL_SRCS is not sorted. Consequently, the file order of the library files "lib/{libskarnet.so.2.3.10.0, skalibs/libskarnet.a}" may not be deterministic.

The attached patch sorts the ALL_SRCS list, so that the file order in the libraries is deterministic. Once applied, skalibs could be built reproducibly.

 [1]: https://wiki.debian.org/ReproducibleBuilds

[-- Attachment #2: 0001-reproducible-fix-for-skalibs.patch --]
[-- Type: application/octet-stream, Size: 1062 bytes --]

From 2493ede868202cc4c32a89b612cec6f57d07d7e4 Mon Sep 17 00:00:00 2001
From: Z. Ren <zren@dlut.edu.cn>
Date: Tue, 8 Aug 2017 14:50:35 +0800
Subject: [PATCH] reproducible fix for skalibs

---
 gnu/packages/skarnet.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/skarnet.scm b/gnu/packages/skarnet.scm
index 37e09d864..4e7188a4f 100644
--- a/gnu/packages/skarnet.scm
+++ b/gnu/packages/skarnet.scm
@@ -39,7 +39,13 @@
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags '("--enable-force-devr") ; do not analyze /dev/random
-       #:tests? #f)) ; no tests exist
+       #:tests? #f ; no tests exist
+       #:phases
+       (modify-phases %standard-phases
+        (add-after 'unpack 'reproducible
+         (lambda _
+          (substitute* "Makefile"
+           (("\\$\\(ALL_SRCS:%.c=%.o\\)") "$(sort $(ALL_SRCS:%.c=%.o))")))))))
     (home-page "http://skarnet.org/software/skalibs/")
     (synopsis "Platform abstraction libraries for skarnet.org software")
     (description
-- 
2.11.0


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

* bug#28017: [PATCH] Reproducible issue for skalibs
  2017-08-08  7:33 [bug#28017] [PATCH] Reproducible issue for skalibs Z. Ren
@ 2017-08-22 12:59 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2017-08-22 12:59 UTC (permalink / raw)
  To: Z. Ren; +Cc: 28017-done

Hello,

"Z. Ren" <zren@dlut.edu.cn> skribis:

> While conducting a study inspired by the "reproducible builds" practice [1], we have noticed that the package skalibs could not be built reproducibly.
>
> After investigation, we observe that the unreproducibility is caused by "Makefile", in which the order of ALL_SRCS is not sorted. Consequently, the file order of the library files "lib/{libskarnet.so.2.3.10.0, skalibs/libskarnet.a}" may not be deterministic.

Indeed.  Pushed with slight reindentation and a commit message that
follows our conventions.

Thank you!

Ludo’.

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

end of thread, other threads:[~2017-08-22 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08  7:33 [bug#28017] [PATCH] Reproducible issue for skalibs Z. Ren
2017-08-22 12:59 ` bug#28017: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).