New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ghc: enable parallel building of GHC on aarch64. #48446
Conversation
Note: this only affects GHC, not haskellPackages, which still suffers from https://ghc.haskell.org/trac/ghc/ticket/15449.
Paging @samueldr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This partially reverts the changes that were inconsequential on non-AArch64 platforms. So this is good in that this won't (shouldn't) cause any change there, thus a net zero sum on non-AArch64. Hopefully this'll help the Haskellers interested in AArch64 fix things for AArch64 :).
@dhess I wonder if there's a way to control the number passed to |
But overall I'm happy about this change :) |
The GHC build system uses I would much rather have a build that works every time, rather than a build that fails on my machines but works on Hydra. Maybe I'm the only one unlucky enough to be using the afflicted hardware? |
@TravisWhitaker I thought -j and --make are only used in building ghc-cabal and running the test suite. Where else is it used? We should probably disable the test quite though, unless we can figure out how to limit the -j for just that. |
@TravisWhitaker The entire community benefits from having successful Hydra builds of GHC on However, the point is moot (for now) as it appears that even Hydra is unable to build https://hydra.nixos.org/build/83144215 It's timing out after 10 hours, which is interesting, because before this change, when The first successful build (https://hydra.nixos.org/build/82810083), just after this commit was made, took 8h23m, so it made the cut. But it might be the case that we just got lucky with that build, and that subsequent builds with It's also possible that the builds were going fine but just took longer than the first successful build and didn't make the 10 hour cutoff. So, either way, it appears that this change was not successful in its goal of producing consistent GHC Hydra builds on I will say, though, that on my own personal Hydra, I'm doing a daily build of 3 of my own Haskell packages using |
With I should've qualified "my" more carefully; my organization has its own Nix infrastructure and GHC tweaks, so we aren't using these binaries anyway. In general, I think a person with afflicted hardware would rather wait for a working binary to build, rather than download one from Hydra that might be arbitrarily broken due to this GHC bug.
As I wrote in the GHC bug report, a common failure mode is a threaded Haskell program hanging forever, waiting on a futex. Perhaps this is the culprit?
You might be running on unafflicted hardware (which seems to be any microarch without dynamic execution) or you've flipped three heads in a row.
IIRC it's also used when building the boot packages, but I could be wrong. |
@dhess Wait... The log of that failed build ends the same way as a successful build... Is it possible something irrelevant is hanging for hours? It is not exhibiting the panic caused by EDIT:
It can't be because then we wouldn't be getting to the installPhase, let alone the fixupPhase. |
@ElvishJerricco Does it always panic? I was under the impression that it sometimes just hangs indefinitely. (edit Oh, perhaps @TravisWhitaker is |
@dhess Ah right. But it still wouldn't get to the installPhase or fixupPhase in that case. It'd hang in buildPhase or checkPhase or something. |
Ah, agreed. It seems something else is going on... |
@dhess Do the builders have |
Does 8.4.4 support cross compiling from aarch64 to another architecture? I am getting some weird errors from cross-trunk: https://hydra.nixos.org/build/83688270/nixlog/1/tail
|
Actually this doesn't seem to be specific to aarch64, so probably not having to do with this PR. |
Indeed, GHC 8.4.4 is totally broken on ARM. |
I should have more time to look into this in a couple of weeks, but I'm completely slammed at the moment. Meanwhile, as recently as master from 4 days ago, |
Note: this only affects GHC, not haskellPackages, which still suffers
from https://ghc.haskell.org/trac/ghc/ticket/15449.
Motivation for this change
@ElvishJerricco pointed out on #47901 that GHC's own build system (mostly) doesn't use
-j
. (This is not quite true as it does seem to use it for building some phases, but my test build made it through successfully, anyway, so perhaps these phases don't trigger the GHC bug mentioned above in the Trac issue.)Therefore, we can re-enable parallel builds of GHC on
aarch64
and produce a workingghc843
in just a few hours on the Packet.net hardware. This will allow Hydra to start compilinghaskellPackages
and we can deal withaarch64
porting issues as they arise. In attempting to build my own Haskell packages with this compiler, many important packages (e.g.,lens
) build just fine, buttls
's tests are currently broken on this arch.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)