-
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
incompatible_generated_protos_in_virtual_imports: put generated .proto
files into a virtual proto source root directory
#9215
Comments
…or generated .proto files. It was meant to be a compatible change, but alas, people seemed to depend on the exact layout of the output tree. Will flip in 1.0 . Tracking bug: #9215 RELNOTES: None. PiperOrigin-RevId: 264581654
incompatible_generated_protos_in_virtual_imports
: put generated .proto
files into a virtual proto source root directory.proto
files into a virtual proto source root directory
…or generated .proto files. It was meant to be a compatible change, but alas, people seemed to depend on the exact layout of the output tree. Will flip in 1.0 . Tracking bug: #9215 RELNOTES: None. PiperOrigin-RevId: 264581654
Can you maybe give an example of what does/doesn't change because of this so one can better assess the impact on LANG_proto_library rules? |
Consider the following code say, in
At HEAD, this results in the proto_library having a When this flag is flipped, the two |
If we expand that with something depending on it, how does it end up?
Assuming the generated What will be in the providers and the file system so we can build the protoc command line correctly? Do we hard code the use of virtual_imports like https://github.com/bazelbuild/rules_swift/pull/288/files does (which says it has a leading underscore unlike what is said here)? |
Sorry, I meant I wanted to provide enough information in providers so that you can construct the command line without assuming things about paths, or, even better, provide a Starlark method to do so, but I couldn't make it in time for Bazel 1.0. So I decided that I'll be satisfied with that being possible without backwards-incompatible changes. Hard-coding In the above case, it depends on whether These are available as , but don't replicate that logic yet -- once 0.29 is out, I'll hardwire |
Assuming |
Yep. For the time being, that's the best option. |
Actually, how does this all work with a cross repo reference? Say |
You mean that the import paths of Yes indeed, that is the case, but that's no different from Bazel 0.28 or any version before that (or the logic of C++ include scanning): repository roots have always been proto source roots. |
Not that they are the same, but that the |
Fix for the only failing project ( |
What is the ETA for this? |
Done. I thought I had submitted the fix, but apparently it was just a green presubmit run. |
It seems like this PR may have broken |
…for generated .proto files. It was meant to be a compatible change, but alas, people seemed to depend on the exact layout of the output tree. Will flip in 1.0 . Tracking bug: bazelbuild/bazel#9215 RELNOTES: None. PiperOrigin-RevId: 264581654
The flag obscured bugs around generated proto files. Those were corrected in 6c6c196. proto_source_root is now set to path relative to output dir, no matter if the files are generated. This was always the case for a monorepo (consider a proto_library that mixes source file and generated file). The case was just corrected for the multi-repo world. For backwards compatibility paths with _virtual_imports still contain bin or genfiles dir. This will be removed once proto_common.compile automatically computes output directory. See the reasons for introducing the flag in #9215 PiperOrigin-RevId: 536654289 Change-Id: I61379a99ece4c5b0db7c222b1961c7dc9b87b137
If a
proto_library
rule has both generated and non-generated sources, it would give rise to multiple source roots (one in the source tree and one in the output tree). This is unintuitive and incompatible with theProtoInfo
provider that has place for only one ([ProtoInfo].proto_source_root
).To resolve this, we create a virtual source root under
bazel-bin/<package>/_virtual_imports/<rule>
.No user-visible changes are expected except in cases where Starlark code relied on the exact layout of the source tree.
The text was updated successfully, but these errors were encountered: