Upgrade Racket to 6.12

  • Done
  • quality assurance status badge
Details
4 participants
  • Christopher Lemmer Webber
  • Danny Milosavljevic
  • Ludovic Courtès
  • Marius Bakke
Owner
unassigned
Submitted by
Christopher Lemmer Webber
Severity
normal
Merged with

Debbugs page

Christopher Lemmer Webber wrote 7 years ago
(address . guix-patches@gnu.org)
87fu5p1v7n.fsf@dustycloud.org
From e5244b9b0cabf9a4e30c3fb5bc144dbea10adc62 Mon Sep 17 00:00:00 2001
From: Christopher Lemmer Webber <cwebber@dustycloud.org>
Date: Sat, 24 Feb 2018 18:36:13 -0600
Subject: [PATCH] gnu: racket: Update to 6.12.

* gnu/packages/patches/racket-minus_zero_p-disable-xform.patch: New file.
* gnu/packages/scheme.scm (racket): Update version and patch.
---
gnu/packages/patches/racket-minus_zero_p-disable-xform.patch | 10 ++++++++++
gnu/packages/scheme.scm | 7 +++++--
2 files changed, 15 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/racket-minus_zero_p-disable-xform.patch

Toggle diff (43 lines)
diff --git a/gnu/packages/patches/racket-minus_zero_p-disable-xform.patch b/gnu/packages/patches/racket-minus_zero_p-disable-xform.patch
new file mode 100644
index 000000000..08887a616
--- /dev/null
+++ b/gnu/packages/patches/racket-minus_zero_p-disable-xform.patch
@@ -0,0 +1,10 @@
+--- a/src/racket/src/number.c 2018-02-24 18:16:32.031698079 -0600
++++ b/src/racket/src/number.c 2018-02-24 18:15:41.055445301 -0600
+@@ -1775,6 +1775,7 @@
+ }
+
+ XFORM_NONGCING static MZ_INLINE int minus_zero_p(double d)
++ XFORM_SKIP_PROC
+ {
+ #ifdef MZ_IS_NEG_ZERO
+ return MZ_IS_NEG_ZERO(d);
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index d5286b312..b4cbb0a8a 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -404,7 +404,7 @@ implementation techniques and as an expository tool.")
(define-public racket
(package
(name "racket")
- (version "6.11")
+ (version "6.12")
(source (origin
(method url-fetch)
(uri (list (string-append "http://mirror.racket-lang.org/installers/"
@@ -414,7 +414,10 @@ implementation techniques and as an expository tool.")
version "/racket-" version "-src.tgz")))
(sha256
(base32
- "1nk7705x24jjlbqqhj8yvbgqkfscxx3m81bry1g56kjxysjmf3sw"))))
+ "0cwcypzjfl9py1s695mhqkiapff7c1w29llsmdj7qgn58wl0apk5"))
+ (patches (search-patches
+ ;; See: https://github.com/racket/racket/issues/1962
+ "racket-minus_zero_p-disable-xform.patch"))))
(build-system gnu-build-system)
(arguments
'(#:phases
--
2.15.1
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEUQqGKOKndniPjHCcS8Alkl/49NMFAlqSTMMACgkQS8Alkl/4
9NNCtxAAtwIYuCaIUJ9a3GsdMfnp+tOx0dZeFLBbPZoIRdwwX0MGqi58ZrlShweG
33V+lecqORAhZqIY2xnlIiR13eeIDy+SFQl60jih9/5GeK2FGFxAqGpLOvdJMzXq
Wc8YNiXQYjOEFCfkfYYQ2fbd+rQpekx2Ocg0ibuO6STB1L/P8H8vANdZ4N+UxJME
s8X55A+EWRobQ5mwfMqEU6zTgR0wFkExgGnL/uwiISklYWCu/Sn6zVmwzOOc3n+3
tEFVODAnup1sr1wbBRtEFx7FYaVyUlPFOXufgKKZpR6zy2l6kxp3oIK296bABaRj
vsGVAnzXbbzVKgjt+IAPfY7Eknpa83S7wLW+bJFKV9AsL1qSFDCugTabZsrCuAzJ
SDu1i9ckHKQfb3Fz47Gqi9H/fzPNjosisHZSc0MlHWM+ImlcV82FqUH8LURMU+pZ
5Z596eBa7CxJpEMFhBh8KSb+mgnQ7QDcM6DT5Z9kWSQz2Xz+FqJAR/Q/jLY4VKB5
gJfFydQODLAq0EaGrlMiMhR7JjKG+A989ztpQADslSoaEJWVIjqLPCRGYyxFqPjB
NRc86QFUXVRLFTyaXWst+PGKpCxcKqPFvfoJTIJuXur7vyNqxnGnzUmp1H3886bF
TuxHcVtZFeZfTYYF1ijFvd4nuQTiL+5TbKN1cfmmJhrSsrjL48E=
=f17G
-----END PGP SIGNATURE-----

Marius Bakke wrote 7 years ago
87606kwnri.fsf@fastmail.com
Christopher Lemmer Webber <cwebber@dustycloud.org> writes:

Toggle quote (8 lines)
> From e5244b9b0cabf9a4e30c3fb5bc144dbea10adc62 Mon Sep 17 00:00:00 2001
> From: Christopher Lemmer Webber <cwebber@dustycloud.org>
> Date: Sat, 24 Feb 2018 18:36:13 -0600
> Subject: [PATCH] gnu: racket: Update to 6.12.
>
> * gnu/packages/patches/racket-minus_zero_p-disable-xform.patch: New file.
> * gnu/packages/scheme.scm (racket): Update version and patch.

LGTM, thanks!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqTYLEACgkQoqBt8qM6
VPrlLwf/XdDco+rcfVPcqQcV5t+aHq1T+JpB7TuNqvXZHc+QsDrHkGpZPQnuc9Kx
YqNY7icR1OaZy8QKaSW8jIUfoddZ5ZdUGZN8wXuDXVSQkovf6jPtCJWibT3Lw7sG
GJJkAmwRBI7Esb/+fhSjtKyMdakLa3OIfgeSu80/Xf7ZvTWXInvhooSi6yp6inVW
lAS6ffLoDm+NG8sKAr2j3yoew4Jd9OPOF/4Zf7ud3X9CjCvcl05a6dRnVC7rMPAH
QUlwJ3Bswutw9QQJ+MGHmKFxVkS1Sz8FD87mWvdRblOrNvky9KSFDyxqO+00e/Ai
rvHDD741eBfVwYx5BIkCI64ixH6Rhg==
=sgEf
-----END PGP SIGNATURE-----

Danny Milosavljevic wrote 7 years ago
(name . Christopher Lemmer Webber)(address . cwebber@dustycloud.org)
20180226051621.05b8dfb4@scratchpost.org
Hmmm... doesn't that break the GC?

I would just remove MZ_IS_NEG_ZERO in the first place. There's a fallback in the caller...

Or use a newer gcc so MZ_IS_NEG_ZERO expands to a builtin.
Christopher Lemmer Webber wrote 7 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87a7vv1ziy.fsf@dustycloud.org
Danny Milosavljevic writes:

Toggle quote (6 lines)
> Hmmm... doesn't that break the GC?
>
> I would just remove MZ_IS_NEG_ZERO in the first place. There's a fallback in the caller...
>
> Or use a newer gcc so MZ_IS_NEG_ZERO expands to a builtin.

Hm, maybe it does break the GC. I actually admittedly have no idea how
the patch I applied "fixes" things... I was just miming the "solution"
in:


I have filed my own issue but have not yet heard back:


Danny, which of the suggestions you made do you think we should do?
Maybe removing MZ_IS_NEG_ZERO is easier? I don't know what implications
there are in bumping up gcc...
Ludovic Courtès wrote 7 years ago
control message for bug #30603
(address . control@debbugs.gnu.org)
87po4q4vtq.fsf@gnu.org
merge 30603 30575
Christopher Lemmer Webber wrote 7 years ago
Re: [bug#30603] Upgrade Racket to 6.12
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 30603@debbugs.gnu.org)
87h8puquih.fsf@dustycloud.org
Christopher Lemmer Webber writes:

Toggle quote (22 lines)
> Danny Milosavljevic writes:
>
>> Hmmm... doesn't that break the GC?
>>
>> I would just remove MZ_IS_NEG_ZERO in the first place. There's a fallback in the caller...
>>
>> Or use a newer gcc so MZ_IS_NEG_ZERO expands to a builtin.
>
> Hm, maybe it does break the GC. I actually admittedly have no idea how
> the patch I applied "fixes" things... I was just miming the "solution"
> in:
>
> https://github.com/racket/racket/issues/464#issuecomment-26626089
>
> I have filed my own issue but have not yet heard back:
>
> https://github.com/racket/racket/issues/1962
>
> Danny, which of the suggestions you made do you think we should do?
> Maybe removing MZ_IS_NEG_ZERO is easier? I don't know what implications
> there are in bumping up gcc...

I just discovered that this doesn't have to do with a new release of
Racket, but some other dependency that Racket must be using (GCC?) that
recently broke our ability to compile Racket, including Racket 6.11, the
current Racket in Guix. I can't build it, and the error is the same
kind of error as what I was getting with 6.12:

Error [GCING] 1780 in ./../src/number.c: Function minus_zero_p declared __xform_nongcing__, but includes a function call at __signbitf128.
Error [GCING] 1958 in ./../src/number.c: Function double_is_integer declared __xform_nongcing__, but includes a function call at __isinff128.
Error [GCING] 4050 in ./../src/number.c: Function double_fits_fixnum declared __xform_nongcing__, but includes a function call at __isinff128.
xform: Errors converting
context...:
/tmp/guix-build-racket-6.11.drv-0/racket-6.11/src/racket/gc2/xform-collects/compiler/private/xfor...:8:2: xform
/tmp/guix-build-racket-6.11.drv-0/racket-6.11/src/racket/gc2/xform-collects/xform/xform-mod.rkt: [running body]
/tmp/guix-build-racket-6.11.drv-0/racket-6.11/src/racket/gc2/xform.rkt:
[running body]
Danny Milosavljevic wrote 7 years ago
(name . Christopher Lemmer Webber)(address . cwebber@dustycloud.org)(address . 30603@debbugs.gnu.org)
20180306100755.632cadc0@scratchpost.org
Hi Christopher,

I don't know how Racket does it but I wrote my own interpreters with GC and there,
you have to know where references to objects can be found.

In this case the references can be on the stack of the C functions as long as
they are running.

It turns out that in the version of gcc we use to compile racket, the sign checker
for 128 bit floats (__signbitf128) is not a builtin (it's not emitting just an immediate
assembly instruction) but rather is a C function - but the caller in Racket is marked
as "don't bother looking for object references in there". As Racket supports
arbitrary-precision numbers, a number might be an object and a part of that object
might have been passed to __signbitf128. If the GC runs, it might be killing
that object while it's still used inside __signbitf128 (in a loop or something).

So the possible fixes are:

(1) Do not use __signbitf128 (that is, "signbit") - there's a fallback which uses
primitive operations that are guaranteed to be builtin (/). That's the non-invasive
very safe change (s|MZ_IS_NEG_ZERO|MZ_IS_NEG_ZERO_DONOTUSE| at one place) - since
from the outside the function would look exactly the same as if it used
__signbitf128 - it's a leaf.

(2) Remove the nogcing marker. That's the more invasive change which slightly
changes how the GC root set looks - it should be safe enough anyway (if there
are no bugs in the GC root set lookup :) )

(3) Use gcc-7. Given that Racket users probably use FFI to load other C libraries
which aren't compiled with gcc-7, let's not do that.

Please note that I didn't write Racket so take it with a grain of salt.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlqeWmsACgkQ5xo1VCww
uqW7sAgAgexymcs7m69c4jbM+fG0hWYOitCDPI95NQaqXzrmMOTQgvYp0PHKUMf/
HCMumIcVLFF1QHU/72IKLvPJmgafQ3jRAxul6M6HOFG9W54hOB9KidtEf6Aht7mB
D4dvwE+HiEjsrQRjc6e2sR1rChQLjxPFjrgchtBF6GxvcBxSzFl+J4k8m8WOGYxf
TI1EEcZQLDL0c5tXUpRZt/7K+bkpgg+Zz+yjJ0u8V3wZtdaqJuT0FJs+nuO9QYgO
+gEQde/ukl7u+Cm3r6K/i1Tky9n+WC/0LF7pYxE4FwxticvJk/7Sutg7s0O9bnYI
jzUVnGOpgedlCSr4nyoMwfO1GCJo6Q==
=1iBx
-----END PGP SIGNATURE-----


Christopher Lemmer Webber wrote 7 years ago
(address . 30603@debbugs.gnu.org)
87fu4fkpq0.fsf@dustycloud.org
Okay... I worked upstream, and here's the upstream patch. If accepted
this also closes out bug#30714.

I've done this as two separate patches (one with my original patch and
then one with the suggested update from upstream) because the patch
doesn't apply automatically pre- 6.12 anyway, so it makes sense to patch
with the minimalist patch, and then with the full fix.
From c4fca9eeb60ee4e2934e89e13054bf1338d1bb4a Mon Sep 17 00:00:00 2001
From: Christopher Lemmer Webber <cwebber@dustycloud.org>
Date: Sat, 24 Feb 2018 18:36:13 -0600
Subject: [PATCH 1/2] gnu: racket: Update to 6.12.

* gnu/packages/patches/racket-minus_zero_p-disable-xform.patch: New file.
* gnu/packages/scheme.scm (racket): Update version and patch.
---
gnu/packages/patches/racket-minus_zero_p-disable-xform.patch | 10 ++++++++++
gnu/packages/scheme.scm | 7 +++++--
2 files changed, 15 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/racket-minus_zero_p-disable-xform.patch

Toggle diff (43 lines)
diff --git a/gnu/packages/patches/racket-minus_zero_p-disable-xform.patch b/gnu/packages/patches/racket-minus_zero_p-disable-xform.patch
new file mode 100644
index 000000000..08887a616
--- /dev/null
+++ b/gnu/packages/patches/racket-minus_zero_p-disable-xform.patch
@@ -0,0 +1,10 @@
+--- a/src/racket/src/number.c 2018-02-24 18:16:32.031698079 -0600
++++ b/src/racket/src/number.c 2018-02-24 18:15:41.055445301 -0600
+@@ -1775,6 +1775,7 @@
+ }
+
+ XFORM_NONGCING static MZ_INLINE int minus_zero_p(double d)
++ XFORM_SKIP_PROC
+ {
+ #ifdef MZ_IS_NEG_ZERO
+ return MZ_IS_NEG_ZERO(d);
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 37593fe30..d89b123f1 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -405,7 +405,7 @@ implementation techniques and as an expository tool.")
(define-public racket
(package
(name "racket")
- (version "6.11")
+ (version "6.12")
(source (origin
(method url-fetch)
(uri (list (string-append "http://mirror.racket-lang.org/installers/"
@@ -415,7 +415,10 @@ implementation techniques and as an expository tool.")
version "/racket-" version "-src.tgz")))
(sha256
(base32
- "1nk7705x24jjlbqqhj8yvbgqkfscxx3m81bry1g56kjxysjmf3sw"))))
+ "0cwcypzjfl9py1s695mhqkiapff7c1w29llsmdj7qgn58wl0apk5"))
+ (patches (search-patches
+ ;; See: https://github.com/racket/racket/issues/1962
+ "racket-minus_zero_p-disable-xform.patch"))))
(build-system gnu-build-system)
(arguments
'(#:phases
--
2.15.1
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEUQqGKOKndniPjHCcS8Alkl/49NMFAlrA4cgACgkQS8Alkl/4
9NO/Jg/+JrEnhRksiRkKS0eYIu7KiCD3xsMjUxkTAOsH/ZnRbEEgQ8DKtn7KlNNJ
IGTLwV36X2ULZeD6V6EyWb517WxVGEOAmoOPvoN2qJlZ1vJhd7smJEZvLkqrc5tY
KgUdlY5BFFZGqcAJZJcNMuYp4Pvup4pG9ZbxuAco//KTCBKzSuJ+V2fRg3Y0p6U/
mm9qXR9cPBrTuP0qol7OZ5csGEV6RvJvFXLDss5hacbPFxdBEl9wqo+7om4Gt1mY
jbJDL2PpQyasxyy4KRqyA/SFvP2QgewGmyGrBhj2FFzLr1Xw5WKMnaSqCi2Idz4Q
qnKXLeIC3Xh0ksBPCY1EHFGi8uHawweiSsuiAOr0BSxbR5uNqz75iqcDQnOx5fbQ
3ECrdEdaF2x/0wabzwpB+7yccCGPvJ/YWkSSvPQ2dzbdanrp76se62COS/X8mYot
0bAexgUlYPe8GL8GAjm0aic/BM2DcdtYc5aOPtyH3GyphpfZVLOqq3CX7LwhCHBu
i+u9ciDf9qQ2rxZPoeaHLh14N0DKW1ymnsEatXbOk+GYrDTciSOMykzJtMTpLP2B
EC66UzAtCrPKOo1hLnMRiVxmQeis9iPz52WamPBB/HZiuPRNr7LQ9/DG8xa49cJK
58CIefi4LESU/a1LAtvh6Qwzn2AmxUYDPdCED9Jc2gsAzRYMdSU=
=ZHAI
-----END PGP SIGNATURE-----

Danny Milosavljevic wrote 7 years ago
(name . Christopher Lemmer Webber)(address . cwebber@dustycloud.org)(address . 30603@debbugs.gnu.org)
20180401231115.25c49746@scratchpost.org
LGTM.

Thanks!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlrBSvMACgkQ5xo1VCww
uqUa+ggApRQKcnV/48A0ejQpGJn6ZMyRo4Bv5jR1Yq5Y1xBDsrOJEa1ffAGg3Gpm
Oxg/Woz9/CNeV20EGhViRBCG18mgVaG0miYZx8WqYBxiH9siY1otTCVPF4d2+DCi
66a0QrRvzjrvP92xYW3SJTAb74TkvICeTlotq4cslhCModamJ3MO65ZA96OGdn68
tr+HMvt7Ht8lMC3Hnh4M9/ktIh2RT1g0YNJhlo3JkD9G74pUc8iiplXlRNgMVev4
b2xn0rUSXyvmNVmzsCd7rNjDG39zuKaGpRheN8JetLKPkO5d+AFymBGZgnJfwddG
H95M7gJyNXDACIVOt8wi/p9y8hzuJg==
=JfaG
-----END PGP SIGNATURE-----


Christopher Lemmer Webber wrote 7 years ago
Re: bug#30714: Racket doesn't build any more, xform error
87d0zhlir7.fsf@dustycloud.org
Fixed bugs #30714 and #30603 in 75afbd247876d62f27cb2c90098bd59040f7e614
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 30603
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