Add well known repos to the go_proto_compiler deps#1166
Merged
ianthehat merged 1 commit intobazel-contrib:masterfrom Dec 20, 2017
Merged
Add well known repos to the go_proto_compiler deps#1166ianthehat merged 1 commit intobazel-contrib:masterfrom
ianthehat merged 1 commit intobazel-contrib:masterfrom
Conversation
Fixes bazel-contrib#944 But we also need gazelle to stop generating the deps now
jayconrod
approved these changes
Dec 20, 2017
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
Before that the users had to rely on patching the actual wheel files and uploading them as different versions to internal artifact stores if they needed to modify the wheel dependencies. This is very common when breaking dependency cycles in `pytorch` or `apache-airflow` packages. With this feature we can support patching external PyPI dependencies via pip.override tag class to fix package dependencies and/or a broken `RECORD` metadata file. Overall design: * Split the `whl_installer` CLI into two parts - downloading and extracting. Merged in bazel-contrib#1487. * Add a starlark function which extracts the downloaded wheel applies patches and repackages a wheel (so that the extraction part works as before). * Add a `override` tag_class to the `pip` extension and allow users to pass patches to be applied to specific wheel files. * Only the root module is allowed to apply patches. This is to avoid far away modules modifying the code of other modules and conflicts between modules and their patches. Patches have to be in `unified-diff` format. Related bazel-contrib#1076, bazel-contrib#1166, bazel-contrib#1120
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
This patch reworks the `pip_repository` machinery to allow users to
manually annotate groups of libraries which form packaging cycles in
PyPi and must be simultaneously installed.
The strategy here is to transform any dependencies `A` and `B` which
have dependencies and are mutually dependent
```mermaid
graph LR;
A-->B;
A-->D;
A-->E;
B-->A;
B-->F;
B-->G;
```
into a new "dependency group" `C` which has `A*` and `B*` as
dependencies, defined as `A` and `B` less any direct dependencies which
are members of the group. This is viable _for python_ because Python
files just need to be emplaced into a runfiles directory for the
interpreter. We don't actually have a true hard dependency between the
build definition of `A` requiring the build product `B` be available
which requires that the build product of `A` be available.
```mermaid
graph LR
C-->A*;
A*-->D;
A*-->E;
C-->B*;
B*-->F;
B*-->G;
```
This gets us most of the way there, as a user can now safely write
`requirement("A")` and we can provide them with `C`, which has the
desired effect of pulling in `A`, `B` and their respective transitives.
There is one remaining problem - a user writing `deps =
[requirement("A"), requirement("B")]` will take a double direct
dependency on `C`. So we need to insert a layer of indirection,
generating `C_A` and `C_B` which serve only as unique aliases for `C` so
that we can support the double dependency. Our final dependency graph
then is as follows
```mermaid
graph LR
C_A-->C;
C_B-->C;
C-->A*;
A*-->D;
A*-->E;
C-->B*;
B*-->F;
B*-->G;
```
Addresses bazel-contrib#1076, bazel-contrib#1188
## To do
- [x] Get rebased
- [x] Get re-validated manually
- [x] Buildifier
- [x] Get CI happy
- [x] Update documentation
- [x] Update changelog
---------
Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
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.
Fixes #944
But we also need gazelle to stop generating the deps now