Skip to content
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

Update to GHC 9.4 #1096

Merged
merged 6 commits into from
Oct 25, 2023
Merged

Update to GHC 9.4 #1096

merged 6 commits into from
Oct 25, 2023

Conversation

arcz
Copy link
Member

@arcz arcz commented Jul 17, 2023

No description provided.

@arcz arcz requested a review from ggrieco-tob as a code owner July 17, 2023 10:18
@siraben
Copy link
Contributor

siraben commented Jul 17, 2023

nix develop fails on aarch64-darwin due to reference cycle in ormolu, part of haskell-language-server

error: cycle detected in build of '/nix/store/6v4rk8xbnzhxaxpnllbfvj5d4nhsrwy7-ormolu-0.5.3.0.drv' in the references of output 'bin' from output 'out'

@siraben siraben closed this Jul 17, 2023
@siraben siraben reopened this Jul 17, 2023
@hellwolf
Copy link

ping this one, nixpkgs master also switched to ghc94

@hellwolf
Copy link

Fwiw, I created a patch in nixpkgs upstream to fix the build: NixOS/nixpkgs#251919

@ggrieco-tob
Copy link
Member

This looks ready to go, but it looks some builds are broken? @arcz

GHC 9.4 has changed toolchains to Clang, which causes issues when building
with our current setup. We perform the following changes to support
GHC 9.4 and later:

  * Use MSYS2 CLANG64 MSYS. See https://gitlab.haskell.org/ghc/ghc/-/issues/22561
  * Use MSYS2 minimal $PATH. There's many things in the default GitHub
    environment that cause conflicts. To achieve this, we have to also
    manually re-add the Stack, Cabal and GHC paths.
  * Bump the Stack resolver. GHC 9.4.7 has some compilation fixes that
    are good to have around.
  * Replace the GHC linker with our MSYS2 linker. The GHC linker is old
    (~LLVM 14?) and does not fully understand the static libraries
    produced by the newer Clang 17 in MSYS2.
  * Refactor the way we invoke Stack and take advantage of the Stack
    config to indicate extra library and include paths.
  * Drop the 'strip' workaround for the test suite, as it is not needed
    any longer.
  * Fix the linking of the standard C++ library. GHC 9.4 introduces a
    nice way to do it in a platform-independent way, but unfortunately
    it does not work properly in Nix and it attempts to link clang++
    instead of libc++.so, so we have to use some trickery.

        addDLL: stdc++ or dependencies not loaded. (Win32 error 126)

See also:
  * https://gitlab.haskell.org/ghc/ghc/-/issues/22738
  * https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#link-against-system-cxx-std-lib-instead-of-stdc
@elopez elopez force-pushed the ghc-9.4 branch 2 times, most recently from 6ab4523 to 5293768 Compare October 24, 2023 17:39
@arcz arcz merged commit e03efba into master Oct 25, 2023
15 checks passed
@arcz arcz deleted the ghc-9.4 branch October 25, 2023 15:23
elopez added a commit that referenced this pull request Oct 31, 2023
This was not committed with #1096 by mistake.
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