[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#71527] [PATCH 01/20] gnu: rebar3: Make rebar3 escriptize reproducib
From: |
Igor Goryachev |
Subject: |
[bug#71527] [PATCH 01/20] gnu: rebar3: Make rebar3 escriptize reproducible. |
Date: |
Thu, 13 Jun 2024 09:17:38 +0300 |
* gnu/packages/erlang.scm (rebar3): Make rebar3 escriptize reproducible.
Change-Id: Id5897566f870afe62a97154becc752025a1b323e
---
gnu/packages/erlang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index c53cb72c2e..975e989055 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2023 wrobell <wrobell@riseup.net>
;;; Copyright © 2023 Tim Johann <t1m@phrogstar.de>
+;;; Copyright © 2024 Igor Goryachev <igor@goryachev.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -638,6 +639,29 @@ (define-public rebar3
"eunit_formatters" "getopt" "hex_core" "erlware_commons"
"parse_trans" "relx" "ssl_verify_fun" "providers"))))
(delete 'configure)
+ ;; By default rebar3 produces escripts with embedded ZIP archives
+ ;; with files with current timestamps which is not suitable for
+ ;; reproducible builds. We fix it by setting predefined timestamps.
+ (add-before 'build 'make-escriptize-reproducible
+ (lambda _
+ (let ((escriptize "src/rebar_prv_escriptize.erl"))
+ (substitute* escriptize
+ (("\\[dir_entries\\(filename:dirname\\(Filename1\\)\\),")
+ (string-append "FilePath = filename:join(Dir, Filename),"
+ "{ok, FileInfo0} =
file:read_file_info(FilePath),"
+ "DateTime = {{1970, 1, 1}, {0, 0, 1}},"
+ "FileInfo = FileInfo0#file_info{mtime =
DateTime},"
+
"[dir_entries(filename:dirname(Filename1)),")))
+ (substitute* escriptize
+ (((string-append
+ "\\{Filename1, file_contents\\(filename:join\\(Dir, "
+ "Filename\\)\\)\\}\\]."))
+ "{Filename1, file_contents(FilePath), FileInfo}]."))
+ (substitute* escriptize
+ (((string-append "\\[\\{FName,FBin\\} \\|\\| \\{FName,FBin\\}
<- "
+ "Files, FBin =/= <<>>\\]\\."))
+ (string-append "[{FName,FBin,FInfo} || {FName,FBin,FInfo} <-
"
+ "Files, FBin =/= <<>>]."))))))
(replace 'build
(lambda _
(setenv "HOME" (getcwd))
--
2.45.1
- [bug#71527] [PATCH 00/20] Update erlang, elixir things, add xxkb., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 01/20] gnu: rebar3: Make rebar3 escriptize reproducible.,
Igor Goryachev <=
- [bug#71527] [PATCH 08/20] gnu: erlang-getopt: Update to 1.0.3., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 17/20] gnu: elixir-hex: Update to 2.1.1., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 05/20] gnu: erlang-cth-readable: Update to 1.6.0., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 06/20] gnu: erlang-edown: Update to 0.9.1., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 02/20] gnu: erlang: Update to 26.2.5., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 11/20] gnu: erlang-parse-trans: Update to 3.4.2., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 19/20] gnu: erlang: Add chunks compilation., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 09/20] gnu: erlang-hex-core: Update to 0.10.0., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 13/20] gnu: erlang-ssl-verify-fun: Update to 1.1.7., Igor Goryachev, 2024/06/13
- [bug#71527] [PATCH 20/20] gnu: Add xxkb., Igor Goryachev, 2024/06/13