-
Notifications
You must be signed in to change notification settings - Fork 699
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
Cabal: Use -flink-rts when available #7764
Conversation
This appears to fix the original ticket on Windows. However, my testing on Linux suggests that this feature is actually slightly broken on that platform. Specifically, |
Is it broken with GHC 8.10 as well? I assume it was broken for a long time? |
Indeed, as far as I can tell this is just a hole in the design. Specifically, one can only expect to build a |
Sounds reasonable. I think, as long as the error messages are clear, it's less surprising when stuff refuses to build and asks to enable |
Unfortunately the issue is even more confused than I initially thought. It appears that, in an attempt to mitigate the issue described above, Ultimately GHC doesn't make things easier here as it defines |
It appears that the |
Thinking about this a bit more, I suspect that this is due to the fact that the author wanted a "standalone" library to have no dynamic dependencies. That is, they expected GHC to link against static Haskell dependencies. However, it's unclear to me how this could have ever worked on platforms that require dynamic libraries to be PIC since, while Cabal does pass |
Couldn't we use |
@bgamari: any news? |
@Bodigrim points our attention to https://gitlab.haskell.org/ghc/ghc/-/issues/20520#note_411402, citing:
@bgamari: do you have any vague suggestions how to fix that in Cabal? |
I think based on discussion that this is a strict improvement, but there remain cases that make no sense in general with the static/dynamic issue. So we should merge this, but also open a new ticket trying to specify what the semantics actually are. |
This does not seem to resolve the reproducer in https://gitlab.haskell.org/ghc/ghc/-/issues/20520, and I'm not qualified to jusge about other benefits. |
Oh dear, I thought it does, based on "This appears to fix the original ticket on Windows." @bgamari: do we need to do anything more to fix the original issue? Remove the |
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.
Sorry for confusion, I tested a wrong branch. This indeed fixes the reproducer.
@Mergifyio rebase |
Previously Cabal did quite some headstands to link against libHSrts. Note only this is complex but it couples very tightly to GHC's implementation. Thankfully, as of GHC 9.0 GHC provides a `-flink-rts` flag for precisely this purpose. Use it when available.
✅ Branch has been successfully rebased |
4f742e3
to
f1560d1
Compare
It seems haskell#7764 fixed the test, but the pr was merged without having the ci green
This should had included a changelog entry, added in #8111 |
Previously Cabal did quite some headstands to link against libHSrts.
Note only this is complex but it couples very tightly to GHC's
implementation. Thankfully, as of GHC 9.0 GHC provides a
-flink-rts
flag for precisely this purpose. Use it when available.
Fixes #7763.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!