Skip to content

haskell.compiler.{ghc98*,ghcHEAD}: bootstrap using source built 9.6#297804

Merged
sternenseemann merged 1 commit intoNixOS:masterfrom
sternenseemann:ghc-darwin-bootstrap-source-built
Mar 21, 2024
Merged

haskell.compiler.{ghc98*,ghcHEAD}: bootstrap using source built 9.6#297804
sternenseemann merged 1 commit intoNixOS:masterfrom
sternenseemann:ghc-darwin-bootstrap-source-built

Conversation

@sternenseemann
Copy link
Member

Unfortunately, we are running into trouble linking dependencies of hadrian against the libraries of the clock package with 9.6.3 and 9.6.4 bindists. My current suspiscion is that this is caused by some kind of discrepancy between the toolchain used by GHC upstream and us that persists from the configure step used when building the bindist. The problem seems to be somewhat localized to hsc2hs (hence clock is an issue), with GHC 9.6.4 bindists even passing a flag to ld that is not supported by our version of cctools.

The problem is not fully diagnosed, so take the speculation above with a grain of salt.

As a workaround, we can use the source built GHC 9.6 which is, of course, configured with our toolchain in the environment.

Fast track into master.

Description of changes

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (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.

Unfortunately, we are running into trouble linking dependencies of
hadrian against the libraries of the clock package with 9.6.3 and
9.6.4 _bindists_. My current suspiscion is that this is caused by
some kind of discrepancy between the toolchain used by GHC upstream
and us that persists from the configure step used when building the
bindist. The problem seems to be somewhat localized to hsc2hs (hence
clock is an issue), with GHC 9.6.4 bindists even passing a flag to
ld that is not supported by our version of cctools.

The problem is not fully diagnosed, so take the speculation above
with a grain of salt.

As a workaround, we can use the source built GHC 9.6 which is, of
course, configured with our toolchain in the environment.
@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Mar 21, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Mar 21, 2024
@sternenseemann sternenseemann merged commit ccc08ba into NixOS:master Mar 21, 2024
@sternenseemann sternenseemann deleted the ghc-darwin-bootstrap-source-built branch March 21, 2024 20:00
@TravisWhitaker
Copy link
Contributor

There are two separate issues here.

GHC 9.6.3 has an aarch64 code layout issue. It's hard to say exactly when it will or won't happen, so I'm not surprised that we happen to hit this when bootstrapping with the bindist but not with the Nix-built 9.6.3.

Totally separately 9.6.4's bindist has a bugged hsc2hs (related issue) on darwin.

@sternenseemann if we're going to bootstrap with a Nix-built GHC anyway, I think we'd be safer using 9.6.4 instead of 9.6.3.

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: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments