[PATCH v2] gnu: erlang-lfe: Make LFE compiler deterministic.

  • Done
  • quality assurance status badge
Details
2 participants
  • Andrew Tropin
  • Igor Goryachev
Owner
unassigned
Submitted by
Igor Goryachev
Severity
normal

Debbugs page

Igor Goryachev wrote 8 months ago
(address . guix-patches@gnu.org)
8a8d2696560e1dfb51d106a1c5e7c9034a5e5c39.1719924375.git.igor@goryachev.org
* gnu/packages/erlang.scm (erlang-lfe): Make LFE compiler deterministic.

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

Toggle diff (22 lines)
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index dd07c1a617..a236722474 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -792,6 +792,13 @@ (define-public erlang-lfe
#:phases
#~(modify-phases %standard-phases
(delete 'configure)
+ ;; By default LFE compiler itself is not deterministic. We fix it
+ ;; here. For more details see: https://github.com/lfe/lfe/issues/492.
+ (add-after 'unpack 'make-deterministic
+ (lambda _
+ (substitute* "src/lfe_env.erl"
+ (("maps:fold\\(F, A, D\\)")
+ "lists:sort(maps:fold(F, A, D))"))))
;; The following is inspired by rebar-build-system.scm
(add-before 'check 'erlang-depends
(lambda* (#:key inputs #:allow-other-keys)

base-commit: 4b3a553ca5ba5ac190739309eb5f7aa8170cf2a8
--
2.45.2
Andrew Tropin wrote 8 months ago
(name . Igor Goryachev)(address . igor@goryachev.org)
87tth7nocu.fsf@trop.in
On 2024-07-02 15:46, Igor Goryachev via Guix-patches via wrote:

Toggle quote (28 lines)
> * gnu/packages/erlang.scm (erlang-lfe): Make LFE compiler deterministic.
>
> Change-Id: I0cf00eeda8502384b746795802f1b2291d0e8a3b
> ---
> gnu/packages/erlang.scm | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
> index dd07c1a617..a236722474 100644
> --- a/gnu/packages/erlang.scm
> +++ b/gnu/packages/erlang.scm
> @@ -792,6 +792,13 @@ (define-public erlang-lfe
> #:phases
> #~(modify-phases %standard-phases
> (delete 'configure)
> + ;; By default LFE compiler itself is not deterministic. We fix it
> + ;; here. For more details see: https://github.com/lfe/lfe/issues/492.
> + (add-after 'unpack 'make-deterministic
> + (lambda _
> + (substitute* "src/lfe_env.erl"
> + (("maps:fold\\(F, A, D\\)")
> + "lists:sort(maps:fold(F, A, D))"))))
> ;; The following is inspired by rebar-build-system.scm
> (add-before 'check 'erlang-depends
> (lambda* (#:key inputs #:allow-other-keys)
>
> base-commit: 4b3a553ca5ba5ac190739309eb5f7aa8170cf2a8

Thank you for making guix even more reproducible :)

Applied, pushed as

--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmaExfEACgkQIgjSCVjB
3rCRcw//etikTt5ox0fhMaAwpeZKbLY9M51pZI3/rBaD5s6q+PrDKhqxPQkNTTL5
Em3NQcT9M3AklgA9iufREulYTKqohwFJ3mtBnUWdqL5U6h5FtwikZFu5jFE3yXTp
vYrRWMbb+C3oFdwOKUh6m22sXNn//odikhCCZhBrugcmjuXYP5qLeV+NPeceATNa
4PzfinU5hglwDSbJxYtTB3LJBOHBwnLpmzyle7UiVHzQ1KVPf70RRyvIWb+4q7Qd
eR8v26iKXUtgJLkDbOp+KJ4a/LOA+5Xp4wdn6OIicDCQM+AavZOjHtXr5MYHBROm
qIp+ihagfWrdFFZePYE+gzbQIyrMSpGd48IHBa/JqViorVmCgxIP0ugmDVZP0lFo
LtvPlaC/SGVpasRC5ZhXUW7O9jVAxXW++3h4sFwMrK2+XmDD0hBbG+EASOBu6ncV
FGSlCx+1jYmacQc9XivEaximvRUbPAA3YpupRv2KFDQ7BgrjOvZoZ0FAa1meb+dT
4yAZU7BDI83cvyaReO3fFc+rzxpwEDWytkYnCAlFZtOj9PNlVz3aMAq+OSmVybCh
V3BBpGf8s9aNCnBWahBU23SKw/V/QiIMZ+mFHXRVWe8VvQSO9moSzk+arBHvIXUC
vAffUqS4fNm+c3Xym8tzNJbBi61FT/kWWjKn1HHKfkarhXvb3Ow=
=Fs6T
-----END PGP SIGNATURE-----

?
Your comment

This issue is archived.

To comment on this conversation send an email to 71899@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71899
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help