Skip to content
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

Spurious "directory does not exist" warnings when building py_proto_library with external proto_library #1707

Closed
phst opened this issue Jan 19, 2024 · 3 comments · Fixed by #1933

Comments

@phst
Copy link
Contributor

phst commented Jan 19, 2024

🐞 bug report

Affected Rule

The issue is caused by the rule: py_proto_library

Is this a regression?

I think some combinations of protobuf and rules_python didn't print this message in the past, but I'm not sure.

Description

When creating a py_proto_library rule that depends on a well-known type in the protobuf repo, building it will generate spurious warnings of the form

warning: directory does not exist

🔬 Minimal Reproduction

Create a trivial Bazel workspace

  • MODULE.bazel:

    bazel_dep(name = "protobuf", version = "23.1")
    bazel_dep(name = "rules_python", version = "0.28.0")
  • BUILD:

    load("@rules_python//python:proto.bzl", "py_proto_library")
    
    py_proto_library(
        name = "any_py_proto",
        deps = ["@protobuf//:any_proto"],
    )

🔥 Exception or Error

Output of bazel build :any_py_proto:

[...]
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/empty_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/source_context_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/any_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/duration_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/api_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/field_mask_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/struct_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/timestamp_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/type_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/wrappers_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/compiler/plugin_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
INFO: From ProtoCompile external/protobuf~23.1/python/google/protobuf/descriptor_pb2.py:
external/protobuf~23.1/.: warning: directory does not exist.
[...]

🌍 Your Environment

macOS Sonoma

Build label: 7.0.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Jan 18 18:05:58 2024 (1705601158)
Build timestamp: 1705601158
Build timestamp as int: 1705601158

Rules_python version:

0.28

Anything else relevant?

Not sure whether this is an issue with rules_python, protobuf, or Bazel itself. bazelbuild/bazel#7157 and envoyproxy/envoy#28479 seem related.

@phst
Copy link
Contributor Author

phst commented Jan 19, 2024

protocolbuffers/protobuf#6049 also looks related.

@phlax
Copy link
Contributor

phlax commented Jan 24, 2024

this is a recurring issue - it was fixed a while back - i forget which protobuf version and has been present in the last few

github-merge-queue bot pushed a commit that referenced this issue Jun 5, 2024
Protobuf team is taking ownership of `py_proto_library` and the
implementation was moved to protobuf repository.

Remove py_proto_library from rules_python, to prevent divergent
implementations.

Make a redirect with a deprecation warning, so that this doesn't break
any users.

Expected side effect of this change is also that the protobuf version is
sufficiently updated that there is no more use of legacy struct
providers.

Closes #1935 
Closes #1924 
Closes #1925 
Closes #1703 
Closes #1707 
Closes #1597 
Closes #1293 
Closes #1080
Fixes #1438
@xuj8
Copy link

xuj8 commented Jan 24, 2025

this isn't solved it just got moved to the protobuf library which still has this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants