Path is not beneath src/google/protobuf
Attempting to upgrade protobuf using Bazel to commit a9b006bddd52e289029f16aa77b77e8e0033d9ee, we're seeing the following error:
(19:32:49) ERROR: /workspace/bazel-cache/external/com_google_protobuf/src/google/protobuf/BUILD.bazel:171:14: in @upb//bazel:upb_proto_library.bzl%_upb_proto_library_aspect aspect on proto_library rule @com_google_protobuf//src/google/protobuf:descriptor_proto:
Traceback (most recent call last):
File "/workspace/bazel-cache/external/upb/bazel/upb_proto_library.bzl", line 272, column 34, in _upb_proto_library_aspect_impl
return _upb_proto_aspect_impl(target, ctx, "upb", _UpbWrappedCcInfo, _WrappedGeneratedSrcsInfo)
File "/workspace/bazel-cache/external/upb/bazel/upb_proto_library.bzl", line 252, column 32, in _upb_proto_aspect_impl
files = _compile_upb_protos(ctx, generator, proto_info, proto_info.direct_sources)
File "/workspace/bazel-cache/external/upb/bazel/upb_proto_library.bzl", line 192, column 34, in _compile_upb_protos
srcs = [_generate_output_file(ctx, name, ext + ".c") for name in proto_sources]
File "/workspace/bazel-cache/external/upb/bazel/upb_proto_library.bzl", line 67, column 39, in _generate_output_file
real_short_path = paths.relativize(real_short_path, ctx.label.package)
File "/workspace/bazel-cache/external/bazel_skylib/lib/paths.bzl", line 186, column 17, in _relativize
fail("Path '%s' is not beneath '%s'" % (path, start))
Error in fail: Path 'google/protobuf/descriptor.proto' is not beneath 'src/google/protobuf'
This appears to be entirely within the protobuf code itself, not having to do with out internal code. Here's the WORKSPACE settings that we're using:
git_repository(
name = "com_google_protobuf",
commit = "a9b006bddd52e289029f16aa77b77e8e0033d9ee",
remote = "https://github.com/protocolbuffers/protobuf",
)
Any ideas about what could be going wrong here? Is this an issue with our local setup, or is there a problem in the upstream?
Thanks.
Hi @jkaye2012, are you able to reproduce this on a toy repo based on bazel@a9b006bddd52e289029f16aa77b77e8e0033d9ee ?
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.
This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.
I am running into this same issue now after upgrading to the latest protobuf release (27.1). I'm wondering if you were able to figure out what was wrong.