Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 865311 - dev-lang/ghc-9.0.2[-ghcbootstrap]: Build with default USE flags fails on ppc64
Summary: dev-lang/ghc-9.0.2[-ghcbootstrap]: Build with default USE flags fails on ppc64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-08-15 19:50 UTC by Marcus Comstedt
Modified: 2022-08-21 02:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Complete build log (build.log,2.17 KB, text/plain)
2022-08-15 19:50 UTC, Marcus Comstedt
Details
Debian patch needed for ghc to work correctly on big endian (Disable-unboxed-arrays.patch,456 bytes, patch)
2022-08-15 19:53 UTC, Marcus Comstedt
Details | Diff
Output from emerge --info (emerge.info,6.19 KB, text/plain)
2022-08-15 19:54 UTC, Marcus Comstedt
Details
Upstreams patch for unboxed containers issue (disable-unboxed-containers-on-big-endian.patch,1.14 KB, patch)
2022-08-16 07:11 UTC, Marcus Comstedt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Comstedt 2022-08-15 19:50:03 UTC
When building with default USE flags, the build crashes with the error

sed: can't read /tmp/portage/dev-lang/ghc-9.0.2/work/usr/bin/ghc-9.0.2: No such file or directory

However, if setting USE=ghcbootstrap the ebuild builds fine, with the caveat that the Debian patch "Disable-unboxed-arrays.patch" is still needed.  I used dev-lang/ghc-9.0.1-r1 as the system compiler for bootstrapping.

Previous ghc ebuilds (which were not keyworded for ppc64) displayed a message
requesting the user to enable USE=ghcbootstrap and report success to
haskell@gentoo.org instead of crashing.

My offer to provide binpkgs that I made last year when reporting bootstrap
success for ghc-9.0.1-r1 still stands.  :-)

Reproducible: Always

Steps to Reproduce:
1.On a ppc64 system (big endian profile)
2.emerge =dev-lang/ghc-9.0.2
3.
Actual Results:  
src_prepare bombs out with "No such file or directory"

Expected Results:  
Preferably that the build succeeds, but failing that a message to enable
ghcbootstrap like in previous ebuilds would have been preferable.
Comment 1 Marcus Comstedt 2022-08-15 19:50:45 UTC
Created attachment 799795 [details]
Complete build log
Comment 2 Marcus Comstedt 2022-08-15 19:53:30 UTC
Created attachment 799797 [details, diff]
Debian patch needed for ghc to work correctly on big endian

This patch does not fix the "no such file or directory" problem, but it is
needed to get a working ghc.  In upstreams head, there is a workaround in
place but it looks like 9.0.2 still does not contain it.
Comment 3 Marcus Comstedt 2022-08-15 19:54:26 UTC
Created attachment 799799 [details]
Output from emerge --info
Comment 4 Marcus Comstedt 2022-08-15 20:02:12 UTC
For completeness, here is the upstreams tracker for the unboxed arrays thing:
https://gitlab.haskell.org/ghc/ghc/-/issues/16998
and here is their workaround:
https://gitlab.haskell.org/ghc/packages/containers/-/commit/f5a511f1ff2cf16e710342948792cb8d7576e27c
Comment 5 matoro archtester 2022-08-16 03:00:09 UTC
Hi Marcus - if you can provide a link to a binpkg for BE ppc64 I will bring both of those in.  I have been keywording the ecosystem but my system runs LE.
Comment 6 Marcus Comstedt 2022-08-16 05:25:04 UTC
binpkg:  https://mc.pp.se/ghc-9.0.2-ppc64-package.tar.xz

The binpkg is built with the "Disable-unboxed-arrays.patch" patch enabled.
Note that this patch disables unboxed arrays generally, so for adding a
patch to the ebuild it's better to use the upstreams one which does it for BE
only.

I can also make a binpkg for arm64 if desired.
Comment 7 Marcus Comstedt 2022-08-16 07:11:07 UTC
Created attachment 799859 [details, diff]
Upstreams patch for unboxed containers issue

This is a massaged version of the upstreams patch for the unboxed containers issue which applies cleanly.  Only the path names have been changed.

This patch is needed for all versions currently in tree.  Fedora say that they apply it for <9.4.
Comment 8 Larry the Git Cow gentoo-dev 2022-08-21 02:25:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf7899db70b1379f1633f88e848a0ca3bcd92f62

commit cf7899db70b1379f1633f88e848a0ca3bcd92f62
Author:     matoro <matoro@users.noreply.github.com>
AuthorDate: 2022-08-19 00:00:22 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-21 02:25:05 +0000

    dev-lang/ghc: add big-endian ppc64 binary
    
    This requires a patch to work correctly on BE systems.  Apply the patch
    unconditionally since it is already includes the appropriate checks in
    the code.  Delete a few lines of commented-out obsolete patches.
    
    Closes: https://bugs.gentoo.org/865311
    Thanks-to: Marcus Comstedt <marcus@mc.pp.se>
    Closes: https://github.com/gentoo/gentoo/pull/26921
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/ghc/Manifest                              |  1 +
 .../files/ghc-9.0.2-disable-unboxed-arrays.patch   | 39 ++++++++++++++++++++++
 dev-lang/ghc/ghc-9.0.2.ebuild                      | 28 ++++------------
 3 files changed, 46 insertions(+), 22 deletions(-)