[bazel] fix includes to use proper paths from child packages

Also remove a now-unnecessary dependency from the dump_args target that
previously had been needed just to get the right includes to be used.

PiperOrigin-RevId: 690619490
pull/37998/head
Mark D. Roth 1 month ago committed by Copybara-Service
parent 8aa71db97a
commit 06eda49d45
  1. 14
      bazel/grpc_build_system.bzl
  2. 3
      src/core/BUILD

@ -146,6 +146,13 @@ def _update_visibility(visibility):
final_visibility.append(rule) final_visibility.append(rule)
return [x for x in final_visibility] return [x for x in final_visibility]
def _include_prefix():
include_prefix = ""
if native.package_name():
for _ in native.package_name().split("/"):
include_prefix += "../"
return include_prefix
def grpc_cc_library( def grpc_cc_library(
name, name,
srcs = [], srcs = [],
@ -193,6 +200,7 @@ def grpc_cc_library(
if select_deps: if select_deps:
for select_deps_entry in select_deps: for select_deps_entry in select_deps:
deps += select(select_deps_entry) deps += select(select_deps_entry)
include_prefix = _include_prefix()
native.cc_library( native.cc_library(
name = name, name = name,
srcs = srcs, srcs = srcs,
@ -217,9 +225,9 @@ def grpc_cc_library(
testonly = testonly, testonly = testonly,
linkopts = linkopts, linkopts = linkopts,
includes = [ includes = [
"include", include_prefix + "include",
"src/core/ext/upb-gen", # Once upb code-gen issue is resolved, remove this. include_prefix + "src/core/ext/upb-gen", # Once upb code-gen issue is resolved, remove this.
"src/core/ext/upbdefs-gen", # Once upb code-gen issue is resolved, remove this. include_prefix + "src/core/ext/upbdefs-gen", # Once upb code-gen issue is resolved, remove this.
], ],
alwayslink = alwayslink, alwayslink = alwayslink,
data = data, data = data,

@ -65,9 +65,6 @@ grpc_cc_library(
"absl/strings:str_format", "absl/strings:str_format",
], ],
language = "c++", language = "c++",
deps = [
"//:gpr_platform",
],
) )
grpc_cc_library( grpc_cc_library(

Loading…
Cancel
Save