Skip to content

haskellPackages: fixes for pkgsCross.ucrt64#357744

Merged
alexfmpe merged 4 commits intoNixOS:haskell-updatesfrom
alexfmpe:ghc-9.10-ucrt64
Jul 13, 2025
Merged

haskellPackages: fixes for pkgsCross.ucrt64#357744
alexfmpe merged 4 commits intoNixOS:haskell-updatesfrom
alexfmpe:ghc-9.10-ucrt64

Conversation

@alexfmpe
Copy link
Member

@alexfmpe alexfmpe commented Nov 21, 2024

Allows building a ton of non-TH libs under pkgsCross.ucrt64.haskell.packages.ghc910, with TH libs triggering the same error as in #355543. But linking seems pretty broken for ucrt64.haskell.packages.

pkgsCross.ucrt64.haskell.packages.ghc910.hello fails with a gazillion undefined reference to what look like RTS symbols.

Preprocessing executable 'hello' for hello-1.0.0.2...
Building executable 'hello' for hello-1.0.0.2...
[1 of 1] Compiling Main             ( src/hello.hs, dist/build/hello/hello-tmp/Main.o )
[2 of 2] Linking dist/build/hello/hello.exe
/nix/store/gzr1ys4rd4mfrvlx9pl915q3km7asjaf-x86_64-w64-mingw32-binutils-2.43.1/bin/x86_64-w64-mingw32-ld: /nix/store/25nmznm3z4wpvz3l41kxzncrgjxaal9j-x86_64-w64-mingw32-ghc-9.10.1/lib/x86_64-w64-mingw32-ghc-9.10.1/lib/../lib/x86_64-windows-ghc-9.10.1/ghc-internal-9.1001.0-inplace/libHSghc-internal-9.1001.0-inplace.a(Base.o):fake:(.text+0x1b): undefined reference to `__imp_ghczmprim_GHCziTypes_True_closure'
/nix/store/gzr1ys4rd4mfrvlx9pl915q3km7asjaf-x86_64-w64-mingw32-binutils-2.43.1/bin/x86_64-w64-mingw32-ld: /nix/store/25nmznm3z4wpvz3l41kxzncrgjxaal9j-x86_64-w64-mingw32-ghc-9.10.1/lib/x86_64-w64-mingw32-ghc-9.10.1/lib/../lib/x86_64-windows-ghc-9.10.1/ghc-internal-9.1001.0-inplace/libHSghc-internal-9.1001.0-inplace.a(Base.o):fake:(.text+0x43): undefined reference to `__imp_ghczmprim_GHCziTypes_True_closure'
/nix/store/gzr1ys4rd4mfrvlx9pl915q3km7asjaf-x86_64-w64-mingw32-binutils-2.43.1/bin/x86_64-w64-mingw32-ld: /nix/store/25nmznm3z4wpvz3l41kxzncrgjxaal9j-x86_64-w64-mingw32-ghc-9.10.1/lib/x86_64-w64-mingw32-ghc-9.10.1/lib/../lib/x86_64-windows-ghc-9.10.1/ghc-internal-9.1001.0-inplace/libHSghc-internal-9.1001.0-inplace.a(Base.o):fake:(.text+0x6b): undefined reference to `__imp_ghczmprim_GHCziTypes_True_closure'
/nix/store/gzr1ys4rd4mfrvlx9pl915q3km7asjaf-x86_64-w64-mingw32-binutils-2.43.1/bin/x86_64-w64-mingw32-ld: /nix/store/25nmznm3z4wpvz3l41kxzncrgjxaal9j-x86_64-w64-mingw32-ghc-9.10.1/lib/x86_64-w64-mingw32-ghc-9.10.1/lib/../lib/x86_64-windows-ghc-9.10.1/ghc-internal-9.1001.0-inplace/libHSghc-internal-9.1001.0-inplace.a(Base.o):fake:(.text+0xb1): undefined reference to `__imp_newCAF'
/nix/store/gzr1ys4rd4mfrvlx9pl915q3km7asjaf-x86_64-w64-mingw32-binutils-2.43.1/bin/x86_64-w64-mingw32-ld: /nix/store/25nmznm3z4wpvz3l41kxzncrgjxaal9j-x86_64-w64-mingw32-ghc-9.10.1/lib/x86_64-w64-mingw32-ghc-9.10.1/lib/../lib/x86_64-windows-ghc-9.10.1/ghc-internal-9.1001.0-inplace/libHSghc-internal-9.1001.0-inplace.a(Base.o):fake:(.text+0xc3): undefined reference to `__imp_stg_bh_upd_frame_info'
...
~ 50k lines
...

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.

@alexfmpe alexfmpe requested a review from Ericson2314 November 21, 2024 02:19
@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Nov 21, 2024
@sternenseemann
Copy link
Member

Consider updating release-cross.nix to build ucrt including haskell stuff!

@ofborg ofborg bot added the ofborg-internal-error Ofborg encountered an error label Nov 22, 2024
@alexfmpe
Copy link
Member Author

Consider updating release-cross.nix to build ucrt including haskell stuff!

That's fine with me, but I wonder if we should take hydra resources for something which is still broken in several ways.

  1. TH
  2. building haskell executables
  3. running executables
$ wine $(nix-build -A pkgsCross.ucrt64.hello)/bin/hello
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:err:plugplay:enumerate_new_device Unable to install a function driver for device L"WINEBUS\\VID_845E&PID_0001\\0&0000&0&0".
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:err:plugplay:enumerate_new_device Unable to install a function driver for device L"WINEBUS\\VID_845E&PID_0002\\0&0000&0&0".
wine: failed to open "/nix/store/r0n87ripkcrmq8qyn794gv99xvcysr5q-hello-x86_64-w64-mingw32-2.12.1/bin/hello": c0000135

On the other hand, having regression testing prevents things from getting more broken again

@ofborg ofborg bot removed the ofborg-internal-error Ofborg encountered an error label Feb 8, 2025
@alexfmpe
Copy link
Member Author

alexfmpe commented Feb 8, 2025

This no longer works with 9.10 due to toolchain upgrades, and would need a good deal of backporting on our end to fix. On the plus side, 9.12 now builds to the same level 9.10 did when PR was first opened.
That is, TH doesn't work and executables fail to build, but rest seems fine.

Consider updating release-cross.nix to build ucrt including haskell stuff!

9.12 only is fine?

@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Feb 8, 2025
@nix-owners nix-owners bot requested review from cdepillabout and guibou February 8, 2025 03:56
@sternenseemann
Copy link
Member

9.12 only is fine?

I think by default it tests the default version and ghcHEAD which may be close enough?! Maybe should be reworked a bit there though.

Copy link
Member

@sternenseemann sternenseemann left a comment

Choose a reason for hiding this comment

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

LGTM, though I haven't tested anything myself.

@alexfmpe
Copy link
Member Author

alexfmpe commented Feb 9, 2025

I'm a bit reluctant to adding a UCRT haskell entry to release-* jobs until executables can actually be built.
Shall we land this as-is after making an upstream issue for the win32-no-hsc2hs bit ?

@wegank wegank added 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 12.approvals: 1 This PR was reviewed and approved by one person. labels Feb 10, 2025
@sternenseemann
Copy link
Member

I'm a bit reluctant to adding a UCRT haskell entry to release-* jobs until executables can actually be built.

Understood, though release-cross.nix is kind of a jobset of failures in some ways…

Shall we land this as-is after making an upstream issue for the win32-no-hsc2hs bit ?

Whatever suits you. I think we could definitely land parts of it, e.g. the split sections stuff.

@alexfmpe
Copy link
Member Author

Understood, though release-cross.nix is kind of a jobset of failures in some ways…

Oh heh then I guess it's fine, added microlens and kept hello commented

Whatever suits you. I think we could definitely land parts of it, e.g. the split sections stuff.

I just noticed for some reason the win32 patch isn't needed when building 9.12 so guess I'll just toss that out as well as the rts backport and simply not bother with 9.10 at all

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 14, 2025
@github-actions github-actions bot removed 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Feb 26, 2025
@github-actions github-actions 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 Feb 26, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 7, 2025
@nix-owners nix-owners bot requested a review from wolfgangwalther May 16, 2025 17:21
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 16, 2025
@alexfmpe alexfmpe changed the title haskellPackages: fixes for pkgsCross.ucrt haskellPackages: fixes for pkgsCross.ucrt64 Jun 9, 2025
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Jun 25, 2025
@alexfmpe alexfmpe merged commit 0b0059b into NixOS:haskell-updates Jul 13, 2025
20 of 21 checks passed
@alexfmpe alexfmpe deleted the ghc-9.10-ucrt64 branch September 15, 2025 21:50
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: 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. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants