Reproducible interface files for Cabal packages with C dependencies - #1689
Merged
Conversation
Currently fails with the following steps: ``` $ n=1; bazel clean; sudo rm -rf output$n; bazel build //tests/haskell_cabal_reproducibility/pkg-b --execution_log_json_file=execlog$n.json; rsync -aL bazel-bin output$n $ n=2; bazel clean; sudo rm -rf output$n; bazel build //tests/haskell_cabal_reproducibility/pkg-b --execution_log_json_file=execlog$n.json; rsync -aL bazel-bin output$n $ diff -ur output1 output2 $ diff -u <(ghc --show-iface output1/bazel-bin/tests/haskell_cabal_reproducibility/pkg-a/_install/pkg-a-0.1.0.0_iface/LibA.dyn_hi) <(ghc --show-iface output2/bazel-bin/tests/haskell_cabal_reproducibility/pkg-a/_install/pkg-a-0.1.0.0_iface/LibA.dyn_hi) ```
Collaborator
|
Thanks a lot! |
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.
This is the continuation of #1648 addressing the case where a Cabal target has C dependencies.
Addresses the non-reproducible interface files aspect of #1600.
As described in haskell/cabal#1317 (comment) we can avoid passing absolute C header and library search paths to Cabal builds if we do not call
Setup.hs install.Setup.hs installfails if the configuration contains relative paths. Instead, we callSetup.hs copyto copy the generated files and then generate a package configuration file withSetup.hs register --gen-pkg-config, patch it to replace relative paths by paths starting with${pkgroot}, and then invokeghc-pkgdirectly to cache the package-db.This adds a test-case that be used to confirm that the build is now reproducible.
When #1645 is merged this could be turned into an integration test.