Skip to content

Comments

haskell.compiler.ghc{8107{,Binary},928}: drop#440794

Merged
wolfgangwalther merged 5 commits intoNixOS:masterfrom
emilazy:push-lulmxkymqlvo
Sep 7, 2025
Merged

haskell.compiler.ghc{8107{,Binary},928}: drop#440794
wolfgangwalther merged 5 commits intoNixOS:masterfrom
emilazy:push-lulmxkymqlvo

Conversation

@emilazy
Copy link
Member

@emilazy emilazy commented Sep 7, 2025

What can I say? I felt left out of all the fun…

This probably has issues since I don’t really know what I’m doing Haskell-package‐set‐wise, but I felt more like doing this than building another GHC 9.2 to validate #440271. It’s based on a rebased/fixed up version of #381265, which should of course land first.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@emilazy emilazy requested a review from a team September 7, 2025 00:40
@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2025

“GHC 9.4.8 does not have a binary” would be one of those issues, especially in light of #440410. I guess bootstrapping with a newer GHC than the one you’re building won’t work, so… they’d have to use 9.0.2 (if that works?) or else the source‐based 9.4.8?

Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

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

Comparing notes with my local branch on the same topic, see comments. I also have some changes in the docs to change haskell.packages.ghc92 to haskellPackages in various examples, as well as a mention of ghcName = "ghc92", which I changed to ghc910, might as well change it to ghc912 to last longer.

I think we should back out the drop of ghc924Binary for now to make progress on the remaining stuff.

Also needs a rebase, ofc.

Comment on lines -594 to -596
Copy link
Contributor

Choose a reason for hiding this comment

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

This should remove ghc-api-compat == 8.10.7 from pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml (and then run maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast)

Copy link
Member Author

Choose a reason for hiding this comment

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

I should have known my attempt at getting some bonus removal fun would lead me to having to actually interact with the Haskell package stuff that frightens and confuses me.

Should I also be doing something about the integer-simple Hackage package that is, uh, marked broken? (Was any of that stuff actually working?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Why does that script want to build Nix 2.28…

Worked around with nixpkgs=flake:nixpkgs/nixpkgs-unstable; I guess you don’t want to use the CI pin because haskell-updates can bump the relevant tooling?

But then:

shion:~/Developer/nixpkgs  1  (no description set)
❭ maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast
fetching path input 'path:/nix/store/ngghfaknb50axlvdnxclr6mwgkp9ym3b-source'
Obtaining Hackage data …
Generating compiler configuration …
Running hackage2nix to regenerate pkgs/development/haskell-modules/hackage-packages.nix …
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pty-mcp-server/0.0.5.0/pty-mcp-server.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-ui-response/0.0.4.0/pms-ui-response.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-ui-request/0.0.4.0/pms-ui-request.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-ui-notification/0.0.3.0/pms-ui-notification.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-infrastructure/0.0.4.0/pms-infrastructure.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-infra-watch/0.0.3.0/pms-infra-watch.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-infra-socket/0.0.1.0/pms-infra-socket.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-infra-cmdrun/0.0.2.0/pms-infra-cmdrun.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-infra-procspawn/0.0.1.0/pms-infra-procspawn.cabal)
hackage2nix: user error (cannot parse cabal file /nix/store/xk82157yf0986i80f19wvmwjq45jvgvf-unpacked-cabal-hashes/pms-domain-service/0.0.4.0/pms-domain-service.cabal)
hackage2nix: thread blocked indefinitely in an MVar operation

Is this a Darwin thing?

I’m going to push out the changes to the .yml but not actually update the .nix file until I figure out what’s going on here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should I also be doing something about the integer-simple Hackage package that is, uh, marked broken? (Was any of that stuff actually working?)

No need to do anything here. This is just marked broken like many other hackage packages that are oold. I am working on removing these entirely from the package set.

I'm not sure whether / how the integer-simple hackage package is connected to the "compile GHC 8.10 with the integer-simple feature". I think they are unrelated, so the fact that this is broken.. just means that integer-simple doesn't work on newer GHCs - unsurprisingly.

Worked around with nixpkgs=flake:nixpkgs/nixpkgs-unstable; I guess you don’t want to use the CI pin because haskell-updates can bump the relevant tooling?

Correct, we need to use unstable cabal2nix.

Is this a Darwin thing?

I'm not sure, could be.

Copy link
Member

Choose a reason for hiding this comment

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

The fun has to stop somewhere! Unfortunately, Hackage packages are case sensitive and the database hackage2nix uses is file system based, so it is very difficult to regenerate the package set on Darwin. (The database cabal-install uses has since added cryptographic hashes for the tarballs, so we can potentially switch to that in the future though I suspect we need to remove packages first since hashes are only tracked for packages uploaded after some point in time, it seems.)

Should I also be doing something about the integer-simple Hackage package that is, uh, marked broken? (Was any of that stuff actually working?)

integer-simple works fine, it's just bundled with GHC 8.10.7.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, Hackage packages are case sensitive and the database hackage2nix uses is file system based, so it is very difficult to regenerate the package set on Darwin.

I do use a case‐sensitive /nix/store with a case‐sensitive temp-dir = /nix/tmp. So depending on where the database is, I could potentially make it work by setting $TMPDIR appropriately, I suppose.

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 7, 2025
@wolfgangwalther
Copy link
Contributor

“GHC 9.4.8 does not have a binary” would be one of those issues, especially in light of #440410. I guess bootstrapping with a newer GHC than the one you’re building won’t work, so… they’d have to use 9.0.2 (if that works?) or else the source‐based 9.4.8?

For the fun of it, I tried both. Of course, the newer bootstrap compiler won't work :D. Also 9.0 to bootstrap 9.6 failed, because configure rejects that explicitly.

Dropping ghc928Binary doesn't seem to give us much benefit right now, I think. Dropping ghc902Binary would probably have more relevance, but that won't happen because of GHC 9.4.

@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2025

Sorry for stealing your branch 😆

hackage2nix needs figuring out. I don’t mind if you just run it on the two commits that touch that stuff and force‐push to my branch, though. (Good excuse to avoid ending up accidentally ending up a maintainer for an ecosystem I don’t really use any more…)

I’ve dropped the ghc924Binary stuff for now. I was wondering if it might make sense to just use the 9.4.8 source build to bootstrap those versions, though. GHC 9.4.8 is a fixture for now, and if the cross‐compiled bindists thing is done, we’ll presumably be creating our own ghc948Binarys, and we’ll want a path from 9.4.8 to all other compiler versions.

I’m not sure if we’d want to package the official 9.4.8 bindists and use those for platforms where we don’t do that, but in general I envision that the bootstrap chain would look like if lib.meta.availableOn stdenv.buildPlatform bb.packages.ghcXXXBinary then bb.packages.ghcXXXBinary else bb.packages.ghcXXX for all compilers past 9.4.8 itself. Right now, we can treat lib.meta.availableOn stdenv.buildPlatform bb.packages.ghc948Binary as just always false, because there is no such binary package yet, and we don’t have to worry about the length of the bootstrap chain much because these compilers aren’t used for much in Nixpkgs anyway.

We can have that discussion on a separate PR to drop the bindist, but does that make sense to you?

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 7, 2025
@emilazy emilazy changed the title haskell.compiler.ghc{8107{,Binary},924Binary,928}: drop haskell.compiler.ghc{8107{,Binary},928}: drop Sep 7, 2025
@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2025

FWIW, my preference is to land this before #440774 (or #440273 if the unpins get moved there), just to reduce some of the churn and save me from having to test the 9.2 build. So if any of this is controversial / not ready to land ASAP it’d be good to know so I can plan appropriately.

@emilazy emilazy mentioned this pull request Sep 7, 2025
1 task
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: haskell General-purpose, statically typed, purely functional programming language 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation labels Sep 7, 2025
@emilazy emilazy mentioned this pull request Sep 7, 2025
13 tasks
@wolfgangwalther
Copy link
Contributor

my preference is to land this before #440774 (or #440273 if the unpins get moved there)

Mine as well.

hackage2nix needs figuring out. I don’t mind if you just run it on the two commits that touch that stuff and force‐push to my branch, though. (Good excuse to avoid ending up accidentally ending up a maintainer for an ecosystem I don’t really use any more…)

Can do, and also run treefmt while at it.

We do, in fact, have a binary package for this now, and we do, in fact,
use it.
@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2025

Can do, and also run treefmt while at it.

Thanks. (Sorry, I need to set up an alias to jj fix my commits before they get pushed; relying on CI for reasonable eval timing makes my Nixpkgs workflow sloppy…)

@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2025

FWIW, my preference is to land this before #440774 (or #440273 if the unpins get moved there),

(Er, I meant #440271 here. But now there should be no textual conflict between the two, as the LLVM pinning changes will be moved to #440273. So I’d still like to see this land soon so I can rebase #440273, or else know that it won’t land soon. Of course, I’ll also rebase #440774 once the master‐targeting churn is merged and makes its way to haskell-updates.)

@wolfgangwalther
Copy link
Contributor

LGTM; here's the diff of the changes I made, if you want to double check: https://github.com/NixOS/nixpkgs/compare/47535768ad5fc10f72e2db33a6e2c2bcdb356bd6..a5e9d9ce6f011e9b7e620d17d6c745d5a36bab96

@wolfgangwalther wolfgangwalther marked this pull request as ready for review September 7, 2025 16:47
@nix-owners nix-owners bot requested a review from hsjobeki September 7, 2025 16:48
@nixpkgs-ci nixpkgs-ci bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: module system About "NixOS" module system internals 6.topic: lib The Nixpkgs function library labels Sep 7, 2025
emilazy and others added 3 commits September 7, 2025 18:45
It’s questionable whether or not this worked – 32‐bit ARM in
Nixpkgs is already flaky even when cross‐compiling, and I find
it dubious whether much 32‐bit ARM hardware can build modern
GHCs in a bearable amount of time and memory – and figuring out
cross‐compilation of bootstrap GHCs will be a more sustainable way
to keep it working if anyone cares enough to.

Also, rearrange the GHC‐related release notes to be in order of
most likely to matter to anyone.
Also, rearrange the GHC‐related release notes to be in order of
most likely to matter to anyone.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
@nixpkgs-ci nixpkgs-ci bot 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 Sep 7, 2025
@emilazy
Copy link
Member Author

emilazy commented Sep 7, 2025

Everything good to move forward with merging this and #440271 so I can rebase #440273, then?

@wolfgangwalther
Copy link
Contributor

I'm happy with this one here, if we find anything else to cleanup we can do so later.

@wolfgangwalther wolfgangwalther merged commit a9b8698 into NixOS:master Sep 7, 2025
30 of 33 checks passed
@emilazy emilazy deleted the push-lulmxkymqlvo branch September 7, 2025 18:05
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 6.topic: lib The Nixpkgs function library 6.topic: module system About "NixOS" module system internals 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 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. 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.

3 participants