Skip to content

ghc: bootstrap 9.8 from bindist again on Darwin#330560

Merged
maralorn merged 2 commits intoNixOS:masterfrom
reckenrode:ghc-9.6.3-fixes
Jul 30, 2024
Merged

ghc: bootstrap 9.8 from bindist again on Darwin#330560
maralorn merged 2 commits intoNixOS:masterfrom
reckenrode:ghc-9.6.3-fixes

Conversation

@reckenrode
Copy link
Contributor

@reckenrode reckenrode commented Jul 28, 2024

Description of changes

Split off from #330559. Targeting staging-next because the required version of ld64 is currently only on staging-next.

The issue was ar -L again. When I tried building GHC 9.8 without the fix, the build failed at Shake, but the error was different on staging-next with ld64 951.9.

ld: warning: ignoring file /nix/store/gr6f3icxkn8mpk3rdn0gi1qgk1ynk9kk-clock-0.8.4/lib/ghc-9.6.3/lib/aarch64-osx-ghc-9.6.3/clock-0.8.4-Bnns7LmnhG01nLONJf4lGG/libHSclock-0.8.4-Bnns7LmnhG01nLONJf4lGG.a, building for macOS-arm64 but attempting to link with file built for macOS-arm64
ld: in /nix/store/43r6s5nzb96445yy89366qh3y3jiy8ci-hashable-1.4.4.0/lib/ghc-9.6.3/lib/aarch64-osx-ghc-9.6.3/hashable-1.4.4.0-Ayk07ZB4soWJifMLtnGP0H/libHShashable-1.4.4.0-Ayk07ZB4soWJifMLtnGP0H.a(LowLevel.o), archive member 'LowLevel.o' with length 9024 is not mach-o or llvm bitcode file '/nix/store/43r6s5nzb96445yy89366qh3y3jiy8ci-hashable-1.4.4.0/lib/ghc-9.6.3/lib/aarch64-osx-ghc-9.6.3/hashable-1.4.4.0-Ayk07ZB4soWJifMLtnGP0H/libHShashable-1.4.4.0-Ayk07ZB4soWJifMLtnGP0H.a' for architecture arm64

After extracting the object from the file and inspecting it, I found that LowLevel.o was another archive. Static archives inside static archives are not supported by ld64. Fortunately, it’s possible to override GHC’s settings to suppress using ar -L, which allowed me to switch the bootstrap back to the bindist.

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.11 Release Notes (or backporting 23.11 and 24.05 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.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jul 28, 2024
@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Jul 28, 2024
@ofborg ofborg bot requested review from cdepillabout and expipiplus1 July 28, 2024 03:41
@ofborg ofborg 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. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jul 28, 2024
@vcunat vcunat changed the base branch from staging-next to master July 28, 2024 11:51
The bindist defaults to enabling `ar -L` if it detects a compatible `ar`. Suppress this behavior by overriding the setting. This allows the bindist to be used to bootstrap GHC 9.8.
@reckenrode
Copy link
Contributor Author

I fixed the commit reference in the reverted commit. Thanks @vcunat for retargeting this to master after staging-next was merged. @sternenseemann Pinging you since you worked on the previous solution, and this is Haskell-related.

Copy link
Member

@maralorn maralorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t feel particularly firm with the details, but I like this.

@maralorn maralorn merged commit 255f595 into NixOS:master Jul 30, 2024
@maralorn
Copy link
Member

Thank you

@reckenrode reckenrode deleted the ghc-9.6.3-fixes branch July 30, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 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: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments