diff mbox series

[bug#47615,v2,02/12] gnu: guile-3.0: Fix building on powerpc-linux.

Message ID 007143fda1cfa0d5e6625158a94ea4e48b79a790.1619076704.git.efraim@flashner.co.il
State Accepted
Headers show
Series Add 32-bit powerpc support | 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

Efraim Flashner April 22, 2021, 7:59 a.m. UTC
* gnu/packages/guile.scm (guile-3.0)[arguments]: On powerpc add two
phases to adjust for 32-bit big-endian systems.
---
 gnu/packages/guile.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

This patch has the comments updated. I reported my findings to the guile
debbugs email and Other People™ are testing the changes on the other
architectures. Otherwise patch unchanged.

Comments

Ludovic Courtès May 6, 2021, 2:45 p.m. UTC | #1
Efraim Flashner <efraim@flashner.co.il> skribis:

> * gnu/packages/guile.scm (guile-3.0)[arguments]: On powerpc add two
> phases to adjust for 32-bit big-endian systems.

[...]

> +                 (add-after 'unpack 'adjust-bootstrap-flags
> +                   (lambda _
> +                     ;; Upstream knows about suggested solution.
> +                     ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214

The first comment line should preferably mention the problem, like:

  ;; Change optimization flags to work around crash on
  ;; 32-bit big-endian architectures: <https://bugs.gnu.org/45214>.

> +                     (substitute* "bootstrap/Makefile.in"
> +                       (("^GUILE_OPTIMIZATIONS.*")
> +                        "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
> +                 (add-after 'unpack 'remove-failing-tests
> +                   (lambda _
> +                     ;; TODO: Discover why this test fails on powerpc-linux
> +                     (delete-file "test-suite/standalone/test-out-of-memory"))))))

I’m surprised removing the executable works.  See
‘guile-2.2-skip-oom-test.patch’.

Ludo’.
Efraim Flashner May 10, 2021, 8:01 a.m. UTC | #2
On Thu, May 06, 2021 at 04:45:30PM +0200, Ludovic Courtès wrote:
> Efraim Flashner <efraim@flashner.co.il> skribis:
> 
> > * gnu/packages/guile.scm (guile-3.0)[arguments]: On powerpc add two
> > phases to adjust for 32-bit big-endian systems.
> 
> [...]
> 
> > +                 (add-after 'unpack 'adjust-bootstrap-flags
> > +                   (lambda _
> > +                     ;; Upstream knows about suggested solution.
> > +                     ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
> 
> The first comment line should preferably mention the problem, like:
> 
>   ;; Change optimization flags to work around crash on
>   ;; 32-bit big-endian architectures: <https://bugs.gnu.org/45214>.
> 
> > +                     (substitute* "bootstrap/Makefile.in"
> > +                       (("^GUILE_OPTIMIZATIONS.*")
> > +                        "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
> > +                 (add-after 'unpack 'remove-failing-tests
> > +                   (lambda _
> > +                     ;; TODO: Discover why this test fails on powerpc-linux
> > +                     (delete-file "test-suite/standalone/test-out-of-memory"))))))
> 
> I’m surprised removing the executable works.  See
> ‘guile-2.2-skip-oom-test.patch’.

I took another look at it and I'm building 3.0.5 again but with
the 'remove-failing-tests phase removed. We'll find out in about 42
hours if it's needed or not.
diff mbox series

Patch

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index f63322794d..08ad50f7b0 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -305,7 +305,22 @@  without requiring the source code to be rewritten.")
          (substitute-keyword-arguments (package-arguments guile-2.2)
            ((#:configure-flags flags ''())
             `(cons "--disable-jit" ,flags)))
-         (package-arguments guile-2.2)))
+         (if (string-prefix? "powerpc-" (%current-system))
+           (substitute-keyword-arguments (package-arguments guile-2.2)
+             ((#:phases phases)
+              `(modify-phases ,phases
+                 (add-after 'unpack 'adjust-bootstrap-flags
+                   (lambda _
+                     ;; Upstream knows about suggested solution.
+                     ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
+                     (substitute* "bootstrap/Makefile.in"
+                       (("^GUILE_OPTIMIZATIONS.*")
+                        "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
+                 (add-after 'unpack 'remove-failing-tests
+                   (lambda _
+                     ;; TODO: Discover why this test fails on powerpc-linux
+                     (delete-file "test-suite/standalone/test-out-of-memory"))))))
+           (package-arguments guile-2.2))))
     (native-search-paths
      (list (search-path-specification
             (variable "GUILE_LOAD_PATH")