-
Notifications
You must be signed in to change notification settings - Fork 81
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
Conversation
0e341c6
to
9370fdd
Compare
9a5f186
to
2e4dd52
Compare
b4c41fd
to
d51957b
Compare
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.
6a27d24
to
019cb74
Compare
Trying to build this results in a bus error with ghc-iserv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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"), | ||
] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 callingghc-iserv
, see #2073.