Avoid absolute RUNPATH to rts in GHC bindist #1131
Merged
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.
Closes #1127
Before, rules_haskell only carried the non-threaded runtime library (
libHSrts
) as aLibraryToLink
, while the threaded runtime library (libHSrts_thr
) was completely ignored. ThereforelibHSrts_thr
was missing in the sandbox when linking with-threaded
and thecc_wrapper
could not purge the absoluteRUNPATH
to the GHC bindist that GHC generates automatically.This PR adds
libHSrts_thr
to the tracked libraries, so thatcc_wrapper
can purge the absoluteRUNPATH
entry.To avoid duplicate runtime libraries
haskell_toolchain_libraries_impl
chooses whether to forward the threaded or non-threaded runtime library based on whether-threaded
is in the toolchain'scompiler_flags
. Ideally, this should be configurable on a per-target basis using Bazel configurations and transitions. However, given that previously only the non-threaded version of the library was tracked, this is no worse than the previous situation and the switch to configurations can be handled in a separate PR.