Skip to content

haskell.compiler.ghc902Binary: init at 9.0.2#411397

Merged
sternenseemann merged 4 commits intoNixOS:haskell-updatesfrom
sternenseemann:ghc-9.0.2-binary
May 30, 2025
Merged

haskell.compiler.ghc902Binary: init at 9.0.2#411397
sternenseemann merged 4 commits intoNixOS:haskell-updatesfrom
sternenseemann:ghc-9.0.2-binary

Conversation

@sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented May 27, 2025

We can/should use 9.0.2 to bootstrap some GHC versions, having the
bindist makes things easier in some cases.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This is more robust when new bindists are added to expressions since no
additional conditional needs to be updated.
We can/should use 9.0.2 to bootstrap some GHC versions, having the
bindist makes things easier in some cases.

- To bootstrap GHC 9.4 using 9.2 is not possible and 8.10.7 doesn't
  always work. Since source built 9.0.2 is broken on darwin at the
  moment, the bindist helps. Reference NixOS#367686, NixOS#410085.
- To bootstrap GHC 9.2 without GHC 8.10. Reference NixOS#346214.
@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label May 27, 2025
@nix-owners nix-owners bot requested review from maralorn and wolfgangwalther May 27, 2025 13:33
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 27, 2025
@sternenseemann
Copy link
Member Author

I've successfully built elm-format which uses GHC 9.4 with this PR and #410085 applied on top which builds fine (on x86_64-linux). I've tested compilation with the 9.0.2 bindist on all platforms except aarch64-linux (which I can't access right now), but I've verified the hash is correct there.

@wolfgangwalther
Copy link
Contributor

I took this PR, applied #410085 and built elm-format on aarch64-linux:

% file $(nix-build -A elmPackages.elm-format --argstr system aarch64-linux)/bin/elm-format
/nix/store/5cd0ml14a9wsga6nk84ymsa7fmgzfi3w-elm-format-0.8.7/bin/elm-format: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /nix/store/7kpxf47mzykkdn39lcnhj9z9ngpihamf-glibc-2.40-66/lib/ld-linux-aarch64.so.1, for GNU/Linux 3.10.0, stripped

(the first time I tried, I got a seg fault somewhere in the dependency chain, but that vanished the second time I tried - this was on the community builder, so maybe some other factors)

@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 28, 2025
@wolfgangwalther
Copy link
Contributor

I took this PR, applied #410085 and built elm-format on aarch64-linux:

For completeness, i did the same with pkgsMusl / elm-format on x86_64-linux to trigger that bindist. Also works.

@sternenseemann sternenseemann merged commit e941d46 into NixOS:haskell-updates May 30, 2025
16 of 17 checks passed
@sternenseemann sternenseemann deleted the ghc-9.0.2-binary branch May 30, 2025 15:12
@wolfgangwalther
Copy link
Contributor

Should we backport this, too? I just tried to build #411716, but that fails for darwin when bootstrapping (GHC 9.0.2). So I guess this would be fixed by this?

@sternenseemann
Copy link
Member Author

Yes, I think so, but probably without the change for GHC 9.2.

@wolfgangwalther
Copy link
Contributor

After this (on current haskell-updates), GHC 9.4 is still broken on darwin:

[ 48 of 269] Compiling Distribution.Compat.Environment ( libraries/Cabal/Cabal/src/Distribution/Compat/Environment.hs, bootstrapping/Distribution/Compat/Enviro>

In file included from /private/tmp/nix-build-ghc-9.4.8.drv-0/ghc57315_0/ghc_399.c:4:0: error:


In file included from /nix/store/fl1in32z09qnd7n8bja3pyv8i2i58igm-ghc-binary-9.0.2/lib/ghc-9.0.2/lib/../lib/aarch64-osx-ghc-9.0.2/rts-1.0.2/include/ffi.h:66:0:>


/nix/store/fl1in32z09qnd7n8bja3pyv8i2i58igm-ghc-binary-9.0.2/lib/ghc-9.0.2/lib/../lib/aarch64-osx-ghc-9.0.2/rts-1.0.2/include/ffitarget.h:6:10: error:
     fatal error: 'ffitarget_arm64.h' file not found
        6 | #include "ffitarget_arm64.h"
          |          ^~~~~~~~~~~~~~~~~~~
  |
6 | #include "ffitarget_arm64.h"
  |          ^
1 error generated.
`clang' failed in phase `C Compiler'. (Exit code: 1)
ghc/ghc.mk:110: ghc/stage1/package-data.mk: No such file or directory
make[1]: *** [utils/ghc-cabal/ghc.mk:50: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Error 1
make: *** [Makefile:124: all] Error 2

The check-list says you tested darwin, @sternenseemann. Did this regress since merging this PR? Or did you only test GHC 9.0.2 binary?

@wolfgangwalther
Copy link
Contributor

Did this regress since merging this PR?

I tried building haskell.packages.ghc94.hello on darwin on e941d46 (the commit that merged this PR), but at this stage I can't build some python dependencies, so hard to bisect.

@sternenseemann
Copy link
Member Author

I think I tested haskell.packages.ghc94.hello on darwin, but couldn't tell you at which commit exactly. It is entirely possible that I rebased the branch at some point.

In any case, the FFI header problem doesn't look all that mysterious at least.

@sternenseemann
Copy link
Member Author

#421477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants