mirror of https://github.com/grpc/grpc.git
[bazel] Fix import path for virtual packages (#28103)
This change moves the logic for computing the package name part of an import directory from python_rules.bzl to protobuf.bzl, and reinstates the workspace root part of the directory. The effect is that it is now possible for a py_library_rule to depend on a proto_library in a different repository whose source files are generated.pull/28361/head
parent
835afc0fcf
commit
324ea5a9c1
7 changed files with 43 additions and 5 deletions
@ -0,0 +1 @@ |
||||
workspace(name = "my_messages") |
@ -0,0 +1,29 @@ |
||||
# gRPC Bazel BUILD file. |
||||
# |
||||
# Copyright 2021 The gRPC authors. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
proto_library( |
||||
name = "my_proto", |
||||
srcs = ["my.proto"], |
||||
visibility = ["//visibility:public"], |
||||
) |
||||
|
||||
genrule( |
||||
name = "make_my_proto", |
||||
outs = ["my.proto"], |
||||
cmd = """ |
||||
echo -e "syntax = \\"proto3\\";\npackage somewhere_else;\nmessage MyMessage {};" > $@ |
||||
""", |
||||
) |
Loading…
Reference in new issue