GNU bug report logs - #72508
[PATCH 0/5] Erlang update to 27.0.1.

Previous Next

Package: guix-patches;

Reported by: Igor Goryachev <igor <at> goryachev.org>

Date: Wed, 7 Aug 2024 08:20:02 UTC

Severity: normal

Tags: patch

Done: Andrew Tropin <andrew <at> trop.in>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72508 in the body.
You can then email your comments to 72508 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 08:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Igor Goryachev <igor <at> goryachev.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 07 Aug 2024 08:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: guix-patches <at> gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>
Subject: [PATCH 0/5] Erlang update to 27.0.1.
Date: Wed,  7 Aug 2024 11:10:57 +0300
Erlang package was cleaned up, updated to version 27.0.1 and several fixes/hacks were performed to make it deterministic by modifying its bootstrap.

Igor Goryachev (5):
  gnu: erlang-jsx: Fix tests under Erlang 27+.
  gnu: erlang-yamerl: Update to 0.10.0.a24f448.
  gnu: erlang-jose: Relax build options.
  gnu: ejabberd: Include jiffy dependence under Erlang 27.
  gnu: erlang: Update to 27.0.1.

 gnu/packages/erlang-xyz.scm | 12 +++++
 gnu/packages/erlang.scm     | 91 +++++++++++++++++++++----------------
 gnu/packages/messaging.scm  |  3 ++
 3 files changed, 68 insertions(+), 38 deletions(-)


base-commit: 5e567587dd4abf51f9a6fa44f5a852dde1115ce9
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 08:25:01 GMT) Full text and rfc822 format available.

Message #8 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 1/5] gnu: erlang-jsx: Fix tests under Erlang 27+.
Date: Wed,  7 Aug 2024 11:23:47 +0300
* gnu/packages/erlang.scm (erlang-jsx): Fix tests under Erlang 27+.

Change-Id: Iaade94de64b5e5837a6a54376ba946c20d7107b9
---
 gnu/packages/erlang.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index b6a31f26e9..60d644ab8d 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -541,6 +541,16 @@ (define-public erlang-jsx
                (base32
                 "1wr7jkxm6nlgvd52xhniav64xr9rml2ngb35rwjwqlqvq7ywhp0c"))))
     (build-system rebar-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Fix tests for running under Erlang 27+.
+         (add-after 'unpack 'fix-tests-for-erlang-27
+           (lambda _
+             (substitute* "src/jsx_decoder.erl"
+               (("\\{\"-0\\.0\", \\[\\{float, 0\\.0\\}, end_json\\], <<\"-0\\.0\">>\\},")
+                "{\"0.0\", [{float, 0.0}, end_json], <<\"0.0\">>},
+{\"-0.0\", [{float, -0.0}, end_json], <<\"-0.0\">>},")))))))
     (synopsis "Streaming, evented JSON parsing toolkit")
     (description
      "An Erlang application for consuming, producing and manipulating json.")
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 08:25:02 GMT) Full text and rfc822 format available.

Message #11 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 2/5] gnu: erlang-yamerl: Update to 0.10.0.a24f448.
Date: Wed,  7 Aug 2024 11:23:48 +0300
* gnu/packages/erlang.scm (erlang-yamerl): Update to 0.10.0.a24f448.

Change-Id: Ib279881ff14e6e46ef639c1bcbc53706fa55aef6
---
 gnu/packages/erlang.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 60d644ab8d..2452fd88ab 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -292,17 +292,18 @@ (define-public erlang-cf
 (define-public erlang-yamerl
   (package
     (name "erlang-yamerl")
-    (version "0.10.0")
+    (version "0.10.0.a24f448")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
              ;; There are no tests included on Hex.
              (url "https://github.com/yakaz/yamerl")
-             (commit (string-append "v" version))))
+             ;; Fetching commit which includes Erlang 27+ related fixes.
+             (commit "a24f448c0a8084f70b751dc38621047e56fb53cc")))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0if8abgmispcfk7zhd0a5dndzwzbsmqrbyrm5shk375r2dbbwak6"))))
+        (base32 "1csq0z4igyybjgmrynz4d49ysv437iyd2xzkhifb5x47lpdpfpkq"))))
     (build-system rebar-build-system)
     (synopsis "YAML and JSON parser in pure Erlang")
     (description
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 08:25:02 GMT) Full text and rfc822 format available.

Message #14 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 3/5] gnu: erlang-jose: Relax build options.
Date: Wed,  7 Aug 2024 11:23:49 +0300
* gnu/packages/erlang-xyz.scm (erlang-jose): Relax build options.

Change-Id: I0e90cb54558260aea07bc33a11a2ab56261a20bf
---
 gnu/packages/erlang-xyz.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/erlang-xyz.scm b/gnu/packages/erlang-xyz.scm
index 5661bf52dd..6f1c033aec 100644
--- a/gnu/packages/erlang-xyz.scm
+++ b/gnu/packages/erlang-xyz.scm
@@ -59,6 +59,18 @@ (define-public erlang-jose
        (sha256
         (base32 "0576jdjygby37qmzrs8cm5l6n622b0mi3z28j6r4s5xsz1px6v0d"))))
     (build-system rebar-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Do not treat warnings as errors, for more info see:
+          ;; https://github.com/potatosalad/erlang-jose/issues/168
+          (add-after 'unpack 'relax-build-options
+            (lambda _
+              (substitute* "rebar.config"
+                (("debug_info,") "debug_info"))
+              (substitute* "rebar.config"
+                (("warnings_as_errors") "")))))))
     (synopsis
      "JSON Object Signing and Encryption for Erlang and Elixir")
     (description
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 08:25:03 GMT) Full text and rfc822 format available.

Message #17 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 4/5] gnu: ejabberd: Include jiffy dependence under Erlang 27.
Date: Wed,  7 Aug 2024 11:23:50 +0300
* gnu/packages/messaging.scm (ejabberd): Include jiffy dependence under Erlang 27.

Change-Id: Id0b0e7acb8100b406a6c686227dd497e0d7434fd
---
 gnu/packages/messaging.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index fb80866791..da04c34636 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -3706,6 +3706,9 @@ (define-public ejabberd
                 (substitute* "rebar.config"
                   (("\\{copy, \"rel/files/erl\",")
                    "%{copy, \"rel/files/erl\","))
+                ;; It seems ejabberd still needs jiffy due to p1_acme.
+                (substitute* "rebar.config"
+                  (("\\{if_version_below, \"27\",") "{if_version_below, \"30\","))
                 ;; Unpin pinned dependences.
                 (substitute* "rebar.lock"
                   ((",1\\}") ",0}"))
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 08:25:03 GMT) Full text and rfc822 format available.

Message #20 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 5/5] gnu: erlang: Update to 27.0.1.
Date: Wed,  7 Aug 2024 11:23:51 +0300
* gnu/packages/erlang.scm (erlang): Update to 27.0.1.

Change-Id: Ic603c441cc304ef460e2559c57d765d7e499aad5
---
 gnu/packages/erlang.scm | 74 ++++++++++++++++++++++-------------------
 1 file changed, 39 insertions(+), 35 deletions(-)

diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 2452fd88ab..793f311376 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -49,7 +49,7 @@ (define-module (gnu packages erlang)
 (define-public erlang
   (package
     (name "erlang")
-    (version "26.2.5")
+    (version "27.0.1")
     (source (origin
               (method git-fetch)
               ;; The tarball from http://erlang.org/download contains many
@@ -61,7 +61,7 @@ (define-public erlang
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0hd4flm9x8254rcv8hj0hra5lh5n51vcpharxy2d1ph8059vfsmx"))
+                "1gzlvbbc1zm87910pnhi94mcpag1zxylhy7m2g4vhlmclyir7gd1"))
               (patches (search-patches "erlang-man-path.patch"))))
     (build-system gnu-build-system)
     (native-inputs
@@ -69,13 +69,17 @@ (define-public erlang
 
        ;; Erlang's documentation is distributed in a separate tarball.
        ("erlang-manpages"
-        ,(origin
-           (method url-fetch)
-           (uri (string-append "https://github.com/erlang/otp/releases/download"
-                               "/OTP-" version "/otp_doc_man_" version ".tar.gz"))
-           (sha256
-            (base32
-             "08ngil8578asjzmqa657l4zdy0cr0h9spkg88wp9kxl95bfyli8p"))))))
+        ;; Manpages tarball is not released for 27.0.1, so we take it from the
+        ;; previous version. Details:
+        ;; https://erlangforums.com/t/patch-package-otp-27-0-1-released/3824/4
+        ,(let ((version "27.0"))
+           (origin
+             (method url-fetch)
+             (uri (string-append "https://github.com/erlang/otp/releases/download"
+                                 "/OTP-" version "/otp_doc_man_" version ".tar.gz"))
+             (sha256
+              (base32
+               "0f3w2152090860aci4a38d1bd19c5sslbwadwxc7sjza487fm8lm")))))))
     (inputs
      (list ncurses openssl wxwidgets))
     (propagated-inputs
@@ -84,6 +88,7 @@ (define-public erlang
      `(#:test-target "release_tests"
        #:configure-flags
        (list "--disable-saved-compile-time"
+             "--enable-deterministic-build"
              "--enable-dynamic-ssl-lib"
              "--enable-native-libs"
              "--enable-shared-zlib"
@@ -106,34 +111,22 @@ (define-public erlang
                     (time-utc->date
                      (make-time time-utc 0 (string->number
                                             (getenv "SOURCE_DATE_EPOCH"))))))
-               (substitute* "lib/reltool/src/reltool_target.erl"
-                 (("Date = date\\(\\),")
-                  (string-append "Date = "
-                                 (date->string source-date-epoch
-                                               "'{~Y,~m,~d}',"))))
-               (substitute* "lib/reltool/src/reltool_target.erl"
-                 (("Time = time\\(\\),")
-                  (string-append "Time = "
-                                 (date->string source-date-epoch
-                                               "'{~H,~M,~S}',"))))
-               (substitute* '("lib/reltool/src/reltool_target.erl"
-                              "lib/sasl/src/systools_make.erl")
-                 (("date\\(\\), time\\(\\),")
-                  (date->string source-date-epoch
-                                "{~Y,~m,~d}, {~H,~M,~S},")))
                (substitute* "lib/dialyzer/test/small_SUITE_data/src/gs_make.erl"
                  (("tuple_to_list\\(date\\(\\)\\),tuple_to_list\\(time\\(\\)\\)")
                   (date->string
                    source-date-epoch
-                   "tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})")))
-               (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
-                 (("\\{Y,Mo,D\\} = date\\(\\),")
-                  (date->string source-date-epoch
-                                "{Y,Mo,D} = {~Y,~m,~d},")))
-               (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
-                 (("\\{H,Mi,S\\} = time\\(\\),")
-                  (date->string source-date-epoch
-                                "{H,Mi,S} = {~H,~M,~S},"))))))
+                   "tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})"))))))
+         ;; When compiling with 'deterministic' option the important meta
+         ;; information is still needed for some Erlang's dependants, such as
+         ;; Elixir. We make compiler to preserve it.
+         ;; For more info see: https://github.com/erlang/otp/issues/8602
+         (add-after 'unpack 'preserve-source-meta
+           (lambda _
+             (substitute* "lib/compiler/src/compile.erl"
+               (("\\[\\{source,Source\\} \\| Info0\\];")
+                "[{source,Source} | Info0];
+                 [_|_] = Source when IsDeterministic ->
+                 [{source,Source} | Info0];"))))
          (add-after 'unpack 'patch-/bin/sh
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((sh (search-input-file inputs "/bin/sh")))
@@ -160,10 +153,21 @@ (define-public erlang
                         "lib/reltool/examples/display_args"
                         "lib/reltool/examples/mnesia_core_dump_viewer"
                         "lib/snmp/src/compile/snmpc.src"
-                        "make/verify_runtime_dependencies"
-                        "make/emd2exml.in"))))
+                        "make/verify_runtime_dependencies"))))
                (substitute* escripts
                  (("/usr/bin/env") (which "env"))))))
+         ;; Copy modified compiler to bootstrap. It is deterministic, but
+         ;; preserves 'source' meta information to be used by dependants
+         ;; of Erlang.
+         (add-after 'build 'copy-modified-compiler
+           (lambda _
+             (copy-recursively "lib/compiler/ebin/compile.beam"
+                               "bootstrap/lib/compiler/ebin/compile.beam")))
+         ;; ... clean everything and rebuild with modified bootstrap.
+         (add-after 'copy-modified-compiler 'clean-and-make-again
+           (lambda _
+             (invoke "make" "clean")
+             (invoke "make")))
          (add-before 'configure 'set-erl-top
            (lambda _
              (setenv "ERL_TOP" (getcwd))))
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 15:50:01 GMT) Full text and rfc822 format available.

Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Igor Goryachev via Guix-patches via <guix-patches <at> gnu.org>,
 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>
Subject: Re: [bug#72508] [PATCH 2/5] gnu: erlang-yamerl: Update to
 0.10.0.a24f448.
Date: Wed, 07 Aug 2024 19:49:02 +0400
[Message part 1 (text/plain, inline)]
On 2024-08-07 11:23, Igor Goryachev via Guix-patches via wrote:

> * gnu/packages/erlang.scm (erlang-yamerl): Update to 0.10.0.a24f448.
>
> Change-Id: Ib279881ff14e6e46ef639c1bcbc53706fa55aef6
> ---
>  gnu/packages/erlang.scm | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
> index 60d644ab8d..2452fd88ab 100644
> --- a/gnu/packages/erlang.scm
> +++ b/gnu/packages/erlang.scm
> @@ -292,17 +292,18 @@ (define-public erlang-cf
>  (define-public erlang-yamerl
>    (package
>      (name "erlang-yamerl")
> -    (version "0.10.0")
> +    (version "0.10.0.a24f448")

Take a look at package examples, with non-release version:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/emacs.scm?h=#n560

The revision starts at 0 and get increased every time commit value is
updated.  It resets to 0, when the version changes.

Please, adjust to this style and send the whole series as v2.

>      (source
>       (origin
>         (method git-fetch)
>         (uri (git-reference
>               ;; There are no tests included on Hex.
>               (url "https://github.com/yakaz/yamerl")
> -             (commit (string-append "v" version))))
> +             ;; Fetching commit which includes Erlang 27+ related fixes.
> +             (commit "a24f448c0a8084f70b751dc38621047e56fb53cc")))
>         (file-name (git-file-name name version))
>         (sha256
> -        (base32 "0if8abgmispcfk7zhd0a5dndzwzbsmqrbyrm5shk375r2dbbwak6"))))
> +        (base32 "1csq0z4igyybjgmrynz4d49ysv437iyd2xzkhifb5x47lpdpfpkq"))))
>      (build-system rebar-build-system)
>      (synopsis "YAML and JSON parser in pure Erlang")
>      (description

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 15:51:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 16:35:02 GMT) Full text and rfc822 format available.

Message #29 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH v2 1/5] gnu: erlang-jsx: Fix tests under Erlang 27+.
Date: Wed,  7 Aug 2024 19:32:09 +0300
* gnu/packages/erlang.scm (erlang-jsx): Fix tests under Erlang 27+.

Change-Id: Iaade94de64b5e5837a6a54376ba946c20d7107b9
---
 gnu/packages/erlang.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index b6a31f26e9..60d644ab8d 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -541,6 +541,16 @@ (define-public erlang-jsx
                (base32
                 "1wr7jkxm6nlgvd52xhniav64xr9rml2ngb35rwjwqlqvq7ywhp0c"))))
     (build-system rebar-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Fix tests for running under Erlang 27+.
+         (add-after 'unpack 'fix-tests-for-erlang-27
+           (lambda _
+             (substitute* "src/jsx_decoder.erl"
+               (("\\{\"-0\\.0\", \\[\\{float, 0\\.0\\}, end_json\\], <<\"-0\\.0\">>\\},")
+                "{\"0.0\", [{float, 0.0}, end_json], <<\"0.0\">>},
+{\"-0.0\", [{float, -0.0}, end_json], <<\"-0.0\">>},")))))))
     (synopsis "Streaming, evented JSON parsing toolkit")
     (description
      "An Erlang application for consuming, producing and manipulating json.")

base-commit: 5e567587dd4abf51f9a6fa44f5a852dde1115ce9
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 16:35:02 GMT) Full text and rfc822 format available.

Message #32 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH v2 2/5] gnu: erlang-yamerl: Update to 0.10.0-0.a24f448.
Date: Wed,  7 Aug 2024 19:32:10 +0300
* gnu/packages/erlang.scm (erlang-yamerl): Update to 0.10.0-0.a24f448.

Change-Id: Ib279881ff14e6e46ef639c1bcbc53706fa55aef6
---
 gnu/packages/erlang.scm | 41 ++++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 60d644ab8d..80ec673a56 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -290,26 +290,29 @@ (define-public erlang-cf
     (license license:expat)))
 
 (define-public erlang-yamerl
-  (package
-    (name "erlang-yamerl")
-    (version "0.10.0")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             ;; There are no tests included on Hex.
-             (url "https://github.com/yakaz/yamerl")
-             (commit (string-append "v" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "0if8abgmispcfk7zhd0a5dndzwzbsmqrbyrm5shk375r2dbbwak6"))))
-    (build-system rebar-build-system)
-    (synopsis "YAML and JSON parser in pure Erlang")
-    (description
-     "Erlang application to parse YAML 1.1 and YAML 1.2 documents, as well as
+  (let ((commit "a24f448c0a8084f70b751dc38621047e56fb53cc")
+        (revision "0"))
+    (package
+      (name "erlang-yamerl")
+      (version (git-version "0.10.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               ;; There are no tests included on Hex.
+               (url "https://github.com/yakaz/yamerl")
+               ;; Fetching commit which includes Erlang 27+ related fixes.
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1csq0z4igyybjgmrynz4d49ysv437iyd2xzkhifb5x47lpdpfpkq"))))
+      (build-system rebar-build-system)
+      (synopsis "YAML and JSON parser in pure Erlang")
+      (description
+       "Erlang application to parse YAML 1.1 and YAML 1.2 documents, as well as
 JSON documents.")
-    (home-page "https://hexdocs.pm/yamerl/")
-    (license license:bsd-2)))
+      (home-page "https://hexdocs.pm/yamerl/")
+      (license license:bsd-2))))
 
 (define-public erlang-covertool
   (package
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 16:35:03 GMT) Full text and rfc822 format available.

Message #35 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH v2 3/5] gnu: erlang-jose: Relax build options.
Date: Wed,  7 Aug 2024 19:32:11 +0300
* gnu/packages/erlang-xyz.scm (erlang-jose): Relax build options.

Change-Id: I0e90cb54558260aea07bc33a11a2ab56261a20bf
---
 gnu/packages/erlang-xyz.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/erlang-xyz.scm b/gnu/packages/erlang-xyz.scm
index 5661bf52dd..6f1c033aec 100644
--- a/gnu/packages/erlang-xyz.scm
+++ b/gnu/packages/erlang-xyz.scm
@@ -59,6 +59,18 @@ (define-public erlang-jose
        (sha256
         (base32 "0576jdjygby37qmzrs8cm5l6n622b0mi3z28j6r4s5xsz1px6v0d"))))
     (build-system rebar-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Do not treat warnings as errors, for more info see:
+          ;; https://github.com/potatosalad/erlang-jose/issues/168
+          (add-after 'unpack 'relax-build-options
+            (lambda _
+              (substitute* "rebar.config"
+                (("debug_info,") "debug_info"))
+              (substitute* "rebar.config"
+                (("warnings_as_errors") "")))))))
     (synopsis
      "JSON Object Signing and Encryption for Erlang and Elixir")
     (description
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 16:35:03 GMT) Full text and rfc822 format available.

Message #38 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH v2 4/5] gnu: ejabberd: Include jiffy dependence under Erlang
 27.
Date: Wed,  7 Aug 2024 19:32:12 +0300
* gnu/packages/messaging.scm (ejabberd): Include jiffy dependence under Erlang 27.

Change-Id: Id0b0e7acb8100b406a6c686227dd497e0d7434fd
---
 gnu/packages/messaging.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index fb80866791..da04c34636 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -3706,6 +3706,9 @@ (define-public ejabberd
                 (substitute* "rebar.config"
                   (("\\{copy, \"rel/files/erl\",")
                    "%{copy, \"rel/files/erl\","))
+                ;; It seems ejabberd still needs jiffy due to p1_acme.
+                (substitute* "rebar.config"
+                  (("\\{if_version_below, \"27\",") "{if_version_below, \"30\","))
                 ;; Unpin pinned dependences.
                 (substitute* "rebar.lock"
                   ((",1\\}") ",0}"))
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Wed, 07 Aug 2024 16:35:04 GMT) Full text and rfc822 format available.

Message #41 received at 72508 <at> debbugs.gnu.org (full text, mbox):

From: Igor Goryachev <igor <at> goryachev.org>
To: 72508 <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH v2 5/5] gnu: erlang: Update to 27.0.1.
Date: Wed,  7 Aug 2024 19:32:13 +0300
* gnu/packages/erlang.scm (erlang): Update to 27.0.1.

Change-Id: Ic603c441cc304ef460e2559c57d765d7e499aad5
---
 gnu/packages/erlang.scm | 74 ++++++++++++++++++++++-------------------
 1 file changed, 39 insertions(+), 35 deletions(-)

diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 80ec673a56..175bbdf8a5 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -49,7 +49,7 @@ (define-module (gnu packages erlang)
 (define-public erlang
   (package
     (name "erlang")
-    (version "26.2.5")
+    (version "27.0.1")
     (source (origin
               (method git-fetch)
               ;; The tarball from http://erlang.org/download contains many
@@ -61,7 +61,7 @@ (define-public erlang
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0hd4flm9x8254rcv8hj0hra5lh5n51vcpharxy2d1ph8059vfsmx"))
+                "1gzlvbbc1zm87910pnhi94mcpag1zxylhy7m2g4vhlmclyir7gd1"))
               (patches (search-patches "erlang-man-path.patch"))))
     (build-system gnu-build-system)
     (native-inputs
@@ -69,13 +69,17 @@ (define-public erlang
 
        ;; Erlang's documentation is distributed in a separate tarball.
        ("erlang-manpages"
-        ,(origin
-           (method url-fetch)
-           (uri (string-append "https://github.com/erlang/otp/releases/download"
-                               "/OTP-" version "/otp_doc_man_" version ".tar.gz"))
-           (sha256
-            (base32
-             "08ngil8578asjzmqa657l4zdy0cr0h9spkg88wp9kxl95bfyli8p"))))))
+        ;; Manpages tarball is not released for 27.0.1, so we take it from the
+        ;; previous version. Details:
+        ;; https://erlangforums.com/t/patch-package-otp-27-0-1-released/3824/4
+        ,(let ((version "27.0"))
+           (origin
+             (method url-fetch)
+             (uri (string-append "https://github.com/erlang/otp/releases/download"
+                                 "/OTP-" version "/otp_doc_man_" version ".tar.gz"))
+             (sha256
+              (base32
+               "0f3w2152090860aci4a38d1bd19c5sslbwadwxc7sjza487fm8lm")))))))
     (inputs
      (list ncurses openssl wxwidgets))
     (propagated-inputs
@@ -84,6 +88,7 @@ (define-public erlang
      `(#:test-target "release_tests"
        #:configure-flags
        (list "--disable-saved-compile-time"
+             "--enable-deterministic-build"
              "--enable-dynamic-ssl-lib"
              "--enable-native-libs"
              "--enable-shared-zlib"
@@ -106,34 +111,22 @@ (define-public erlang
                     (time-utc->date
                      (make-time time-utc 0 (string->number
                                             (getenv "SOURCE_DATE_EPOCH"))))))
-               (substitute* "lib/reltool/src/reltool_target.erl"
-                 (("Date = date\\(\\),")
-                  (string-append "Date = "
-                                 (date->string source-date-epoch
-                                               "'{~Y,~m,~d}',"))))
-               (substitute* "lib/reltool/src/reltool_target.erl"
-                 (("Time = time\\(\\),")
-                  (string-append "Time = "
-                                 (date->string source-date-epoch
-                                               "'{~H,~M,~S}',"))))
-               (substitute* '("lib/reltool/src/reltool_target.erl"
-                              "lib/sasl/src/systools_make.erl")
-                 (("date\\(\\), time\\(\\),")
-                  (date->string source-date-epoch
-                                "{~Y,~m,~d}, {~H,~M,~S},")))
                (substitute* "lib/dialyzer/test/small_SUITE_data/src/gs_make.erl"
                  (("tuple_to_list\\(date\\(\\)\\),tuple_to_list\\(time\\(\\)\\)")
                   (date->string
                    source-date-epoch
-                   "tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})")))
-               (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
-                 (("\\{Y,Mo,D\\} = date\\(\\),")
-                  (date->string source-date-epoch
-                                "{Y,Mo,D} = {~Y,~m,~d},")))
-               (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
-                 (("\\{H,Mi,S\\} = time\\(\\),")
-                  (date->string source-date-epoch
-                                "{H,Mi,S} = {~H,~M,~S},"))))))
+                   "tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})"))))))
+         ;; When compiling with 'deterministic' option the important meta
+         ;; information is still needed for some Erlang's dependants, such as
+         ;; Elixir. We make compiler to preserve it.
+         ;; For more info see: https://github.com/erlang/otp/issues/8602
+         (add-after 'unpack 'preserve-source-meta
+           (lambda _
+             (substitute* "lib/compiler/src/compile.erl"
+               (("\\[\\{source,Source\\} \\| Info0\\];")
+                "[{source,Source} | Info0];
+                 [_|_] = Source when IsDeterministic ->
+                 [{source,Source} | Info0];"))))
          (add-after 'unpack 'patch-/bin/sh
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((sh (search-input-file inputs "/bin/sh")))
@@ -160,10 +153,21 @@ (define-public erlang
                         "lib/reltool/examples/display_args"
                         "lib/reltool/examples/mnesia_core_dump_viewer"
                         "lib/snmp/src/compile/snmpc.src"
-                        "make/verify_runtime_dependencies"
-                        "make/emd2exml.in"))))
+                        "make/verify_runtime_dependencies"))))
                (substitute* escripts
                  (("/usr/bin/env") (which "env"))))))
+         ;; Copy modified compiler to bootstrap. It is deterministic, but
+         ;; preserves 'source' meta information to be used by dependants
+         ;; of Erlang.
+         (add-after 'build 'copy-modified-compiler
+           (lambda _
+             (copy-recursively "lib/compiler/ebin/compile.beam"
+                               "bootstrap/lib/compiler/ebin/compile.beam")))
+         ;; ... clean everything and rebuild with modified bootstrap.
+         (add-after 'copy-modified-compiler 'clean-and-make-again
+           (lambda _
+             (invoke "make" "clean")
+             (invoke "make")))
          (add-before 'configure 'set-erl-top
            (lambda _
              (setenv "ERL_TOP" (getcwd))))
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72508; Package guix-patches. (Fri, 09 Aug 2024 01:02:02 GMT) Full text and rfc822 format available.

Message #44 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Igor Goryachev via Guix-patches via <guix-patches <at> gnu.org>,
 72508-done <at> debbugs.gnu.org
Cc: Igor Goryachev <igor <at> goryachev.org>
Subject: Re: [bug#72508] [PATCH 0/5] Erlang update to 27.0.1.
Date: Fri, 09 Aug 2024 05:01:09 +0400
[Message part 1 (text/plain, inline)]
On 2024-08-07 11:10, Igor Goryachev via Guix-patches via wrote:

> Erlang package was cleaned up, updated to version 27.0.1 and several fixes/hacks were performed to make it deterministic by modifying its bootstrap.
>
> Igor Goryachev (5):
>   gnu: erlang-jsx: Fix tests under Erlang 27+.
>   gnu: erlang-yamerl: Update to 0.10.0.a24f448.
>   gnu: erlang-jose: Relax build options.
>   gnu: ejabberd: Include jiffy dependence under Erlang 27.
>   gnu: erlang: Update to 27.0.1.
>
>  gnu/packages/erlang-xyz.scm | 12 +++++
>  gnu/packages/erlang.scm     | 91 +++++++++++++++++++++----------------
>  gnu/packages/messaging.scm  |  3 ++
>  3 files changed, 68 insertions(+), 38 deletions(-)
>
>
> base-commit: 5e567587dd4abf51f9a6fa44f5a852dde1115ce9

Applied, pushed as
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=20dbf225f3

Thank you for keeping erlang uptodate! :)

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Reply sent to Andrew Tropin <andrew <at> trop.in>:
You have taken responsibility. (Fri, 09 Aug 2024 01:02:02 GMT) Full text and rfc822 format available.

Notification sent to Igor Goryachev <igor <at> goryachev.org>:
bug acknowledged by developer. (Fri, 09 Aug 2024 01:02:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 Sep 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.