Skip to content

haskell.compiler.ghc9{6,8}: work around output cycles on aarch64-darwin#258280

Merged
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
mpscholten:fix-ghc-9.6.x
Dec 12, 2023
Merged

haskell.compiler.ghc9{6,8}: work around output cycles on aarch64-darwin#258280
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
mpscholten:fix-ghc-9.6.x

Conversation

@mpscholten
Copy link
Copy Markdown
Contributor

Description of changes

Fix for #255037 (comment)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.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.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Sep 30, 2023
@cdepillabout
Copy link
Copy Markdown
Member

cdepillabout commented Sep 30, 2023

Let's see if ofborg is able to build this for us to test:

@ofborg build haskell.packages.ghc963.ormolu

(edit: this appears to fail on aarch64-darwin, but it looks just like an expected timeout? Likely not related to the patch added in this PR.)

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Sep 30, 2023
@ofborg ofborg bot requested review from expipiplus1 and guibou September 30, 2023 22:05
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Sep 30, 2023
@mpscholten
Copy link
Copy Markdown
Contributor Author

@cdepillabout looks like it failed because ghc963 is missing on this branch. Can you trigger a build on ghc962?

@cdepillabout
Copy link
Copy Markdown
Member

cdepillabout commented Oct 1, 2023

@mpscholten It appears that haskell.packages.ghc963.ormolu succeeded on x86_64-linux and -darwin, which indicates that 9.6.3 is available.

It appears to be timing out for aarch64 (which is likely expected, given that ofborg will timeout with long builds, and ghc is a long build).

Also, in the future, I think you should be able to run ofborg yourself, just by giving a similar @ofborg build ... in a comment if you want to play around with it!

(edit: Oh, I just took a better look at the error message, and it appears you're right! Only on aarch64-darwin, it is giving an error message that ghc-9.6.3 doesn't exist. I have no idea why that would be happening. Possibly ofborg is just completely busted on aarch64-darwin.)

@mpscholten
Copy link
Copy Markdown
Contributor Author

mpscholten commented Oct 1, 2023

Thanks, didn't know I can also trigger ofborg. This is good to know 👍

Let's see if a rebuild on ghc962 helps here

@ofborg build haskell.packages.ghc962.ormolu

I also started a build of this branch on the IHP M1 build server at https://github.com/digitallyinduced/ihp/actions/runs/6370225675/job/17291191691

@mpscholten
Copy link
Copy Markdown
Contributor Author

It seems like ormolu is not failing anymore on the M1 runner. The build has now run into a different issue which is unrelated to this change.

@cdepillabout
Copy link
Copy Markdown
Member

It seems like ormolu is not failing anymore on the M1 runner. The build has now run into a different issue which is unrelated to this change.

Hey, sorry I hadn't gotten back to you.

Is this PR still stuck on waiting for https://gitlab.haskell.org/ghc/ghc/-/issues/24041 to be fixed?

@mpscholten
Copy link
Copy Markdown
Contributor Author

Yes, looks like a fix was merged for GHC 9.8.x but no backport for 9.6.x yet

@cdepillabout cdepillabout marked this pull request as draft November 3, 2023 10:09
@cdepillabout
Copy link
Copy Markdown
Member

@mpscholten Do you mind if I convert this to a draft since we are still waiting on upstream for a fix for 9.6?

(If I've misunderstood, and this shouldn't be put into a draft, feel free to switch it back to non-draft.)

@mpscholten
Copy link
Copy Markdown
Contributor Author

As far as I understand the fix here is actually independent of that GHC issue. So even when GHC has merged that fix, I think this issue here will still happen unless the PR is merged

@cdepillabout
Copy link
Copy Markdown
Member

I think this issue here will still happen unless the PR is merged

Ah, so just so I understand, in order to fix the issue you're running into, both of the following things need to happen:

  • GHC needs to be patched
  • this PR needs to be merged

That is to say, if either GHC is patched without merging this PR, or this PR is merged without GHC being patched, it won't fix the issue, correct?

@mpscholten
Copy link
Copy Markdown
Contributor Author

Yes correct.

This PR here specifically fixes the issue of #140774 for GHC 9.6 This was also applied for GHC 9.4 via #220647

@sternenseemann sternenseemann marked this pull request as ready for review December 12, 2023 12:48
@sternenseemann sternenseemann changed the title Add missing patch for GHC 9.6.x darwin aarch64 separate output fix haskell.compiler.ghc9{6,8}: work around output cycles on aarch64-darwin Dec 12, 2023
This ports our infamous patch for `Cabal` which cheesily prevents an
output cycle for derivations that use separate bin outputs where
references caused by the `Paths_*` module can't be eliminated by the GHC
aarch64-darwin codegen backend.

See also

- the original issue NixOS#140774,
- the original patch for GHC 9.2 NixOS#216857
- the ported patch for GHC 9.4
  NixOS@f6f780f

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
@maralorn
Copy link
Copy Markdown
Member

Nice!

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: 0 This PR does not cause any 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.

4 participants