Skip to content
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

Add relative RUNPATH entries in haskell_cabal_* targets #1267

Merged
merged 5 commits into from
Mar 6, 2020

Conversation

aherrmann
Copy link
Member

haskell_cabal_binary|library targets that depended on Bazel managed dynamic C libraries (e.g. the nixpkgs provided libz for @stackage//:zlib) were missing relative RUNPATH entries. Instead, Cabal only generated absolute RUNPATH entries pointing to the sandbox's execroot, which are invalid outside that sandbox, see #1130. This can cause build failures with Cabal packages that depend transitively on dynamic C libraries, e.g. hie-bios failed to build in #1262.

This PR adds relative RUNPATH entries in the same fashion as is done for regular Haskell targets.

This PR also adds a regression test that checks for the presence of a relative RUNPATH entry.

@aherrmann aherrmann force-pushed the cabal-runpath branch 2 times, most recently from 134cd1e to 68c3cc4 Compare March 5, 2020 16:57
Copy link
Contributor

@Profpatsch Profpatsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello darkness, my old friend

py_inline_test(
name = "stackage_zlib_runpath",
args = [
"$(rootpath :libz_soname)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are solib_names exported as targets?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an output attribute that means that it becomes accessible as a label.

By default Cabal generates `RUNPATH` entries pointing to the sandbox
directory. These no longer work outside of that particular sandbox.
Adds a regression test to check that haskell_cabal_library will generate
a relative `RUNPATH` entry for the nixpkgs provided zlib.
@aherrmann aherrmann added the merge-queue merge on green CI label Mar 6, 2020
@mergify mergify bot merged commit b9db31a into master Mar 6, 2020
@mergify mergify bot deleted the cabal-runpath branch March 6, 2020 09:59
@mergify mergify bot removed the merge-queue merge on green CI label Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants