rust_grpcio well known types support, default deps

The usage of the well known type Empty requires a hack in the module
above the grpc implementation, this is now the generated stem_mod.rs

This also adds additional implicit dependencies that are required by
the grpc protobuf generated code. This includes the addition of a
'header_libs' property for library dependencies which export include
paths required by protos.

We also now include both the protos and the grpcio in the library
variant via the mod_stem.rs.

Bug: 172592789
Bug: 171504899
Test: m nothing
Test: Example rust_grpcio module build command includes dependencies,
      include paths.
Change-Id: I187a13cd5cdea991828a1020314de16727e4f74e
This commit is contained in:
Zach Johnson
2020-11-06 11:56:27 -08:00
parent 40c9798e92
commit 3df4e6364b
6 changed files with 132 additions and 2 deletions

View File

@@ -229,6 +229,7 @@ type Deps struct {
ProcMacros []string
SharedLibs []string
StaticLibs []string
HeaderLibs []string
CrtBegin, CrtEnd string
}
@@ -838,6 +839,11 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
directSharedLibDeps = append(directSharedLibDeps, ccDep)
mod.Properties.AndroidMkSharedLibs = append(mod.Properties.AndroidMkSharedLibs, depName)
exportDep = true
case cc.IsHeaderDepTag(depTag):
exportedInfo := ctx.OtherModuleProvider(dep, cc.FlagExporterInfoProvider).(cc.FlagExporterInfo)
depPaths.depIncludePaths = append(depPaths.depIncludePaths, exportedInfo.IncludeDirs...)
depPaths.depSystemIncludePaths = append(depPaths.depSystemIncludePaths, exportedInfo.SystemIncludeDirs...)
depPaths.depGeneratedHeaders = append(depPaths.depGeneratedHeaders, exportedInfo.GeneratedHeaders...)
case depTag == cc.CrtBeginDepTag:
depPaths.CrtBegin = linkObject
case depTag == cc.CrtEndDepTag:
@@ -983,6 +989,8 @@ func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) {
blueprint.Variation{Mutator: "link", Variation: "static"}),
cc.StaticDepTag(), deps.StaticLibs...)
actx.AddVariationDependencies(nil, cc.HeaderDepTag(), deps.HeaderLibs...)
crtVariations := cc.GetCrtVariations(ctx, mod)
if deps.CrtBegin != "" {
actx.AddVariationDependencies(crtVariations, cc.CrtBeginDepTag, deps.CrtBegin)