-
Notifications
You must be signed in to change notification settings - Fork 645
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
Circular dependency in Bazel deps fails with cryptic error #2662
Comments
Reproduced with a small modification: in I guess the resolution here would be, when recompiling the test's internal archive, pass the builder a list of direct dependencies that are being recompiled and must not be imported. The builder could report a specific error if any of those packages are actually imported. |
Sorry for the hiccup and thanks for looking into this! This would also be an issue for
I don't have full insight to the |
For Incidentally, although that matches Go's import behavior pretty well, it causes problems for other languages like Java that allow circular imports between packages. Java developers need to put multiple packages in a single |
There's one thing I'm struggling to understand. Why is |
With That can't be done with |
I'm finally understanding the full picture here. I'm going to try to describe this as exactly as possible so we're on the same page. In the example above, let's say Prior to #2579 and rules_go 0.23.6, |
Should be fixed by #3422 |
This is a followup to #2583; in a situation where there is no cyclic dependency in Go, but a cyclic dependency in Bazel, we see errors that look irrelevant to the problem. Essentially, if some transitive dependency "over-provides" dependencies and one of those dependencies trigger a cycle, this returns an error that says an import is missing.
Previously, in prior versions of rules_go, the "over-provision" was okay; Bazel would handle these cases safely and build without triggering a cycle.
For the sake of creating a simple case, the example uses a
go_default_library
rule as the example transitive dependency, but in the case that this is a rule that generates code based on Go source code (e.g. a GoMock rule,go_proto_library
rule w/ custom compiler plugins), the exact depset is sometimes difficult to compute via Gazelle.What's the exact expected behavior here, and what is the best course of action to fix a situation like this?
What version of rules_go are you using?
0.24.3
What version of gazelle are you using?
0.22.0
What version of Bazel are you using?
3.3.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Darwin amd64
Any other potentially useful information about your toolchain?
What did you do?
What did you expect to see?
Build completed successfully
What did you see instead?
The text was updated successfully, but these errors were encountered: