-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
cc_proto_library does not filter blacklisted protos inside the protobuf repo #10590
Comments
The Python C++ extension targets are not used unless `--@:use_fast_cpp_protos=true`, and may not even be able to build if the Python headers are missing (note that `//util/python:python_headers`, bound to `@python_headers//` in `//:WORKSPACE`, is not currently sufficient). This change adds the `"manual"` tag to these targets, so that they do not cause `bazel test ...` to fail when Python headers are missing. Without the manual tag, the targets are always selected, even if `--@:use_fast_cpp_protos=false`. The `:cc_proto_blacklist_test` target is metastable, depending on whether the `--proto_toolchain_for_cc=` flag names a target with or without the `@com_google_protobuf//` prefix. We use the correct prefix for Bazel's default in `kokoro/linux/bazel/build.sh`, but the `bazel test :cc_proto_blacklist_test` (with or without `//`) fails consistently. Hopefully, this will be fixed when bazelbuild/bazel#10590 is addressed.
The Python C++ extension targets are not used unless `--@:use_fast_cpp_protos=true`, and may not even be able to build if the Python headers are missing (note that `//util/python:python_headers`, bound to `@python_headers//` in `//:WORKSPACE`, is not currently sufficient). This change adds the `"manual"` tag to these targets, so that they do not cause `bazel test ...` to fail when Python headers are missing. Without the manual tag, the targets are always selected, even if `--@:use_fast_cpp_protos=false`. The `:cc_proto_blacklist_test` target is metastable, depending on whether the `--proto_toolchain_for_cc=` flag names a target with or without the `@com_google_protobuf//` prefix. We use the correct prefix for Bazel's default in `kokoro/linux/bazel/build.sh`, but the `bazel test :cc_proto_blacklist_test` (with or without `//`) fails consistently. Hopefully, this will be fixed when bazelbuild/bazel#10590 is addressed.
It looks like those PRs should have fixed this. Closing. |
No they have not, it still doesn't work. |
I don't completely understand what the original bug is about. So I cloned the protocolbuffers/protobuf repo, and tried to run the tests in the top comment with last_green bazel:
It seems like Bazel now considers |
The In the case of the protobuf repo, the excluded The real fix for this issue is to skip-list based on proto import path and not on artifact path, which would also allow us to get rid of the horrible difference between "proto source" and "original proto source". Everything in Bazel is ready for this, can't tell if Blaze is ready for that switch. |
Thanks for the context, Yannic!
I was a bit confused how this happens, so I went and did a bit of digging. Apparently, we implicitly insert a I believe this is terribly wrong and the actual source of this bug (probably what you referred to as "a" in the original comment). What makes this weirder is that the package This can probably be fixed with the "delayed label" thing that @meteorcloudy and I chatted about, which basically tries to make labels in flag defaults also go through repo mapping. Alas, that's unlikely to land in the near future. In the meantime, @Yannic, your idea to "compare proto import path instead of artifact path" could also mitigate this specific case, though I have no idea how ready Blaze is. |
Add `--proto_toolchain_for_cc=//:cc_toolchain` to work around bazelbuild/bazel#10590 (comment)
Add `--proto_toolchain_for_cc=//:cc_toolchain` to work around bazelbuild/bazel#10590 (comment)
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
Add `--proto_toolchain_for_cc=//:cc_toolchain` to work around bazelbuild/bazel#10590 (comment)
For Bazel
//:src/google/protobuf/any.proto
and@com_google_protobuf//:src/google/protobuf/any.proto
are different files, which causes blacklisting of.proto
sources to fail inside the protobuf repo.protocolbuffers/protobuf#7075 (comment)
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
N/A
What's the output of
bazel info release
?Tested with several versions between 0.22.0 and 2.0.0
Any other information, logs, or outputs that you want to share?
This is mostly an issue for the protobuf repo or for users defining their own
proto_lang_toolchain
, which shouldn't be too many.I see two possible fixes:
//:src/google/protobuf/any.proto
and@com_google_protobuf//:src/google/protobuf/any.proto
are equivalent..proto
files based on their import path.b Is blocked on making
ProtoInfo
mandatory forproto_lang_toolchain#blacklisted_protos
(cc @cushon). I have no idea how hard a would be. Is it related to--incompatible_remap_main_repo
(cc @aehlig)?The text was updated successfully, but these errors were encountered: