-
Notifications
You must be signed in to change notification settings - Fork 182
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
@com_google_protobuf is used, but never declared as dependency in any of the workspace set-up #865
Comments
Is there a particular thing for the XLS project's setup to do/fix here? I may be missing the actionable part. Or is this more of a Bazel bug? In the project as Bazel users we generally assume that we can use constructs like
|
The actionable part would be to add all the dependencies needed in the WORKSPACE or load_external.bzl part to not rely on dependencies (such as The com_google_protobuf is not something that comes with bazel by default, so it maybe is inherit it with something else like grpc (don't know which is is, this is why I stumbled upon it) |
In the process of marking this closed now -- summary of why it actually seems better to let transitive dependency versions float with the way we currently do things is given in #931 (comment) It seems like the right solution that would actually help us detect version conflicts between our needs and transitive dependency needs would be to switch to bzlmod -- the "maybe pull this archive and bind it to name @some_module" expression model that Bazel uses in WORKSPACE files right now doesn't make pinning up front inherently more effective at finding compatibility issues, while introducing more work. We could list all the things that are pulled directly, but that would get stale because there's no cross checking. I'll leave a one liner here in case it's useful for those sorts of purposes in the future:
I think I'll close this out with a warning comment that just says "there are more direct dependencies than are listed in this file", see $THIS_GITHUB_ISSUE for details. |
Closed via c37d7ad |
Sounds like a reasonable approach given the |
- bump bazelisk - pin bazel version in environment rational: bazel 7.0 is a major update that require some coordinated update of some transitive external deps (see google#865) and switching to bzlmod (see google#931); let's pin it first to un-break the CI.
The com_google_protobuf rule is used as a direct dependency in various rules within xls:
Yet, it is never declared as such in any of the workspace set-up, but apparently it is only initialized there, assuming it is magically there:
It is only initialized, so it looks like it is 'accidentally' imported by some of the other dependencies that this happens to work ?
It would be good to be able to reason what dependencies come into the project., by either explicit way to either explicitly adding them to the dependency files, or declare them otherwise (don't know if there is an alias of sort, but at least a comment in the
WORKSPACE
file would help# @com_google_protobuf provided from from @mystery_import
).That way it is possible to read and understand and track down weird issues (recent issue: the magically imported google protobuf python rule that was there, but that didn't work).
While at it, maybe there are more rules that are used but never declared ?
Essentially, we need an
IWYU
for bazel rules :)The text was updated successfully, but these errors were encountered: