-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use object code for TH+UnboxedTuples/Sums #1382
Conversation
FYI you might be interested in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4412, which will hopefully get into 9.2 and should make this work without object code. We actually use a GHC with that patch applied at work precisely so that HLS works with unboxed tuples and sums 😅 |
We have back ported the patch to 8.10.3 (and newer) and include it in haskell.nix. Any haskell.nix project that uses ghc 8.10 and has a shell created with If you use nix and want to try it out while developing |
That is good to hear, but an important question remains. Is it possible to detect the presence of this patch at compile time? We would like to merge this PR to properly support users of unpatched GHCs. However, it may have some negative impact in terms of performance, linker issues etc. for users of patched GHCs. |
I suppose it might be OK if it were possible to detect it at runtime either, but a configuration option seems less than ideal |
I'm not how we could detect the patch in ghc 8.10 (@angerman or @luite might have an idea). We could set a flag when building |
A cabal flag that is |
You could change the version number to e.g. 8.10.13, or 8.100.3 |
That might break other things that expect 8.10.3. Perhaps Then in haskell.nix we could include a patch for |
@michaelpj @hamishmack I've added a cabal flag called |
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.
It's a bit bad that we are forced to do a whole project analysis in NeedsCompilation
, which is used by other core rules like GetModIface
. But that's already the status quo, this PR doesn't make it materially worse.
I don't see a way around the whole project analysis, even GHC executes this logic in the "downsweep" step which is a whole project analysis starting from the highest nodes in the module graph and proceeding down to the leaves. |
Logic from https://gitlab.haskell.org/ghc/ghc/-/blob/963e1e9aedf0ee70d4e817640ec9845ed00ce0cf/compiler/GHC/Driver/Make.hs#L2268