iserv-proxy: enable --optimistic-linking on GHC ≥ 9.14#2512
Merged
Conversation
Bake `--optimistic-linking` into iserv-proxy / iserv-proxy-interpreter at link time via `-with-rtsopts`. `GHC/Linker/Executable.hs` emits this into the generated `main.c` as `__conf.rts_opts`, which `setupRtsFlags` processes with `RtsOptsAll` — bypassing the `OPTION_UNSAFE` gate that `+RTS --optimistic-linking -RTS` on the command line is subject to. Makes the runtime linker tolerate undefined symbols when loading object files at TH-eval time; splices that don't actually reference the missing symbol then resolve fine instead of aborting the load. `-rtsopts=all` is kept so wrapper scripts / GHCRTS can still override at invocation. `--optimistic-linking` is only available in GHC's RTS from 9.14 onwards; gated on the Nix side since cabal.project doesn't allow `if` inside a `package` stanza. Refactor `cabalProjectLocal` for the iserv-proxy project from `//`-chained `optionalAttrs` blocks to a single string built via `optionalString` concatenation so the new directive can compose with the existing aarch64+<9.8 threaded gate without the last `//` clobbering it. Also drop the previous `allow-newer: *:base, *:bytestring` block on GHC > 9.10. The bounds in iserv-proxy.cabal (`base < 5`, `bytestring < 0.13`, etc.) already accommodate current GHCs; if a transitive package needs relaxation we'll re-add a more targeted allow-newer once we know which one. Pulled out of #2504 (`hkm/builder-v2`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bakes
--optimistic-linkinginto iserv-proxy / iserv-proxy-interpreter at link time via-with-rtsoptsfor GHC ≥ 9.14.GHC/Linker/Executable.hsemits this into the generatedmain.cas__conf.rts_opts, whichsetupRtsFlagsprocesses withRtsOptsAll— bypassing theOPTION_UNSAFEgate that+RTS --optimistic-linking -RTSon the command line is subject to.Effect: iserv's runtime linker tolerates undefined symbols when loading object files at TH-eval time. Splices that don't actually reference the missing symbol resolve instead of aborting the whole load.
-rtsopts=allis kept so wrapper scripts /GHCRTScan still override at invocation.--optimistic-linkingis only available in GHC's RTS from 9.14 onwards; gated on the Nix side since cabal.project doesn't allowifinside apackagestanza.Drive-by changes
cabalProjectLocalfor the iserv-proxy project from//-chainedoptionalAttrsblocks to a single string built viaoptionalStringconcatenation so the new directive composes with the existingaarch64 && <9.8threaded gate without//clobbering.allow-newer: *:base, *:bytestringblock on GHC > 9.10. The bounds iniserv-proxy.cabal(base < 5,bytestring < 0.13, etc.) already accommodate current GHCs. Hydra will tell us if a transitive package actually needs relaxation; if so we'll re-add a more targeted allow-newer once we know which one.Pulled out of #2504 (
hkm/builder-v2).