-
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
Only pass -no-pie for binary targets #1424
Conversation
When using GHC 8.10, passing `-no-pie` to the linker when building libraries leads to obscure linker errors. Since PIE pertains to executables, it doesn't make much sense passing that flag when building libraries anyways. Removing it, both for `haskell_library` and `haskell_cabal_library` fixes GHC 8.10 support. We make sure to keep the flag for executables. This would otherwise negate the effect of #1388.
This PR does not change the compiler version used during testing. We still test with GHC 8.8.3 only, whereas the bug the PR is fixing only appears on GHC 8.10.*. @patrickt you may also want to confirm that this fixes the linker errors you saw when then moving Semantic to GHC 8.10. |
As per tweag/rules_haskell#1424, the linker errors associated with Actions CI should be fixed now.
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.
LGTM for the change. I'm surprised because I'm using GHC 8.10 with rules_haskell since it was released and I never had this issue on Linux.
So there may be an additional requirement (not just GHC 8.10) which triggers this issue.
Doesn’t seem to work on our end just yet:
Full backscroll here: https://github.com/github/semantic/pull/627/checks?check_run_id=1123152233 |
@patrickt I see that error with GHC 8.8 but not 8.10. Are you sure you are using 8.10? For 8.8, I'll push a workaround to the workaround. The logic is getting really complex, all to paper over a lack of proper solution to https://gitlab.haskell.org/ghc/ghc/-/issues/15319. I think we should tackle that next. |
09e9860
to
d81268f
Compare
It seems to be working now!! You’re the best, @mboes! And indeed, linker errors are my least favorite part of programming. |
When using GHC 8.10, passing
-no-pie
to the linker when buildinglibraries leads to obscure linker errors. Since PIE pertains to
executables, it doesn't make much sense passing that flag when
building libraries anyways. Removing it, both for
haskell_library
and
haskell_cabal_library
fixes GHC 8.10 support. We make sure tokeep the flag for executables. This would otherwise negate the effect
of #1388.
Fixes #1418