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

Make nixpkgs GHC 9.6.x work #1921

Merged
merged 10 commits into from
Dec 11, 2023
Merged

Make nixpkgs GHC 9.6.x work #1921

merged 10 commits into from
Dec 11, 2023

Conversation

avdv
Copy link
Member

@avdv avdv commented Jul 14, 2023

Fixes #1920 and fixes #2031

Note that I had to skip the profiling test //tests/haskell_module/dep-narrowing-th:Test on macos for GHC 9.6 as it crashes calling ghc-iserv, see #2073.

@avdv avdv force-pushed the nixpkgs-ghc-9.6 branch 6 times, most recently from 0e341c6 to 9370fdd Compare August 4, 2023 09:02
@avdv avdv force-pushed the nixpkgs-ghc-9.6 branch 6 times, most recently from 9a5f186 to 2e4dd52 Compare November 16, 2023 09:13
@avdv avdv force-pushed the nixpkgs-ghc-9.6 branch 4 times, most recently from b4c41fd to d51957b Compare December 4, 2023 16:24
Some newer GHC versions have the `package.conf.d` below a `lib` directory.
... on Windows.

The pkg conf file for rts has entries for `haddock-interface` and `haddock-html`
but neither of those actually exist.
In previous GHC versions from nixpkgs, the `otool` setting was referencing a tool in the nix store,
but for GHC 9.6.2 it is just set to "otool" which means it must be in `$PATH`.

The same applies to the `install_name_tool`.

See NixOS/nixpkgs#267250 and https://gitlab.haskell.org/ghc/ghc/-/issues/24211

We work around by using the location of the `ar` command and assume the other tools (from the bintools
package) are also available at the same place.
@avdv avdv force-pushed the nixpkgs-ghc-9.6 branch 4 times, most recently from 6a27d24 to 019cb74 Compare December 7, 2023 08:17
Trying to build this results in a bus error with ghc-iserv.
@avdv avdv requested a review from aherrmann December 7, 2023 11:15
@avdv avdv marked this pull request as ready for review December 7, 2023 11:15
Copy link
Member

@aherrmann aherrmann left a comment

Choose a reason for hiding this comment

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

Thank you!

Comment on lines +127 to +134
if hs.toolchain.is_darwin:
# assume `otool` and `install_name_tool` are available at the same location as `ar`
ar_bindir = paths.dirname(cc.tools.ar)

compile_flags += [
"-pgmotool=" + paths.join(ar_bindir, "otool"),
"-pgminstall_name_tool=" + paths.join(ar_bindir, "install_name_tool"),
]
Copy link
Member

Choose a reason for hiding this comment

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

I suspect this may fail for users that try to use a hermetic bindist cc toolchain like grail's llvm toolchain. I'm fine with this for now as it is an improvement over the status quo. But, from what I understand so far, this may not cover all use-cases, yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we probably will need a better solution to this in the future.

@avdv avdv added the merge-queue merge on green CI label Dec 11, 2023
@mergify mergify bot merged commit 7c484ed into master Dec 11, 2023
50 checks passed
@mergify mergify bot deleted the nixpkgs-ghc-9.6 branch December 11, 2023 11:00
@mergify mergify bot removed the merge-queue merge on green CI label Dec 11, 2023
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.

add full support for GHC 9.6 nixpkgs X is not a toolchain library
2 participants