-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
haskell.compiler.ghc822Binary: propagate llvm dependency #80355
Conversation
/cc ZHF #80379 |
cc @Ericson2314 and @matthewbauer. I think you guys use GHC on alternative architectures, so hopefully you'll know whether this is a reasonable fix. |
@cdepillabout should this target haskell-updates since it's haskell related? |
@disassembler We often ask that changes to stuff in That said, rebasing this on |
Looks good to me. From past experience, not using the "blessed" llvm version is likely (but not guaranteed, hence the warning) to work, especially if using a later version of llvm. Testing this PR, I have successfully built a working ghc865 on aarch64. I think this probably means that it's ok to ignore the warning on the basis that:
I still can't see exactly what changed/why it worked without propagating llvm before. Is it possible that the ghc822Binary was able to function because it was finding the Let me know if there's anything else you'd like me to test with said build of ghc865. |
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.
I don't think that propagatedBuildInputs
is the right place to add llvm
. I'd prefer if those builds that need LLVM (on certain) platforms express that dependency explicitly.
Looks like the other (compiled from source) ghc packages add llvm to |
I tried adding |
@peti I'm not sure if I've understood correctly. Are you suggesting that packages which depend on |
Yes, that's my understanding of the comment. |
It's an unusual situation, in that Is it even possible to make |
Certainly sounds possible to me. |
It's my understanding that the builds that need LLVM are exactly "things built with ghc822Binary on arm". On current master, for example, trying to build a basic Haskell hello world without nix:
It seems to be a runtime dependency of ghc resolved via |
My motivation for opening this was to restore ghc on aarch64 by fixing its bootstrap ghc. Since the version of ghc in current master (8.8.x) no longer bootstraps via ghc822Binary there's not as much to be gained by fixing ghc822Binary on aarch64. Should I go ahead and close this, even though it remains broken? If not, how can we progress this? |
It would be a shame not to have a working aarch64 GHC in 20.03. In the absence of a more 'correct' solution, would it make sense to put this into 20.03, but not into master? |
This objection is silly to me. All of the non-bootstrap GHCs have LLVM (optionally) in |
4d05a7b
to
1078449
Compare
I pushed a small tweak to make it have a structure closer to the non-bootstrap compilers. |
Fixes the following error when attempting to build packages using this compiler: <no location info>: error: Warning: Couldn't figure out LLVM version! Make sure you have installed LLVM 3.9 <no location info>: error: ghc: could not execute: opt
1078449
to
31f557c
Compare
I'd prefer we make it better. |
@peti I agree that it would be great for it to be made better, but I think it is somewhat out of scope for this PR. I think it is reasonable to merge this in as-is (since it appears to just be making things consistent), and then correct all these uses of LLVM in a future PR. |
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.
OK. Let's live with the kludge. I don't like it, but I can't suggest an alternative implementation either, so I reckon I shouldn't be standing in the way.
@domenkozar has done his usual job of merging these changes already via 8c06685 without waiting for me to approve, so I guess we can close this PR since the change is now part of #83164 and will be merged into master
next Friday.
I think this PR is updating @thefloweringash Is this correct? |
Yep. I've been chasing the bootstrap compiler to bring ghc back to aarch64. On current |
@GrahamcOfBorg build haskell.compiler.ghc865 |
This PR doesn't affect linux nor darwin, so it's safe to merge into master. In current state it can't make aarch64 worse. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I moved my today's (confused) comments to a better thread: #66277 |
Fixes the following error when attempting to build packages using this
compiler:
I don't know why this worked before, but it seems an appropriate fix.
Motivation for this change
Motivation is to make ghc build on aarch64. Fixes #80176
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)