haskell.*: Bootstrap & fix on powerpc64#439258
Conversation
73d04ff to
573f6f7
Compare
966034f to
3b34072
Compare
f49fb1d to
2f096c0
Compare
|
Note that we are currently trying our best to remove as many older GHC versions as possible since keeping them around increases the maintenance burden not just for the Haskell subsystem, but also LLVM since some backends use pretty old versions. Currently, we are looking at removing everything < 9.4. This change could possibly work as we could add the old GHCs purely for bootstrapping with the NCG backend of GHC for powerpc. However, I am shivering at the amount of code and patches added in this PR and not necessarily looking forward to keeping this working. I think the most promising solution for increasing is using the fact that we can cross compile GHC 9.4 completely. The idea would be to create “haskell bootstrap tools” archives from that for other platforms. This would also solve the issue for riscv64-linux etc. However, this is an unproven theory at the moment. |
|
I completely understand the concerns and shivers here, especially since this isn't a very popular architecture anymore 😅. I'd be fine with keeping this a draft for now. I remember that I started looking into this because some Haskell package got pulled in somewhere while building things beyond the basic
Is there an issue / existing discussion for this somewhere? Would love to know if that idea ever gets somewhere, so I can adjust this accordingly. |
|
You can try (Came here via #440271 and can affirm that the idea of keeping all these older GHCs working scares me, especially if LLVM becomes involved. For POWER that shouldn’t matter, but then it doesn’t seem obvious that having this chain in‐tree is worth it for POWER over uploading a cross‐compiled GHC to tarballs.nixos.org or the like. I am sympathetic to source‐based bootstrapping concerns, but in this case I believe that nobody has ever compiled a GHC that can’t eventually be traced to some unexplained binary from the 90s, so IMO the version proliferation here is not worth tracing back to a slightly older binary (and even then, I somewhat prefer the approach used by our in‐tree minimal bootstrap of having separate stripped‐down derivations that do the minimum required to get to the next stage rather than burdening the wider package set). However, I am not a Haskell maintainer, so this is just an unsolicited opinion with no real weight.) |
If the Ampere machine is still around at NixCon tomorrow, then I'll see if I can give that a shot on there. Otherwise that'll have to wait until after NixCon, cus my laptop is prolly too puny to handle a build like that in a timely manner ^^". |
The big question for you is of course whether the result can actually be used on power, testing the build can be done by almost anyone. We were successful with riscv64-linux in the past.
The risk is also that these old binaries randomly stop working as happened with ppc64le, so a solution for getting fresh-ish binaries would be great. (Amjoseph determined that re-using other distribution's underexplained binaries is not an option since GHC is not sufficiently relocatable and patching in the /nix/store paths was not always feasible. However, this may have changed since.) |
I actually write FWIW, @OPNA2608, it shouldn’t be meaningfully more expensive than any other given GHC build, unless you mean that we don’t have the cross toolchain for it cached, in which case I think it would be reasonable to ensure that gets built on Hydra like we do many other cross toolchains. And yes, I successfully cross‐compiled an unregisterised GHC 9.4 for RISC‐V when testing #440271; since PowerPC shouldn’t even involve LLVM (something I forgot when talking about injecting dependencies) and was presumably, uh, registerised before 9.4, I expect it should hopefully go quite smoothly. (Also, consider applying for access to the community builders if you’d like time‐shared access to big machines to test Nixpkgs builds on? They have an Ampere, although of course one must be responsible with the shared resources.) I guess what you’d actually want to cross‐build is a static |
Yeah, I mean – I’d like to see everything fully bootstrapped from source, ideally. I’d just also like clean separation of “ancient versions for bootstrap paths” and “fully‐supported members of the main package set”. Unfortunately, my understanding is that a fresh fully‐bootstrapped GHC build has never been accomplished and that it’s unclear what the path to making it work would even be. My guess is that it would involve a reasonably competent Haskell implementation in a language that already has a reasonable bootstrapping path, but it seemed like getting Hugs to work was too much, and what Haskeller is going to willingly write a compiler in a normie language? The other nice thing about a second‐sourced implementation of a reasonably modern version of a language is that you can skip the “compile 20 versions in a row” nonsense and jump to the latest compiler reasonably quickly. But it doesn’t seem to me like this will happen any time soon, so practical concerns dominate, and using existing bindists or creating them when they don’t exist sounds like the right medium‐term path to me. I assume the plan is that if bindists bitrot you can just do the same thing you’d do for cross but for native and treat them as another set of “GHC bootstrap tools”, possibly even bumping them semi‐regularly like we do the existing bootstrap tarballs? |
I have a decently beefy workstation at home that I usually do such things on, It just didn't fit into my backpack. Or it would've crushed my back :). I only suggested Ampere specifically because there were mentions of one of those being at NixCon, and I imagine it'd be a fair lot beefier than my PineBook Pro without a battery to support higher power draw. I managed to sit down and mess around abit with that machine on Sunday, but most of that time went into trying to get networking... working, and we didn't get the build done in time. I'll leave the community builders to community members with bigger needs, for more important things, and for more urgent stuff. Right now this was just bad timing for me, I just didn't expect to be asked to do that big of a build during NixCon ^^". I'll be back home from NixCon later today, and give it a try on my workstation at home. My return trip has been quite a mess thanks to DB, so I'll try to empty my head in abit and get some more rest...
Checked on
Do you happen to know what would need to be done to enable that? Or if those toolchains are only getting prebuilt for x86_64, and not ARM... I guess that's fine then.
Gave |
|
I almost have a fix for the All the |
I'm fine with this being a follow up.
I think we'll just have to accept this for now. crypton's tests have been plagued by various issues even on something as mundane as aarch64… I'm not sure if there's a good way to make this more transparent to users, but oh well. |
I started working on this, but got a little stuck in terms of which direction to go and also don't have a ton of time at the moment, but hopefully I'll figure all of that out eventually. |
7af5d54 to
d75f7bc
Compare
sternenseemann
left a comment
There was a problem hiding this comment.
Just needs a formatting issue resolved, I think.
d75f7bc to
f286df2
Compare
|
@sternenseemann formatting was resolved. Does this need anything else, or is it waiting on smth? |
Yoinked the ppc64 build from Debian, because there are no bindists for this.
xxhash-tests w{32,64}-examples fail on big-endian POWER. I imagine this is something endian-specific, not POWER-specific.
…C lacks DWARF <-> register mappings Unsure: - if, and how reliably, this works on - RISC-V (https://gitlab.haskell.org/ghc/ghc/-/commit/1c479c01d909c5a234cc17b0b308a400c2e0a6f6) - LoongArch64 (https://gitlab.haskell.org/ghc/ghc/-/commit/652cba7ee71d2ebd0af912fcc218bc0f27237738) - what the situation on unregisterised builds is like
Fixes building up to ShellCheck on ppc64.
Upstream report about them not working on all archs. Only platform I can confirm these failures on myself is ppc64.
f286df2 to
f9bee9d
Compare
|
(Please let me know if there's a better place to discuss this.)
I am also interested in getting cross bootstrapping working and merged. My system is using musl as system libc (
I did not have any issues with failing tests. I plan to try to reproduce this on nixpkgs master, wight GHC 9.4.8 as the cross-compiled bootstrap version. |
I'm not sure if there's a dedicated issue for this yet. Maybe https://matrix.to/#/#haskell:nixos.org for discussing ideas?
Cross-compiled registerised GHC also segfaults on ppc64le? Might make sense to just cross-compile it unregisterised by default for 64-bit POWER then. nixpkgs/pkgs/development/compilers/ghc/common-make-native-bignum.nix Lines 93 to 99 in 9dd7280 Smth like: enableUnregisterised ?
# Registerised RV64 compiler produces programs that segfault
# See https://gitlab.haskell.org/ghc/ghc/-/issues/23957
(stdenv.hostPlatform.isRiscV64 || stdenv.targetPlatform.isRiscV64)
# GHC cross-compiled for 64-bit POWER segfaults
|| ((!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && stdenv.hostPlatform.isPower64), |
Yes, in fact
Yes, that's a good idea. I'd maybe like to characterize the issue a bit better when submitting a PR, but I'm cross-compiling from aarch64, so it takes several hours to build GHC, and so I haven't spent time on building things I know are broken. I have been successful with the GHC 9.4.8 on nixos-25.11 cross bootstrap. Here's the build machine side: And here's the target machine side: https://github.com/smaeul/nixpkgs/commits/386472554a34ca5d14ad341c50f82fd3f9205868 The tarball's only library dependency is My plan is:
|
Build on NixOS#439258 to bootstrap GHC on powerpc64le in the same way: using the Debian package. Move the conditionals in top-level/haskell-packages.nix to probe for support from the 9.6.6-debian-binary.nix package so it's easier to do the same thing for other architectures, too, should anyone else need it.
Build on NixOS#439258 to bootstrap GHC on powerpc64le in the same way: using the Debian package. Move the conditionals in top-level/haskell-packages.nix to probe for support from the 9.6.6-debian-binary.nix package so it's easier to do the same thing for other architectures, too, should anyone else need it.
Build on NixOS#439258 to bootstrap GHC on powerpc64le in the same way: using the Debian package. Move the conditionals in top-level/haskell-packages.nix to probe for support from the 9.6.6-debian-binary.nix package so it's easier to do the same thing for other architectures, too, should anyone else need it.
Build on NixOS#439258 to bootstrap GHC on powerpc64le in the same way: using the Debian package. Move the conditionals in top-level/haskell-packages.nix to probe for support from the 9.6.6-debian-binary.nix package so it's easier to do the same thing for other architectures, too, should anyone else need it.
Built
ghc98and itsShellCheckon hardware. Disabling thehashabletests on all GHC versions is only speculative, as I only saw it happening when buildingghc98.hashable.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.