Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 943037 - dev-lang/ghc breakage on arm/arm64 without LLVM 14
Summary: dev-lang/ghc breakage on arm/arm64 without LLVM 14
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 917641
  Show dependency tree
 
Reported: 2024-11-09 02:47 UTC by Jeff Gazso
Modified: 2024-11-09 17:41 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Gazso 2024-11-09 02:47:21 UTC
Removal of llvm-14.0.6-r4 from the Gentoo ecosystem[^1] breaks dev-lang/ghc on arm/arm64. It's impossible to build ghc without it on arm-based systems.

There is a bug open for dev-lang/ghc[^2] about this. There is a request open with the gentoo-haskell GitHub repo[^3] to push out revised versions of the 9.2.8 and 9.0.2-r4 ebuilds to portage that compile with LLVM versions >14.

In my view the fastest path to resolution is:

1. Restore sys-devel/llvm-14.0.6-r4.
2. Have the Haskell team push out fixed dev-lang/ghc ebuilds that work with LLVM >14 when they're able.
3. Once the fixed dev-lang/ghc ebuilds have been out for a while, drop sys-devel/llvm-14.0.6-r4 again.

---
[1]: <https://gitweb.gentoo.org/repo/gentoo.git/commit/sys-devel/llvm/llvm-14.0.6-r4.ebuild?id=369b3aa2aee476cb3a19ac24cd57db6f9d890199>
[2]: Gentoo bug #917641, see comment 3.
[3]: https://github.com/gentoo-haskell/gentoo-haskell/issues/1562
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-09 02:49:09 UTC
# Michał Górny <mgorny@gentoo.org> (2023-12-22)
# Requires LLVM 14 that is being removed.
<dev-lang/ghc-9.4 llvm
<media-gfx/openvdb-11 ax
sys-devel/sparse llvm

If it's not happened in a year, I suspect it's not going to happen.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-09 02:50:36 UTC
I don't see any link to an upstream GHC issue about this.
Comment 3 matoro archtester 2024-11-09 03:00:37 UTC
GHC has native codegen for arm64 since 9.2, so it's not in fact required to build.  In the log in 917641 it's trying to use LLVM despite USE=llvm being flipped off, which is a different bug.  But LLVM should not be required to build on arm64 since 9.2.
Comment 4 Jeff Gazso 2024-11-09 03:08:58 UTC
(In reply to matoro from comment #3)
> GHC has native codegen for arm64 since 9.2, so it's not in fact required to
> build.  In the log in 917641 it's trying to use LLVM despite USE=llvm being
> flipped off, which is a different bug.  But LLVM should not be required to
> build on arm64 since 9.2.

Okay, I'll give it a try again in the morning without the llvm flag and see what I get.
Comment 5 matoro archtester 2024-11-09 05:21:47 UTC
(In reply to Jeff Gazso from comment #4)
> (In reply to matoro from comment #3)
> > GHC has native codegen for arm64 since 9.2, so it's not in fact required to
> > build.  In the log in 917641 it's trying to use LLVM despite USE=llvm being
> > flipped off, which is a different bug.  But LLVM should not be required to
> > build on arm64 since 9.2.
> 
> Okay, I'll give it a try again in the morning without the llvm flag and see
> what I get.

Sorry - to clarify, you did everything correctly.  The log you posted shows that you do not have the llvm flag enabled, yet it is attempting to pull in LLVM anyway.  That's a mistake somewhere on our part and I don't yet know where.  GHC is sensitive to what backend was used to build it, and also likes to search $PATH an opportunistically enable things.  I did my best to try and cripple that but it may not have been enough.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-11-09 06:36:00 UTC
I'm sorry but this isn't going to happen.  Upstream is providing support for literally one slot, and everything else requires downstream patching.  Keeping LLVM down to 15 is a nightmare, and I really do hope to remove 15 soon, not add even more dead versions.
Comment 7 Jeff Gazso 2024-11-09 17:41:44 UTC
(In reply to matoro from comment #5)
> (In reply to Jeff Gazso from comment #4)
> > (In reply to matoro from comment #3)
> > > GHC has native codegen for arm64 since 9.2, so it's not in fact required to
> > > build.  In the log in 917641 it's trying to use LLVM despite USE=llvm being
> > > flipped off, which is a different bug.  But LLVM should not be required to
> > > build on arm64 since 9.2.
> > 
> > Okay, I'll give it a try again in the morning without the llvm flag and see
> > what I get.
> 
> Sorry - to clarify, you did everything correctly.  The log you posted shows
> that you do not have the llvm flag enabled, yet it is attempting to pull in
> LLVM anyway.  That's a mistake somewhere on our part and I don't yet know
> where.  GHC is sensitive to what backend was used to build it, and also
> likes to search $PATH an opportunistically enable things.  I did my best to
> try and cripple that but it may not have been enough.

Thanks for the feedback. It's good to know I wasn't missing something obvious. I did try again and with the llvm flag disabled I still run into an issue:

# emerge --ask dev-lang/ghc
[ebuild  N    ] dev-lang/ghc-9.2.8 
[ebuild  N    ] app-admin/haskell-updater-1.4.1.0 

Fails with:

 * ERROR: dev-lang/ghc-9.2.8::haskell failed (setup phase):
 *   No binary available for 'arm64' arch yet, USE=ghcbootstrap

With ghcbootstrap enabled, the following happens:

# emerge --ask dev-lang/ghc
[ebuild  N    ] dev-lang/ghc-9.2.8 

 * ghc not found
 * ERROR: dev-lang/ghc-9.2.8::haskell failed (pretend phase):

I'm going to try unamasking an upstream version of ghc from the gentoo-haskell tree and see if I can build it.

Thanks for getting back to me. I genuinely appreciate the help.