haskellPackages: fix pkgsStatic on aarch64-darwin#484571
haskellPackages: fix pkgsStatic on aarch64-darwin#484571wolfgangwalther merged 2 commits intoNixOS:haskell-updatesfrom
Conversation
… than same platform
…t is a different triple
955d0d3 to
c83edba
Compare
wolfgangwalther
left a comment
There was a problem hiding this comment.
I have similar changes on my local branch for darwin static support, but I have more changes in generic-builder, too. I believe there are more places where our builder differs from GHC in its judgement about "are we cross".
We might need more of these to build other packages than just hello, but we can do that later.
Will kick off another build here before merging.
It works for x86_64-linux, because the triple is not the same there - pkgsStatic uses musl, not glibc. You can get the same failure modes on x86_64-linux for |
|
This fixes basic pkgsStatic on darwin, which works fine. Doing TemplateHaskell on darwin in the sandbox is still not working, but that's for later. We'll just need to allow local networking, I guess - it errors with: |
672bdf5
Annoyingly, I couldn't simply Maybe I can relax that requirement via #445672 (comment). It wouldn't work for wine but don't think we need it there anyway. |
A lot of packages build with this change, including ones needing template-haskell. Haven't noticed any other failures specific to "static cross" yet, but I'll wait for your local fixes until I poke around these parts again. |
Mine are not done and I haven't worked on them in a while, so don't wait for them. This was mostly taken out of #383165. I don't remember anymore where I hit other things exactly, they have possibly been fixed in the meantime in better ways or so. If a lot of stuff is building, except for TH due to networking, that is a great sign. |
|
As I've stated before, in general, I'm not in favor of appeasing build systems in this manner. With the external interpreter, we did find a solution that, in particular, did not involve making hadrian believe we were natively compiling in order to get pkgsStatic to work, so we should really try to continue in this direction. Especially matching on the config alone is an ugly hack that breaks the expectations of Nixpkgs users. |
Fair enough, but how? |
I assume that was in #383165 - but the change proposed there was a lot different. That PR actually pretended native for the cross case, which is not the case here. This PR has two changes:
Thus, I think this PR is entirely fine. |
No clue why this was fine for
x86_64-linux, but onaarch64-darwin, I gotand after fixing that, in
installPhaseNotice the lines before the last refer to
lib/ghc-9.10.3/while settings is searched for inlib/arm64-apple-darwin-ghc-9.10.3These issues are due to the discrepancies pointed out in #383165.
We have at least 3 layers to think about regarding what counts as "native" builds:
hostPlatform.canExecute targetPlatformhostPlatform.config == targetPlatform.confighostPlatform == targetPlatformAFAICT, 3 implies 2 implies 1. We've mostly looked at 3, while ghc mostly looked at 2.
We might need to re-think things some in general, but changing
common-hadrian.nixto use 2 instead of 3 in these places seems to be an improvement as it fixespkgsStatic. Was able to build and runpkgsStatic.haskell.packages.ghc910.helloThings done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.