Skip to content

Break dependency on python/dist from python/BUILD.bazel #22633

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keith
Copy link
Contributor

@keith keith commented Jul 15, 2025

This package referenced things in python/dist, which is not loadable
from other projects since pip deps are marked as dev_dependency=True.
This resulted in this error downstream:

ERROR: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: error loading package '@@protobuf+//python/dist': Unable to find package for @@[unknown repo 'protobuf_pip_deps' requested from @@protobuf+]//:requirements.bzl: The repository '@@[unknown repo 'protobuf_pip_deps' requested from @@protobuf+]' could not be resolved: No repository visible as '@protobuf_pip_deps' from repository '@@protobuf+'.

Since this was only used to determine if the target is macOS, we can use
the platforms definition directly instead.

Fixes #22386

This package referenced things in python/dist, which is not loadable
from other projects since pip deps are marked as `dev_dependency=True`.
This resulted in this error downstream:

```
ERROR: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: error loading package '@@protobuf+//python/dist': Unable to find package for @@[unknown repo 'protobuf_pip_deps' requested from @@protobuf+]//:requirements.bzl: The repository '@@[unknown repo 'protobuf_pip_deps' requested from @@protobuf+]' could not be resolved: No repository visible as '@protobuf_pip_deps' from repository '@@protobuf+'.
```

Since this was only used to determine if the target is macOS, we can use
the platforms definition directly instead.
@keith keith requested a review from a team as a code owner July 15, 2025 20:55
@keith keith requested review from anandolee and removed request for a team July 15, 2025 20:55
@shaod2 shaod2 added 🅰️ safe for tests Mark a commit as safe to run presubmits over python bazel and removed 🅰️ safe for tests Mark a commit as safe to run presubmits over labels Jul 16, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 16, 2025
@shaod2 shaod2 requested review from zhangskz and removed request for anandolee July 16, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bazel query not working in my repo after depending on @protobuf//:protobuf_python
2 participants