diff mbox series

[bug#55248,v2,2/9] gnu: racket: Fix out-of-source build.

Message ID 63d9ad60e39d8315f493b0ca49517f21fb320575.1652039837.git.philip@philipmcgrath.com
State Accepted
Headers show
Series gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Philip McGrath May 8, 2022, 8:07 p.m. UTC
* gnu/packages/racket.scm (racket-vm-cgc)[arguments]: Add phase
'symlink-license-src' to work around limitation in
'install-license-files'. Supply '#:out-of-source? #t'.
---
 gnu/packages/racket.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

Comments

Liliana Marie Prikler May 9, 2022, 3:54 a.m. UTC | #1
Hi Philip,

Correct me if I'm wrong, but I think you didn't quite get the point I
raised w.r.t. install-license-files.  Instead of

Am Sonntag, dem 08.05.2022 um 16:07 -0400 schrieb Philip McGrath:
> +           (add-after 'chdir 'symlink-license-src
> +             ;; Work around limitation of install-license-files by
> symlinking
> +             ;; srcdir where it expects.  (It doesn't handle this
> variant of
> +             ;; #:out-of-source? and a subdirectory for srcdir.) 
> Just running
> +             ;; `make install` only puts them in Racket's 'share-
> dir'.
> +             (lambda* (#:key out-of-source? #:allow-other-keys)
> +               (when out-of-source?
> +                 (with-directory-excursion ".."
> +                   (symlink "src"
> +                            (package-name->name+version
> +                             (strip-store-file-name
> #$output))))))))))
you could 

(replace 'install-license-files
  (lambda args
    (with-directory-excursion ".." ; perhaps "../src" if needed
      (apply (assoc-ref %standard-phases 'install-license-files)
             args))))

If that doesn't work, you could fake an "in-source" build by appending
"#:out-of-source? #f" to args.

Cheers
Ludovic Courtès May 9, 2022, 9:44 a.m. UTC | #2
Hi Philip,

Philip McGrath <philip@philipmcgrath.com> skribis:

>   gnu: racket: Update to 8.5.
>   gnu: racket: Fix out-of-source build.
>   gnu: chez-scheme: Update to 9.5.8.
>   gnu: chez-scheme: Refactor documentation phases.
>   gnu: chez-scheme: Refactor configure phase and fix '--threads'.
>   gnu: stex: Get machine type dynamically.
>   gnu: chez-upstream-features-for-system: Improve implementation.
>   gnu: chez-scheme-for-racket: Fix supported systems.
>   gnu: chez-scheme-for-system: Adjust for bytecode backend.

I applied the whole series (great work!), but stumbled upon this:

--8<---------------cut here---------------start------------->8---
r:sha256 hash mismatch for /gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout:
  expected hash: 0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi
  actual hash:   0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx
hash mismatch for store item '/gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout'
build of /gnu/store/xsbp1m2bh5wn4h0pxc7rr5pz4w88jfns-racket-gui-8.5-checkout.drv failed
--8<---------------cut here---------------end--------------->8---

Could it be that the v8.5 tag on that repo was modified in place?

You can resent just this one patch if you want, if it’s just a matter of
changing the hash.

Thanks,
Ludo’.
Philip McGrath May 12, 2022, 3:50 a.m. UTC | #3
Hi,

On 5/9/22 05:44, Ludovic Courtès wrote:
> Hi Philip,
> 
> Philip McGrath <philip@philipmcgrath.com> skribis:
> 
>>    gnu: racket: Update to 8.5.
>>    gnu: racket: Fix out-of-source build.
>>    gnu: chez-scheme: Update to 9.5.8.
>>    gnu: chez-scheme: Refactor documentation phases.
>>    gnu: chez-scheme: Refactor configure phase and fix '--threads'.
>>    gnu: stex: Get machine type dynamically.
>>    gnu: chez-upstream-features-for-system: Improve implementation.
>>    gnu: chez-scheme-for-racket: Fix supported systems.
>>    gnu: chez-scheme-for-system: Adjust for bytecode backend.
> 
> I applied the whole series (great work!), but stumbled upon this:
> 
> --8<---------------cut here---------------start------------->8---
> r:sha256 hash mismatch for /gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout:
>    expected hash: 0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi
>    actual hash:   0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx
> hash mismatch for store item '/gnu/store/mipblqr29m18gvcmqp5j5s3aj5jknchy-racket-gui-8.5-checkout'
> build of /gnu/store/xsbp1m2bh5wn4h0pxc7rr5pz4w88jfns-racket-gui-8.5-checkout.drv failed
> --8<---------------cut here---------------end--------------->8---
> 
> Could it be that the v8.5 tag on that repo was modified in place?
> 
> You can resent just this one patch if you want, if it’s just a matter of
> changing the hash.
> 

Thanks for finding this! I will send the single revised patch in a 
separate email. The hashes for the "gui", "htdp", "redex", 
"typed-racket", "string-constants", and "syntax-color" origins needed to 
be updated.

The v8.5 tags were not modified, but it looks like the v8.5 tags for 
those repositories included additional commits added after the first 
release candidate, which I had built early on. (The tag is created only 
when the release is actually released.) My best guess is that, somewhere 
in the process of amending this patch series, I had done a build with 
the commit and checksum for the first release candidate, but with the 
origin file name as though it were the 8.5 release. When I then changed 
these origins to point at the tag, I must not have changed the hashes, 
and I guess Guix saw that it already had store items with the correct 
name and hash and didn't try to download them again.

I confirmed that this works by building on a computer where I hadn't 
built any of the earlier versions of this series (which took a little 
bit to set up).

I'm not sure if there's a better way to prevent or check for this sort 
of problem in general.

Just to be extra explicit, here's the diff between v3 and what I'm about 
to send as v4 1/9:

> diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
> index 1f020f1276..c4183be210 100644
> --- a/gnu/packages/racket.scm
> +++ b/gnu/packages/racket.scm
> @@ -686,13 +686,13 @@ (define-public racket
>         "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d")
>         '(("games" ".")))
>        (simple-racket-origin
> -       "gui" (base32 "0hqryw3md67j5z4d6bv5qx75w8z1vjxfixabf2xq9bj6k43yzzmi")
> +       "gui" (base32 "0r3ck4gxdhnzr1a1fi0f1i7gwfip7akq10qgcxza66pp57hnl0wx")
>         '("gui" "gui-doc" "gui-lib" "tex-table"))
>        (simple-racket-origin
>         "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5")
>         '("gui-pkg-manager-lib"))
>        (simple-racket-origin
> -       "htdp" (base32 "199qchdq6db6m2n4j861hiy4nxd6hg1qva16lhhdbfj274qmcplg")
> +       "htdp" (base32 "19xqixrqbwdxph17w9jga19008j88harb5wgml4hpqj3x0apx9g3")
>         '("htdp" "htdp-doc" "htdp-lib"))
>        (simple-racket-origin
>         "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x")
> @@ -830,7 +830,7 @@ (define-public racket
>         "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi")
>         '(("realm" ".")))
>        (simple-racket-origin
> -       "redex" (base32 "0a1fl5s80k3j3xh3lri8886ql443m7pmgv18y7whzlmsd7x8rdpr")
> +       "redex" (base32 "18rn8ddsqh1s7hdlb2cb9wxln63bz0wysjssaf9v92r712xnnv8i")
>         '("redex"
>           "redex-benchmark"
>           "redex-doc"
> @@ -877,7 +877,7 @@ (define-public racket
>         "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj")
>         '("snip" "snip-lib"))
>        (simple-racket-origin
> -       "typed-racket" (base32 "05xlyjrx3m8xrrrw1xmfb1807qa5aqfl0zp9bdxwh2z7cfxaii09")
> +       "typed-racket" (base32 "0z6bagp6qiw0i3slhvq035y5hqgq664xw3bdlvdayad0bgbg0mdc")
>         '("source-syntax"
>           "typed-racket"
>           "typed-racket-compatibility"
> @@ -888,13 +888,13 @@ (define-public racket
>         "srfi" (base32 "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")
>         '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib"))
>        (simple-racket-origin
> -       "string-constants" (base32 "1rjs0gyw9hsiglwxnimz272v9xj1gwjxrnzh4qbsxkvdaphvi38m")
> +       "string-constants" (base32 "0b1ji31pv6bjb0a2bh9sqp5abvf91gn2rai8r4c4nkar1fzfwfac")
>         '("string-constants" "string-constants-doc" "string-constants-lib"))
>        (simple-racket-origin
>         "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67")
>         '(("swindle" ".")))
>        (simple-racket-origin
> -       "syntax-color" (base32 "1xf3rl8687c1nar4kkgkvyncwi0gl696rif0iqhffg730fk457gi")
> +       "syntax-color" (base32 "17lb2403ymz6sflw4vs3gsh2y7kgsf0gn8sncsxjhi16rpj3a9vm")
>         '("syntax-color" "syntax-color-doc" "syntax-color-lib"))
>        (simple-racket-origin
>         "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia")

-Philip
Ludovic Courtès May 12, 2022, 10:32 a.m. UTC | #4
Hello,

Philip McGrath <philip@philipmcgrath.com> skribis:

>   gnu: racket: Update to 8.5.
>   gnu: racket: Fix out-of-source build.
>   gnu: chez-scheme: Update to 9.5.8.
>   gnu: chez-scheme: Refactor documentation phases.
>   gnu: chez-scheme: Refactor configure phase and fix '--threads'.
>   gnu: stex: Get machine type dynamically.
>   gnu: chez-upstream-features-for-system: Improve implementation.
>   gnu: chez-scheme-for-racket: Fix supported systems.
>   gnu: chez-scheme-for-system: Adjust for bytecode backend.

Pushed the whole series (including v4 for the first patch) as
3547bb6a66c32eb1deac46a98b40e2e051689ed3.  It seems to work like a
charm.  :-)

Thanks!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 7d51707156..904dfe9bef 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -276,8 +276,9 @@  (define-public racket-vm-cgc
        ;; main-distribution-test that aren't part of the main
        ;; distribution.
        #:tests? #f
-       ;; Upstream recommends #:out-of-source?, and it does
-       ;; help with debugging, but it confuses `install-license-files`.
+       ;; Upstream recommends #:out-of-source?, and it
+       ;; helps a lot with debugging.
+       #:out-of-source? #t
        #:modules '((ice-9 match)
                    (ice-9 regex)
                    (guix build gnu-build-system)
@@ -314,7 +315,18 @@  (define-public racket-vm-cgc
                                 #f)))))))
            (add-before 'configure 'chdir
              (lambda _
-               (chdir "racket/src"))))))
+               (chdir "racket/src")))
+           (add-after 'chdir 'symlink-license-src
+             ;; Work around limitation of install-license-files by symlinking
+             ;; srcdir where it expects.  (It doesn't handle this variant of
+             ;; #:out-of-source? and a subdirectory for srcdir.)  Just running
+             ;; `make install` only puts them in Racket's 'share-dir'.
+             (lambda* (#:key out-of-source? #:allow-other-keys)
+               (when out-of-source?
+                 (with-directory-excursion ".."
+                   (symlink "src"
+                            (package-name->name+version
+                             (strip-store-file-name #$output))))))))))
      (home-page "https://racket-lang.org")
      (synopsis "Old Racket implementation used for bootstrapping")
      (description "This variant of the Racket BC (``before Chez'' or