Skip to content

haskell.compiler: unify logic determining whether NCG is available #379365

Merged
K900 merged 2 commits intoNixOS:stagingfrom
sternenseemann:ghc-common-ncg-logic
Feb 9, 2025
Merged

haskell.compiler: unify logic determining whether NCG is available #379365
K900 merged 2 commits intoNixOS:stagingfrom
sternenseemann:ghc-common-ncg-logic

Conversation

@sternenseemann
Copy link
Member

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Feb 4, 2025
@sternenseemann sternenseemann changed the base branch from master to staging February 4, 2025 15:54
@sternenseemann
Copy link
Member Author

Is a set rebuild for aarch64, see #379039 (comment)

@nix-owners nix-owners bot requested a review from maralorn February 4, 2025 15:55
This change only consolidates the logic for the source built GHCs which
have used the same logic (at least as long as you'd only use the
respective supported version ranges of the expressions as inputs).
@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: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Feb 4, 2025
@nix-owners nix-owners bot requested review from cdepillabout and guibou February 4, 2025 16:12
Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

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

Nice refactoring!

@alexfmpe
Copy link
Member

alexfmpe commented Feb 4, 2025

Do we no longer want the darwin bit in (stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin) ?

@alexfmpe
Copy link
Member

alexfmpe commented Feb 4, 2025

I assume there are more of these re-usable bits. Do we want a file for each or something like
useLLVM ? !((import ./common-utils.nix).have-ncg { inherit lib stdenv version; }),

@sternenseemann
Copy link
Member Author

Do we no longer want the darwin bit in (stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin) ?

Exactly, this was an incorrect assumption originally: 59ee081.

@sternenseemann
Copy link
Member Author

I assume there are more of these re-usable bits. Do we want a file for each or something like useLLVM ? !((import ./common-utils.nix).have-ncg { inherit lib stdenv version; }),

Possibly yes, but I wouldn't want to commit to a design right now. There are multiple approaches we could take for further unifying these expressions. This one could also turn out to be special in a way, since it is one of the few things shared between the source built and binary GHCs.

@wegank wegank added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Feb 4, 2025
@K900 K900 merged commit f714228 into NixOS:staging Feb 9, 2025
29 checks passed
@sternenseemann sternenseemann deleted the ghc-common-ncg-logic branch February 9, 2025 13:55
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: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants