Skip to content

nix: default ghc to version 9.6.3 #5439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2023
Merged

nix: default ghc to version 9.6.3 #5439

merged 1 commit into from
Oct 31, 2023

Conversation

mgmeier
Copy link
Contributor

@mgmeier mgmeier commented Aug 16, 2023

Description

This PR adds GHC 9.6.3 via haskell.nix to CI.

@mgmeier mgmeier added the WIP Work In Progress (cannot be merged yet) label Aug 16, 2023
@angerman angerman self-assigned this Aug 25, 2023
@angerman
Copy link
Contributor

I finally found the culprit:

    -- GHC 9.4.5, 9.6.1, and 9.6.2 on Windows do not link against mingwex, but
    -- unix-time implicitly depends on this library due to the use of the
    -- gettimeofday() function, which comes from mingwex on Windows. To avoid
    -- linker errors in the absence of a mingwex dependency (see
    -- https://gitlab.haskell.org/ghc/ghc/-/issues/23533 for an example of
    -- this), we depend on mingwex explicitly here.
    --
    -- Other versions of GHC on Windows already depend on mingwex, so we guard
    -- this behind appropriate conditionals.

from unix-time.

so, now let's see how to resolve this properly.

@angerman
Copy link
Contributor

/nix/store/i7xqxj6xh1hzi06n2vw89i3l3pjk5pbc-x86_64-w64-mingw32-ghc-9.6.2/lib/x86_64-windows-ghc-9.6.2/ghc-prim-0.10.0/HSghc-prim-0.10.0.o: unhandled PEi386 relocation type 14

That failure is a bit more annoying than it should be.

@angerman
Copy link
Contributor

Status update:

Still two more issue:

  • ghc dropped ghci lib support, which I think is somewhat misguided, but now we are left with very slow library loading, to the point where this eventually fails. 🎉
  • genprimops is missing and not properly declared as a dependency of lib:ghc 🤦

@angerman
Copy link
Contributor

Turns out we now try to access sincos (a mingwex symbol) from Win32, and of course we haven't loaded that at that point 🤦 That will need an extra symbol. At least we know how to do that.

  • lib:ghc was solved for now by not depending on reinstalalble lib:ghc. Not ideal but seems to work.
  • the ghci issue seems to rather be limitation in cabal Partially revert #8071 haskell/cabal#9220
  • now we also have one more issue in haskell.nix which breaks the build of OpenSSL.

@angerman
Copy link
Contributor

angerman commented Sep 1, 2023

Ok. I think we got most of it, not all of it yet...

[11 of 11] Linking dist/build/trace-dispatcher-examples/trace-dispatcher-examples.exe
/nix/store/fkr9ji0hdzw56y3vk9hhmgzbkhd4v1p8-x86_64-w64-mingw32-binutils-2.35.2/bin/x86_64-w64-mingw32-ld: /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a(lib64_libucrt_extra_a-ucrtbase_compat.o):(.text+0x10): multiple definition of `__getmainargs'; /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmsvcrt.a(libmsvcrt_defs00081.o):(.text+0x0): first defined here
/nix/store/fkr9ji0hdzw56y3vk9hhmgzbkhd4v1p8-x86_64-w64-mingw32-binutils-2.35.2/bin/x86_64-w64-mingw32-ld: /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a(lib64_libucrt_extra_a-ucrtbase_compat.o):(.text+0xf0): multiple definition of `_onexit'; /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmsvcrt.a(libmsvcrt_defs00556.o):(.text+0x0): first defined here
/nix/store/fkr9ji0hdzw56y3vk9hhmgzbkhd4v1p8-x86_64-w64-mingw32-binutils-2.35.2/bin/x86_64-w64-mingw32-ld: /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a(lib64_libucrt_extra_a-ucrtbase_compat.o):(.text+0x130): multiple definition of `_amsg_exit'; /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmsvcrt.a(libmsvcrt_defs00120.o):(.text+0x0): first defined here
/nix/store/fkr9ji0hdzw56y3vk9hhmgzbkhd4v1p8-x86_64-w64-mingw32-binutils-2.35.2/bin/x86_64-w64-mingw32-ld: /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a(lib64_libucrt_extra_a-ucrtbase_compat.o):(.text+0x1e0): multiple definition of `_tzset'; /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmsvcrt.a(libmsvcrt_defs00722.o):(.text+0x0): first defined here
/nix/store/fkr9ji0hdzw56y3vk9hhmgzbkhd4v1p8-x86_64-w64-mingw32-binutils-2.35.2/bin/x86_64-w64-mingw32-ld: /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a(lib64_libucrt_extra_a-ucrtbase_compat.o):(.data+0x18): multiple definition of `__imp__amsg_exit'; /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmsvcrt.a(libmsvcrt_defs00120.o):(.idata$5+0x0): first defined here
/nix/store/fkr9ji0hdzw56y3vk9hhmgzbkhd4v1p8-x86_64-w64-mingw32-binutils-2.35.2/bin/x86_64-w64-mingw32-ld: /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a(lib64_libucrt_extra_a-ucrtbase_compat.o):(.data+0x28): multiple definition of `__imp___getmainargs'; /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmsvcrt.a(libmsvcrt_defs00081.o):(.idata$5+0x0): first defined here
/nix/store/fkr9ji0hdzw56y3vk9hhmgzbkhd4v1p8-x86_64-w64-mingw32-binutils-2.35.2/bin/x86_64-w64-mingw32-ld: /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a(lib64_libucrt_extra_a-ucrtbase_compat.o):(.data+0x70): multiple definition of `__imp__onexit'; /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmsvcrt.a(libmsvcrt_defs00556.o):(.idata$5+0x0): first defined here
collect2: error: ld returned 1 exit status
x86_64-w64-mingw32-ghc: `x86_64-w64-mingw32-cc' failed in phase `Linker'. (Exit code: 1)

sigh.

@angerman
Copy link
Contributor

angerman commented Sep 2, 2023

So that one I also figured out, it's due to unix-compat depending on msvcrt yet, ghc now building against ucrt.
But that has some other fun issue with mingwex as well :( Lots of

Symbol type mismatch.
Symbol _cabs was defined by /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libmingwex.a to be a code symbol.
      yet was defined by /nix/store/jd99w2qxhi9m8p4bmy3mnw31gd9x5ajc-mingw-w64-x86_64-w64-mingw32-10.0.0/lib/libucrt.a to be a data symbol.

(and similar) are now blocking the build.

@angerman
Copy link
Contributor

angerman commented Sep 2, 2023

@angerman angerman force-pushed the bench-try-ghc962 branch 2 times, most recently from 921fda8 to 39b1f59 Compare September 8, 2023 08:07
@angerman angerman marked this pull request as ready for review October 25, 2023 07:14
@angerman angerman changed the title nix: default ghc to version 9.6.2 nix: default ghc to version 9.6.3 Oct 25, 2023
@angerman angerman removed the WIP Work In Progress (cannot be merged yet) label Oct 26, 2023
@newhoggy newhoggy self-requested a review October 26, 2023 06:14
@hamishmack
Copy link
Contributor

I've squashed and added a TODO comment related to updating hlint (it is currently using an older version as the only one that builds with GHC 9.6.3 kicks up a lot of lint.

@angerman angerman added this pull request to the merge queue Oct 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 27, 2023
@angerman angerman added this pull request to the merge queue Oct 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 27, 2023
@angerman angerman added this pull request to the merge queue Oct 29, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 30, 2023
@angerman angerman enabled auto-merge October 30, 2023 02:09
@angerman angerman disabled auto-merge October 30, 2023 23:03
@angerman angerman enabled auto-merge October 30, 2023 23:03
@angerman angerman disabled auto-merge October 30, 2023 23:03
@angerman angerman enabled auto-merge October 30, 2023 23:03
Updates from 9.2.7 to 9.2.8.
@angerman angerman added this pull request to the merge queue Oct 31, 2023
Merged via the queue into master with commit e8cc459 Oct 31, 2023
@angerman angerman deleted the bench-try-ghc962 branch October 31, 2023 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants