stack_snapshot: vendored_packages - #1060
Merged
Merged
Conversation
This feature allows overriding packages in the snapshot with targets defined manually. Useful when the source distribution needs to be patched, or when the `BUILD` file needs to be customized.
Before vendored packages were only used when generating the `BUILD` file to override `deps` attribute to `haskell_cabal_library`. However, this did not affect stack's dependency graph generation. A vendored package could have a different Cabal file introducing different package dependencies. Furthermore, the generated target for a vendored package would still point to the unvendored original version. This change takes this into account, by pointing stack to the source directories of the vendored packages. It also changes the generated targets to be aliases to the vendored target. This requires the vendored target to contain a Cabal file at the top-level which is not a generated file.
Exports the stack generated dependency graph, so that Starlark code can import and use this information. E.g. a vendored package could import the dependency graph into the BUILD file and use it to define the package dependencies instead of manually hard-coding them.
Adds an example usage of vendored_packages to bump cabal version bounds.
mboes
approved these changes
Sep 8, 2019
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 based on #910 but based on latest master and adds a few more features.
vendored_packagesattribute tostack_snapshotin the same form as [WIP] Implement stack_snapshot.vendored_packages #910. To be used asIn [WIP] Implement stack_snapshot.vendored_packages #910 stack would still look at the non-vendored
unpacked version of e.g.splitin the above example. That means that if the vendored version changes the dependency graph, then stack would not pick up this change. Here stack will be pointed to the vendored package instead.packages.bzl.This allows to load the dependencies of a vendored package from that file, instead of having to hard-code it manually.
examplesrepository.Closes #910