Merge "Fix the args used to dexpreopt system server jars in prebuilt apexes" into main
diff --git a/android/config.go b/android/config.go
index eb1e647..7cb30c5 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1970,6 +1970,10 @@
return val, ok
}
+func (c *config) UseResourceProcessorByDefault() bool {
+ return c.productVariables.GetBuildFlagBool("RELEASE_USE_RESOURCE_PROCESSOR_BY_DEFAULT")
+}
+
var (
mainlineApexContributionBuildFlags = []string{
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES",
diff --git a/android/team_proto/Android.bp b/android/team_proto/Android.bp
index 061e77e..7e2a4c1 100644
--- a/android/team_proto/Android.bp
+++ b/android/team_proto/Android.bp
@@ -27,3 +27,17 @@
"team.pb.go",
],
}
+
+python_library_host {
+ name: "teams-proto-py",
+ pkg_path: "teams",
+ srcs: [
+ "team.proto",
+ ],
+ libs: [
+ "libprotobuf-python",
+ ],
+ proto: {
+ canonical_path_from_root: false,
+ },
+}
diff --git a/apex/apex.go b/apex/apex.go
index b069efd..276ac80 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1412,7 +1412,7 @@
var _ cc.Coverage = (*apexBundle)(nil)
// Implements cc.Coverage
-func (a *apexBundle) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
+func (a *apexBundle) IsNativeCoverageNeeded(ctx android.IncomingTransitionContext) bool {
return ctx.DeviceConfig().NativeCoverageEnabled()
}
diff --git a/apex/platform_bootclasspath_test.go b/apex/platform_bootclasspath_test.go
index 161941d..2bd3159 100644
--- a/apex/platform_bootclasspath_test.go
+++ b/apex/platform_bootclasspath_test.go
@@ -155,7 +155,7 @@
info, _ := android.SingletonModuleProvider(result, pbcp, java.MonolithicHiddenAPIInfoProvider)
for _, category := range java.HiddenAPIFlagFileCategories {
- name := category.PropertyName
+ name := category.PropertyName()
message := fmt.Sprintf("category %s", name)
filename := strings.ReplaceAll(name, "_", "-")
expected := []string{fmt.Sprintf("%s.txt", filename), fmt.Sprintf("bar-%s.txt", filename)}
diff --git a/cc/cc.go b/cc/cc.go
index c07e358..31fa4fd 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -68,7 +68,7 @@
ctx.TopDown("fuzz_deps", fuzzMutatorDeps)
- ctx.BottomUp("coverage", coverageMutator).Parallel()
+ ctx.Transition("coverage", &coverageTransitionMutator{})
ctx.TopDown("afdo_deps", afdoDepsMutator)
ctx.BottomUp("afdo", afdoMutator).Parallel()
@@ -76,8 +76,7 @@
ctx.TopDown("orderfile_deps", orderfileDepsMutator)
ctx.BottomUp("orderfile", orderfileMutator).Parallel()
- ctx.TopDown("lto_deps", ltoDepsMutator)
- ctx.BottomUp("lto", ltoMutator).Parallel()
+ ctx.Transition("lto", <oTransitionMutator{})
ctx.BottomUp("check_linktype", checkLinkTypeMutator).Parallel()
ctx.TopDown("double_loadable", checkDoubleLoadableLibraries).Parallel()
diff --git a/cc/coverage.go b/cc/coverage.go
index 393a8a6..43f5e07 100644
--- a/cc/coverage.go
+++ b/cc/coverage.go
@@ -246,7 +246,7 @@
type UseCoverage interface {
android.Module
- IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool
+ IsNativeCoverageNeeded(ctx android.IncomingTransitionContext) bool
}
// Coverage is an interface for non-CC modules to implement to be mutated for coverage
@@ -258,43 +258,86 @@
EnableCoverageIfNeeded()
}
-func coverageMutator(mctx android.BottomUpMutatorContext) {
- if c, ok := mctx.Module().(*Module); ok && c.coverage != nil {
- needCoverageVariant := c.coverage.Properties.NeedCoverageVariant
- needCoverageBuild := c.coverage.Properties.NeedCoverageBuild
- if needCoverageVariant {
- m := mctx.CreateVariations("", "cov")
+type coverageTransitionMutator struct{}
- // Setup the non-coverage version and set HideFromMake and
- // PreventInstall to true.
- m[0].(*Module).coverage.Properties.CoverageEnabled = false
- m[0].(*Module).coverage.Properties.IsCoverageVariant = false
- m[0].(*Module).Properties.HideFromMake = true
- m[0].(*Module).Properties.PreventInstall = true
+var _ android.TransitionMutator = (*coverageTransitionMutator)(nil)
- // The coverage-enabled version inherits HideFromMake,
- // PreventInstall from the original module.
- m[1].(*Module).coverage.Properties.CoverageEnabled = needCoverageBuild
- m[1].(*Module).coverage.Properties.IsCoverageVariant = true
+func (c coverageTransitionMutator) Split(ctx android.BaseModuleContext) []string {
+ if c, ok := ctx.Module().(*Module); ok && c.coverage != nil {
+ if c.coverage.Properties.NeedCoverageVariant {
+ return []string{"", "cov"}
}
- } else if cov, ok := mctx.Module().(Coverage); ok && cov.IsNativeCoverageNeeded(mctx) {
+ } else if cov, ok := ctx.Module().(Coverage); ok && cov.IsNativeCoverageNeeded(ctx) {
// APEX and Rust modules fall here
// Note: variant "" is also created because an APEX can be depended on by another
// module which are split into "" and "cov" variants. e.g. when cc_test refers
// to an APEX via 'data' property.
- m := mctx.CreateVariations("", "cov")
- m[0].(Coverage).MarkAsCoverageVariant(false)
- m[0].(Coverage).SetPreventInstall()
- m[0].(Coverage).HideFromMake()
-
- m[1].(Coverage).MarkAsCoverageVariant(true)
- m[1].(Coverage).EnableCoverageIfNeeded()
- } else if cov, ok := mctx.Module().(UseCoverage); ok && cov.IsNativeCoverageNeeded(mctx) {
+ return []string{"", "cov"}
+ } else if cov, ok := ctx.Module().(UseCoverage); ok && cov.IsNativeCoverageNeeded(ctx) {
// Module itself doesn't have to have "cov" variant, but it should use "cov" variants of
// deps.
- mctx.CreateVariations("cov")
- mctx.AliasVariation("cov")
+ return []string{"cov"}
+ }
+
+ return []string{""}
+}
+
+func (c coverageTransitionMutator) OutgoingTransition(ctx android.OutgoingTransitionContext, sourceVariation string) string {
+ return sourceVariation
+}
+
+func (c coverageTransitionMutator) IncomingTransition(ctx android.IncomingTransitionContext, incomingVariation string) string {
+ if c, ok := ctx.Module().(*Module); ok && c.coverage != nil {
+ if !c.coverage.Properties.NeedCoverageVariant {
+ return ""
+ }
+ } else if cov, ok := ctx.Module().(Coverage); ok {
+ if !cov.IsNativeCoverageNeeded(ctx) {
+ return ""
+ }
+ } else if cov, ok := ctx.Module().(UseCoverage); ok && cov.IsNativeCoverageNeeded(ctx) {
+ // Module only has a "cov" variation, so all incoming variations should use "cov".
+ return "cov"
+ } else {
+ return ""
+ }
+
+ return incomingVariation
+}
+
+func (c coverageTransitionMutator) Mutate(ctx android.BottomUpMutatorContext, variation string) {
+ if c, ok := ctx.Module().(*Module); ok && c.coverage != nil {
+ if variation == "" && c.coverage.Properties.NeedCoverageVariant {
+ // Setup the non-coverage version and set HideFromMake and
+ // PreventInstall to true.
+ c.coverage.Properties.CoverageEnabled = false
+ c.coverage.Properties.IsCoverageVariant = false
+ c.Properties.HideFromMake = true
+ c.Properties.PreventInstall = true
+ } else if variation == "cov" {
+ // The coverage-enabled version inherits HideFromMake,
+ // PreventInstall from the original module.
+ c.coverage.Properties.CoverageEnabled = c.coverage.Properties.NeedCoverageBuild
+ c.coverage.Properties.IsCoverageVariant = true
+ }
+ } else if cov, ok := ctx.Module().(Coverage); ok && cov.IsNativeCoverageNeeded(ctx) {
+ // APEX and Rust modules fall here
+
+ // Note: variant "" is also created because an APEX can be depended on by another
+ // module which are split into "" and "cov" variants. e.g. when cc_test refers
+ // to an APEX via 'data' property.
+ if variation == "" {
+ cov.MarkAsCoverageVariant(false)
+ cov.SetPreventInstall()
+ cov.HideFromMake()
+ } else if variation == "cov" {
+ cov.MarkAsCoverageVariant(true)
+ cov.EnableCoverageIfNeeded()
+ }
+ } else if cov, ok := ctx.Module().(UseCoverage); ok && cov.IsNativeCoverageNeeded(ctx) {
+ // Module itself doesn't have to have "cov" variant, but it should use "cov" variants of
+ // deps.
}
}
diff --git a/cc/lto.go b/cc/lto.go
index 8b0880c..b2b4570 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -15,9 +15,12 @@
package cc
import (
- "android/soong/android"
+ "fmt"
+ "github.com/google/blueprint"
"github.com/google/blueprint/proptools"
+
+ "android/soong/android"
)
// LTO (link-time optimization) allows the compiler to optimize and generate
@@ -49,11 +52,6 @@
LtoEnabled bool `blueprint:"mutated"`
LtoDefault bool `blueprint:"mutated"`
- // Dep properties indicate that this module needs to be built with LTO
- // since it is an object dependency of an LTO module.
- LtoDep bool `blueprint:"mutated"`
- NoLtoDep bool `blueprint:"mutated"`
-
// Use -fwhole-program-vtables cflag.
Whole_program_vtables *bool
}
@@ -176,86 +174,83 @@
return lto != nil && proptools.Bool(lto.Properties.Lto.Never)
}
-// Propagate lto requirements down from binaries
-func ltoDepsMutator(mctx android.TopDownMutatorContext) {
- if m, ok := mctx.Module().(*Module); ok {
- if m.lto == nil || m.lto.Properties.LtoEnabled == m.lto.Properties.LtoDefault {
- return
- }
-
- mctx.WalkDeps(func(dep android.Module, parent android.Module) bool {
- tag := mctx.OtherModuleDependencyTag(dep)
- libTag, isLibTag := tag.(libraryDependencyTag)
-
- // Do not recurse down non-static dependencies
- if isLibTag {
- if !libTag.static() {
- return false
- }
- } else {
- if tag != objDepTag && tag != reuseObjTag {
- return false
- }
- }
-
- if dep, ok := dep.(*Module); ok {
- if m.lto.Properties.LtoEnabled {
- dep.lto.Properties.LtoDep = true
- } else {
- dep.lto.Properties.NoLtoDep = true
- }
- }
-
- // Recursively walk static dependencies
- return true
- })
+func ltoPropagateViaDepTag(tag blueprint.DependencyTag) bool {
+ libTag, isLibTag := tag.(libraryDependencyTag)
+ // Do not recurse down non-static dependencies
+ if isLibTag {
+ return libTag.static()
+ } else {
+ return tag == objDepTag || tag == reuseObjTag || tag == staticVariantTag
}
}
-// Create lto variants for modules that need them
-func ltoMutator(mctx android.BottomUpMutatorContext) {
- if m, ok := mctx.Module().(*Module); ok && m.lto != nil {
- // Create variations for LTO types required as static
- // dependencies
- variationNames := []string{""}
- if m.lto.Properties.LtoDep {
- variationNames = append(variationNames, "lto-thin")
- }
- if m.lto.Properties.NoLtoDep {
- variationNames = append(variationNames, "lto-none")
+// ltoTransitionMutator creates LTO variants of cc modules. Variant "" is the default variant, which may
+// or may not have LTO enabled depending on the config and the module's type and properties. "lto-thin" or
+// "lto-none" variants are created when a module needs to compile in the non-default state for that module.
+type ltoTransitionMutator struct{}
+
+const LTO_NONE_VARIATION = "lto-none"
+const LTO_THIN_VARIATION = "lto-thin"
+
+func (l *ltoTransitionMutator) Split(ctx android.BaseModuleContext) []string {
+ return []string{""}
+}
+
+func (l *ltoTransitionMutator) OutgoingTransition(ctx android.OutgoingTransitionContext, sourceVariation string) string {
+ if m, ok := ctx.Module().(*Module); ok && m.lto != nil {
+ if !ltoPropagateViaDepTag(ctx.DepTag()) {
+ return ""
}
- if !m.lto.Properties.LtoEnabled {
- mctx.SetDependencyVariation("lto-none")
+ if sourceVariation != "" {
+ return sourceVariation
}
+
+ // Always request an explicit variation, IncomingTransition will rewrite it back to the default variation
+ // if necessary.
if m.lto.Properties.LtoEnabled {
- mctx.SetDependencyVariation("lto-thin")
+ return LTO_THIN_VARIATION
+ } else {
+ return LTO_NONE_VARIATION
}
+ }
+ return ""
+}
- if len(variationNames) > 1 {
- modules := mctx.CreateVariations(variationNames...)
- for i, name := range variationNames {
- variation := modules[i].(*Module)
- // Default module which will be
- // installed. Variation set above according to
- // explicit LTO properties
- if name == "" {
- continue
- }
-
- // LTO properties for dependencies
- if name == "lto-thin" {
- variation.lto.Properties.LtoEnabled = true
- }
- if name == "lto-none" {
- variation.lto.Properties.LtoEnabled = false
- }
- variation.Properties.PreventInstall = true
- variation.Properties.HideFromMake = true
- variation.lto.Properties.LtoDefault = m.lto.Properties.LtoDefault
- variation.lto.Properties.LtoDep = false
- variation.lto.Properties.NoLtoDep = false
- }
+func (l *ltoTransitionMutator) IncomingTransition(ctx android.IncomingTransitionContext, incomingVariation string) string {
+ if m, ok := ctx.Module().(*Module); ok && m.lto != nil {
+ if m.lto.Never() {
+ return ""
}
+ // Rewrite explicit variations back to the default variation if the default variation matches.
+ if incomingVariation == LTO_THIN_VARIATION && m.lto.Properties.LtoDefault {
+ return ""
+ } else if incomingVariation == LTO_NONE_VARIATION && !m.lto.Properties.LtoDefault {
+ return ""
+ }
+ return incomingVariation
+ }
+ return ""
+}
+
+func (l *ltoTransitionMutator) Mutate(ctx android.BottomUpMutatorContext, variation string) {
+ // Default module which will be installed. Variation set above according to explicit LTO properties.
+ if variation == "" {
+ return
+ }
+
+ if m, ok := ctx.Module().(*Module); ok && m.lto != nil {
+ // Non-default variation, set the LTO properties to match the variation.
+ switch variation {
+ case LTO_THIN_VARIATION:
+ m.lto.Properties.LtoEnabled = true
+ case LTO_NONE_VARIATION:
+ m.lto.Properties.LtoEnabled = false
+ default:
+ panic(fmt.Errorf("unknown variation %s", variation))
+ }
+ // Non-default variations are never installed.
+ m.Properties.PreventInstall = true
+ m.Properties.HideFromMake = true
}
}
diff --git a/cc/lto_test.go b/cc/lto_test.go
index 7b7fe8c..e4b5a3a 100644
--- a/cc/lto_test.go
+++ b/cc/lto_test.go
@@ -146,8 +146,9 @@
t.Errorf("'root' missing dependency on the default variant of 'foo'")
}
- if !hasDep(result, libRootLtoNever, libFoo.Module()) {
- t.Errorf("'root_no_lto' missing dependency on the default variant of 'foo'")
+ libFooNoLto := result.ModuleForTests("foo", "android_arm64_armv8-a_static_lto-none")
+ if !hasDep(result, libRootLtoNever, libFooNoLto.Module()) {
+ t.Errorf("'root_no_lto' missing dependency on the lto_none variant of 'foo'")
}
libFooCFlags := libFoo.Rule("cc").Args["cFlags"]
diff --git a/cmd/pom2bp/pom2bp.go b/cmd/pom2bp/pom2bp.go
index 3fb4454..6d1caf9 100644
--- a/cmd/pom2bp/pom2bp.go
+++ b/cmd/pom2bp/pom2bp.go
@@ -651,7 +651,7 @@
{{- end}}
],
{{- end}}
- java_version: "1.7",
+ java_version: "1.8",
}
`))
diff --git a/cmd/pom2mk/pom2mk.go b/cmd/pom2mk/pom2mk.go
index b347155..5ca770e 100644
--- a/cmd/pom2mk/pom2mk.go
+++ b/cmd/pom2mk/pom2mk.go
@@ -262,7 +262,7 @@
{{.MkName}}-nodeps{{end}}{{range .MkAarDeps}} \
{{.}}{{end}}
LOCAL_JAR_EXCLUDE_FILES := none
-LOCAL_JAVA_LANGUAGE_VERSION := 1.7
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
LOCAL_USE_AAPT2 := true
include $(BUILD_STATIC_JAVA_LIBRARY)
`))
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 7b207d6..2f6476c 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -512,6 +512,6 @@
var _ cc.UseCoverage = (*filesystem)(nil)
-func (*filesystem) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
+func (*filesystem) IsNativeCoverageNeeded(ctx android.IncomingTransitionContext) bool {
return ctx.Device() && ctx.DeviceConfig().NativeCoverageEnabled()
}
diff --git a/genrule/allowlists.go b/genrule/allowlists.go
index 3383650..60b1366 100644
--- a/genrule/allowlists.go
+++ b/genrule/allowlists.go
@@ -15,12 +15,6 @@
package genrule
var (
- DepfileAllowList = []string{
- // go/keep-sorted start
- "depfile_allowed_for_test",
- // go/keep-sorted end
- }
-
SandboxingDenyModuleList = []string{
// go/keep-sorted start
"aidl_camera_build_version",
diff --git a/genrule/genrule.go b/genrule/genrule.go
index fbda074..6f66088 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -124,14 +124,10 @@
// $(locations <label>): the paths to the tools, tool_files, inputs or outputs with name <label>. Use $(locations) if <label> refers to a rule that outputs two or more files.
// $(in): one or more input files.
// $(out): a single output file.
- // $(depfile): a file to which dependencies will be written, if the depfile property is set to true.
// $(genDir): the sandbox directory for this tool; contains $(out).
// $$: a literal $
Cmd *string
- // Enable reading a file containing dependencies in gcc format after the command completes
- Depfile *bool
-
// name of the modules (if any) that produces the host executable. Leave empty for
// prebuilts or scripts that do not need a module to build them.
Tools []string
@@ -194,10 +190,8 @@
type generateTask struct {
in android.Paths
out android.WritablePaths
- depFile android.WritablePath
copyTo android.WritablePaths // For gensrcs to set on gensrcsMerge rule.
genDir android.WritablePath
- extraTools android.Paths // dependencies on tools used by the generator
extraInputs map[string][]string
cmd string
@@ -448,8 +442,6 @@
addLocationLabel(out.Rel(), outputLocation{out})
}
- referencedDepfile := false
-
rawCommand, err := android.Expand(task.cmd, func(name string) (string, error) {
// report the error directly without returning an error to android.Expand to catch multiple errors in a
// single run
@@ -481,12 +473,6 @@
sandboxOuts = append(sandboxOuts, cmd.PathForOutput(out))
}
return strings.Join(proptools.ShellEscapeList(sandboxOuts), " "), nil
- case "depfile":
- referencedDepfile = true
- if !Bool(g.properties.Depfile) {
- return reportError("$(depfile) used without depfile property")
- }
- return "__SBOX_DEPFILE__", nil
case "genDir":
return proptools.ShellEscape(cmd.PathForOutput(task.genDir)), nil
default:
@@ -526,10 +512,6 @@
return
}
- if Bool(g.properties.Depfile) && !referencedDepfile {
- ctx.PropertyErrorf("cmd", "specified depfile=true but did not include a reference to '${depfile}' in cmd")
- return
- }
g.rawCommands = append(g.rawCommands, rawCommand)
cmd.Text(rawCommand)
@@ -538,11 +520,7 @@
cmd.ImplicitOutputs(task.out)
cmd.Implicits(task.in)
cmd.ImplicitTools(tools)
- cmd.ImplicitTools(task.extraTools)
cmd.ImplicitPackagedTools(packagedTools)
- if Bool(g.properties.Depfile) {
- cmd.ImplicitDepFile(task.depFile)
- }
// Create the rule to run the genrule command inside sbox.
rule.Build(name, desc)
@@ -583,19 +561,6 @@
}
func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- // Allowlist genrule to use depfile until we have a solution to remove it.
- // TODO(b/307824623): Remove depfile property
- if Bool(g.properties.Depfile) {
- sandboxingAllowlistSets := getSandboxingAllowlistSets(ctx)
- if ctx.DeviceConfig().GenruleSandboxing() && !sandboxingAllowlistSets.depfileAllowSet[g.Name()] {
- ctx.PropertyErrorf(
- "depfile",
- "Deprecated because with genrule sandboxing, dependencies must be known before the action is run "+
- "in order to add them to the sandbox. "+
- "Please specify the dependencies explicitly so that there is no need to use depfile.")
- }
- }
-
g.generateCommonBuildActions(ctx)
// For <= 6 outputs, just embed those directly in the users. Right now, that covers >90% of
@@ -721,7 +686,6 @@
for i, shard := range shards {
var commands []string
var outFiles android.WritablePaths
- var commandDepFiles []string
var copyTo android.WritablePaths
// When sharding is enabled (i.e. len(shards) > 1), the sbox rules for each
@@ -761,12 +725,6 @@
return in.String(), nil
case "out":
return rule.Command().PathForOutput(outFile), nil
- case "depfile":
- // Generate a depfile for each output file. Store the list for
- // later in order to combine them all into a single depfile.
- depFile := rule.Command().PathForOutput(outFile.ReplaceExtension(ctx, "d"))
- commandDepFiles = append(commandDepFiles, depFile)
- return depFile, nil
default:
return "$(" + name + ")", nil
}
@@ -781,30 +739,14 @@
}
fullCommand := strings.Join(commands, " && ")
- var outputDepfile android.WritablePath
- var extraTools android.Paths
- if len(commandDepFiles) > 0 {
- // Each command wrote to a depfile, but ninja can only handle one
- // depfile per rule. Use the dep_fixer tool at the end of the
- // command to combine all the depfiles into a single output depfile.
- outputDepfile = android.PathForModuleGen(ctx, genSubDir, "gensrcs.d")
- depFixerTool := ctx.Config().HostToolPath(ctx, "dep_fixer")
- fullCommand += fmt.Sprintf(" && %s -o $(depfile) %s",
- rule.Command().PathForTool(depFixerTool),
- strings.Join(commandDepFiles, " "))
- extraTools = append(extraTools, depFixerTool)
- }
-
generateTasks = append(generateTasks, generateTask{
- in: shard,
- out: outFiles,
- depFile: outputDepfile,
- copyTo: copyTo,
- genDir: genDir,
- cmd: fullCommand,
- shard: i,
- shards: len(shards),
- extraTools: extraTools,
+ in: shard,
+ out: outFiles,
+ copyTo: copyTo,
+ genDir: genDir,
+ cmd: fullCommand,
+ shard: i,
+ shards: len(shards),
extraInputs: map[string][]string{
"data": properties.Data,
},
@@ -843,20 +785,14 @@
taskGenerator := func(ctx android.ModuleContext, rawCommand string, srcFiles android.Paths) []generateTask {
outs := make(android.WritablePaths, len(properties.Out))
- var depFile android.WritablePath
for i, out := range properties.Out {
- outPath := android.PathForModuleGen(ctx, out)
- if i == 0 {
- depFile = outPath.ReplaceExtension(ctx, "d")
- }
- outs[i] = outPath
+ outs[i] = android.PathForModuleGen(ctx, out)
}
return []generateTask{{
- in: srcFiles,
- out: outs,
- depFile: depFile,
- genDir: android.PathForModuleGen(ctx),
- cmd: rawCommand,
+ in: srcFiles,
+ out: outs,
+ genDir: android.PathForModuleGen(ctx),
+ cmd: rawCommand,
}}
}
@@ -907,22 +843,18 @@
type sandboxingAllowlistSets struct {
sandboxingDenyModuleSet map[string]bool
sandboxingDenyPathSet map[string]bool
- depfileAllowSet map[string]bool
}
func getSandboxingAllowlistSets(ctx android.PathContext) *sandboxingAllowlistSets {
return ctx.Config().Once(sandboxingAllowlistKey, func() interface{} {
sandboxingDenyModuleSet := map[string]bool{}
sandboxingDenyPathSet := map[string]bool{}
- depfileAllowSet := map[string]bool{}
- android.AddToStringSet(sandboxingDenyModuleSet, append(DepfileAllowList, SandboxingDenyModuleList...))
+ android.AddToStringSet(sandboxingDenyModuleSet, SandboxingDenyModuleList)
android.AddToStringSet(sandboxingDenyPathSet, SandboxingDenyPathList)
- android.AddToStringSet(depfileAllowSet, DepfileAllowList)
return &sandboxingAllowlistSets{
sandboxingDenyModuleSet: sandboxingDenyModuleSet,
sandboxingDenyPathSet: sandboxingDenyPathSet,
- depfileAllowSet: depfileAllowSet,
}
}).(*sandboxingAllowlistSets)
}
diff --git a/genrule/genrule_test.go b/genrule/genrule_test.go
index fa0ee17..2dc6a79 100644
--- a/genrule/genrule_test.go
+++ b/genrule/genrule_test.go
@@ -287,16 +287,6 @@
expect: "echo foo > __SBOX_SANDBOX_DIR__/out/out2",
},
{
- name: "depfile",
- moduleName: "depfile_allowed_for_test",
- prop: `
- out: ["out"],
- depfile: true,
- cmd: "echo foo > $(out) && touch $(depfile)",
- `,
- expect: "echo foo > __SBOX_SANDBOX_DIR__/out/out && touch __SBOX_DEPFILE__",
- },
- {
name: "gendir",
prop: `
out: ["out"],
@@ -392,24 +382,6 @@
err: `unknown variable '$(foo)'`,
},
{
- name: "error depfile",
- prop: `
- out: ["out"],
- cmd: "echo foo > $(out) && touch $(depfile)",
- `,
- err: "$(depfile) used without depfile property",
- },
- {
- name: "error no depfile",
- moduleName: "depfile_allowed_for_test",
- prop: `
- out: ["out"],
- depfile: true,
- cmd: "echo foo > $(out)",
- `,
- err: "specified depfile=true but did not include a reference to '${depfile}' in cmd",
- },
- {
name: "error no out",
prop: `
cmd: "echo foo > $(out)",
@@ -695,60 +667,6 @@
}
}
-func TestGenruleAllowlistingDepfile(t *testing.T) {
- tests := []struct {
- name string
- prop string
- err string
- moduleName string
- }{
- {
- name: `error when module is not allowlisted`,
- prop: `
- depfile: true,
- cmd: "cat $(in) > $(out) && cat $(depfile)",
- `,
- err: "depfile: Deprecated because with genrule sandboxing, dependencies must be known before the action is run in order to add them to the sandbox",
- },
- {
- name: `no error when module is allowlisted`,
- prop: `
- depfile: true,
- cmd: "cat $(in) > $(out) && cat $(depfile)",
- `,
- moduleName: `depfile_allowed_for_test`,
- },
- }
- for _, test := range tests {
- t.Run(test.name, func(t *testing.T) {
- moduleName := "foo"
- if test.moduleName != "" {
- moduleName = test.moduleName
- }
- bp := fmt.Sprintf(`
- gensrcs {
- name: "%s",
- srcs: ["data.txt"],
- %s
- }`, moduleName, test.prop)
-
- var expectedErrors []string
- if test.err != "" {
- expectedErrors = append(expectedErrors, test.err)
- }
- android.GroupFixturePreparers(
- prepareForGenRuleTest,
- android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.GenruleSandboxing = proptools.BoolPtr(true)
- }),
- ).
- ExtendWithErrorHandler(android.FixtureExpectsAllErrorsToMatchAPattern(expectedErrors)).
- RunTestWithBp(t, bp)
- })
-
- }
-}
-
func TestGenruleDefaults(t *testing.T) {
bp := `
genrule_defaults {
diff --git a/java/aar.go b/java/aar.go
index b162ef6..f61fc83 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -159,8 +159,8 @@
}
}
-func (a *aapt) useResourceProcessorBusyBox() bool {
- return BoolDefault(a.aaptProperties.Use_resource_processor, false)
+func (a *aapt) useResourceProcessorBusyBox(ctx android.BaseModuleContext) bool {
+ return BoolDefault(a.aaptProperties.Use_resource_processor, ctx.Config().UseResourceProcessorByDefault())
}
func (a *aapt) filterProduct() string {
@@ -414,7 +414,7 @@
linkFlags = append(linkFlags, "--static-lib")
}
- if a.isLibrary && a.useResourceProcessorBusyBox() {
+ if a.isLibrary && a.useResourceProcessorBusyBox(ctx) {
// When building an android_library using ResourceProcessorBusyBox the resources are merged into
// package-res.apk with --merge-only, but --no-static-lib-packages is not used so that R.txt only
// contains resources from this library.
@@ -453,7 +453,7 @@
// of transitiveStaticLibs.
transitiveStaticLibs := android.ReversePaths(staticDeps.resPackages())
- if a.isLibrary && a.useResourceProcessorBusyBox() {
+ if a.isLibrary && a.useResourceProcessorBusyBox(ctx) {
// When building an android_library with ResourceProcessorBusyBox enabled treat static library dependencies
// as imports. The resources from dependencies will not be merged into this module's package-res.apk, and
// instead modules depending on this module will reference package-res.apk from all transitive static
@@ -515,7 +515,7 @@
})
}
- if !a.useResourceProcessorBusyBox() {
+ if !a.useResourceProcessorBusyBox(ctx) {
// the subdir "android" is required to be filtered by package names
srcJar = android.PathForModuleGen(ctx, "android", "R.srcjar")
}
@@ -542,7 +542,7 @@
a.assetPackage = android.OptionalPathForPath(assets)
}
- if a.useResourceProcessorBusyBox() {
+ if a.useResourceProcessorBusyBox(ctx) {
rJar := android.PathForModuleOut(ctx, "busybox/R.jar")
resourceProcessorBusyBoxGenerateBinaryR(ctx, rTxt, a.mergedManifestFile, rJar, staticDeps, a.isLibrary, a.aaptProperties.Aaptflags)
aapt2ExtractExtraPackages(ctx, extraPackages, rJar)
@@ -577,7 +577,7 @@
rJar: a.rJar,
assets: a.assetPackage,
- usedResourceProcessor: a.useResourceProcessorBusyBox(),
+ usedResourceProcessor: a.useResourceProcessorBusyBox(ctx),
}).
Transitive(staticResourcesNodesDepSet).Build()
a.rroDirsDepSet = android.NewDepSetBuilder[rroDir](android.TOPOLOGICAL).
@@ -823,7 +823,7 @@
ctx.CheckbuildFile(a.aapt.proguardOptionsFile)
ctx.CheckbuildFile(a.aapt.exportPackage)
- if a.useResourceProcessorBusyBox() {
+ if a.useResourceProcessorBusyBox(ctx) {
ctx.CheckbuildFile(a.aapt.rJar)
} else {
ctx.CheckbuildFile(a.aapt.aaptSrcJar)
@@ -849,7 +849,7 @@
var extraSrcJars android.Paths
var extraCombinedJars android.Paths
var extraClasspathJars android.Paths
- if a.useResourceProcessorBusyBox() {
+ if a.useResourceProcessorBusyBox(ctx) {
// When building a library with ResourceProcessorBusyBox enabled ResourceProcessorBusyBox for this
// library and each of the transitive static android_library dependencies has already created an
// R.class file for the appropriate package. Add all of those R.class files to the classpath.
@@ -889,7 +889,7 @@
}
func (a *aapt) IDEInfo(dpInfo *android.IdeInfo) {
- if a.useResourceProcessorBusyBox() {
+ if a.rJar != nil {
dpInfo.Jars = append(dpInfo.Jars, a.rJar.String())
}
}
diff --git a/java/app.go b/java/app.go
index 5d5c09a..0c56d81 100755
--- a/java/app.go
+++ b/java/app.go
@@ -588,7 +588,7 @@
var extraSrcJars android.Paths
var extraClasspathJars android.Paths
var extraCombinedJars android.Paths
- if a.useResourceProcessorBusyBox() {
+ if a.useResourceProcessorBusyBox(ctx) {
// When building an app with ResourceProcessorBusyBox enabled ResourceProcessorBusyBox has already
// created R.class files that provide IDs for resources in busybox/R.jar. Pass that file in the
// classpath when compiling everything else, and add it to the final classes jar.
@@ -1108,7 +1108,7 @@
return Bool(a.appProperties.Privileged)
}
-func (a *AndroidApp) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
+func (a *AndroidApp) IsNativeCoverageNeeded(ctx android.IncomingTransitionContext) bool {
return ctx.Device() && ctx.DeviceConfig().NativeCoverageEnabled()
}
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index c89c643..2c13d99 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -949,7 +949,7 @@
builder.CopyToSnapshot(p, dest)
dests = append(dests, dest)
}
- hiddenAPISet.AddProperty(category.PropertyName, dests)
+ hiddenAPISet.AddProperty(category.PropertyName(), dests)
}
}
}
diff --git a/java/bootclasspath_fragment_test.go b/java/bootclasspath_fragment_test.go
index 95cd4a9..8bc0a7e 100644
--- a/java/bootclasspath_fragment_test.go
+++ b/java/bootclasspath_fragment_test.go
@@ -467,10 +467,10 @@
android.AssertArrayString(t, "single packages", []string{"newlibrary.mine"}, info.SinglePackages)
for _, c := range HiddenAPIFlagFileCategories {
expectedMaxTargetQPaths := []string(nil)
- if c.PropertyName == "max_target_q" {
+ if c.PropertyName() == "max_target_q" {
expectedMaxTargetQPaths = []string{"my-new-max-target-q.txt"}
}
- android.AssertPathsRelativeToTopEquals(t, c.PropertyName, expectedMaxTargetQPaths, info.FlagFilesByCategory[c])
+ android.AssertPathsRelativeToTopEquals(t, c.PropertyName(), expectedMaxTargetQPaths, info.FlagFilesByCategory[c])
}
// Make sure that the signature-patterns.csv is passed all the appropriate package properties
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go
index 3c7cf3a..e4beb5e 100644
--- a/java/hiddenapi_modular.go
+++ b/java/hiddenapi_modular.go
@@ -435,122 +435,118 @@
}
}
-type hiddenAPIFlagFileCategory struct {
- // PropertyName is the name of the property for this category.
- PropertyName string
+type hiddenAPIFlagFileCategory int
- // propertyValueReader retrieves the value of the property for this category from the set of
- // properties.
- propertyValueReader func(properties *HiddenAPIFlagFileProperties) []string
+const (
+ // The flag file category for removed members of the API.
+ //
+ // This is extracted from HiddenAPIFlagFileCategories as it is needed to add the dex signatures
+ // list of removed API members that are generated automatically from the removed.txt files provided
+ // by API stubs.
+ hiddenAPIFlagFileCategoryRemoved hiddenAPIFlagFileCategory = iota
+ hiddenAPIFlagFileCategoryUnsupported
+ hiddenAPIFlagFileCategoryMaxTargetRLowPriority
+ hiddenAPIFlagFileCategoryMaxTargetQ
+ hiddenAPIFlagFileCategoryMaxTargetP
+ hiddenAPIFlagFileCategoryMaxTargetOLowPriority
+ hiddenAPIFlagFileCategoryBlocked
+ hiddenAPIFlagFileCategoryUnsupportedPackages
+)
- // commandMutator adds the appropriate command line options for this category to the supplied
- // command
- commandMutator func(command *android.RuleBuilderCommand, path android.Path)
-}
-
-// The flag file category for removed members of the API.
-//
-// This is extracted from HiddenAPIFlagFileCategories as it is needed to add the dex signatures
-// list of removed API members that are generated automatically from the removed.txt files provided
-// by API stubs.
-var hiddenAPIRemovedFlagFileCategory = &hiddenAPIFlagFileCategory{
- // See HiddenAPIFlagFileProperties.Removed
- PropertyName: "removed",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Removed
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--unsupported ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "removed")
- },
-}
-
-type hiddenAPIFlagFileCategories []*hiddenAPIFlagFileCategory
-
-func (c hiddenAPIFlagFileCategories) byProperty(name string) *hiddenAPIFlagFileCategory {
- for _, category := range c {
- if category.PropertyName == name {
- return category
- }
+func (c hiddenAPIFlagFileCategory) PropertyName() string {
+ switch c {
+ case hiddenAPIFlagFileCategoryRemoved:
+ return "removed"
+ case hiddenAPIFlagFileCategoryUnsupported:
+ return "unsupported"
+ case hiddenAPIFlagFileCategoryMaxTargetRLowPriority:
+ return "max_target_r_low_priority"
+ case hiddenAPIFlagFileCategoryMaxTargetQ:
+ return "max_target_q"
+ case hiddenAPIFlagFileCategoryMaxTargetP:
+ return "max_target_p"
+ case hiddenAPIFlagFileCategoryMaxTargetOLowPriority:
+ return "max_target_o_low_priority"
+ case hiddenAPIFlagFileCategoryBlocked:
+ return "blocked"
+ case hiddenAPIFlagFileCategoryUnsupportedPackages:
+ return "unsupported_packages"
+ default:
+ panic(fmt.Sprintf("Unknown hidden api flag file category type: %d", c))
}
- panic(fmt.Errorf("no category exists with property name %q in %v", name, c))
}
+// propertyValueReader retrieves the value of the property for this category from the set of properties.
+func (c hiddenAPIFlagFileCategory) propertyValueReader(properties *HiddenAPIFlagFileProperties) []string {
+ switch c {
+ case hiddenAPIFlagFileCategoryRemoved:
+ return properties.Hidden_api.Removed
+ case hiddenAPIFlagFileCategoryUnsupported:
+ return properties.Hidden_api.Unsupported
+ case hiddenAPIFlagFileCategoryMaxTargetRLowPriority:
+ return properties.Hidden_api.Max_target_r_low_priority
+ case hiddenAPIFlagFileCategoryMaxTargetQ:
+ return properties.Hidden_api.Max_target_q
+ case hiddenAPIFlagFileCategoryMaxTargetP:
+ return properties.Hidden_api.Max_target_p
+ case hiddenAPIFlagFileCategoryMaxTargetOLowPriority:
+ return properties.Hidden_api.Max_target_o_low_priority
+ case hiddenAPIFlagFileCategoryBlocked:
+ return properties.Hidden_api.Blocked
+ case hiddenAPIFlagFileCategoryUnsupportedPackages:
+ return properties.Hidden_api.Unsupported_packages
+ default:
+ panic(fmt.Sprintf("Unknown hidden api flag file category type: %d", c))
+ }
+}
+
+// commandMutator adds the appropriate command line options for this category to the supplied command
+func (c hiddenAPIFlagFileCategory) commandMutator(command *android.RuleBuilderCommand, path android.Path) {
+ switch c {
+ case hiddenAPIFlagFileCategoryRemoved:
+ command.FlagWithInput("--unsupported ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "removed")
+ case hiddenAPIFlagFileCategoryUnsupported:
+ command.FlagWithInput("--unsupported ", path)
+ case hiddenAPIFlagFileCategoryMaxTargetRLowPriority:
+ command.FlagWithInput("--max-target-r ", path).FlagWithArg("--tag ", "lo-prio")
+ case hiddenAPIFlagFileCategoryMaxTargetQ:
+ command.FlagWithInput("--max-target-q ", path)
+ case hiddenAPIFlagFileCategoryMaxTargetP:
+ command.FlagWithInput("--max-target-p ", path)
+ case hiddenAPIFlagFileCategoryMaxTargetOLowPriority:
+ command.FlagWithInput("--max-target-o ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "lo-prio")
+ case hiddenAPIFlagFileCategoryBlocked:
+ command.FlagWithInput("--blocked ", path)
+ case hiddenAPIFlagFileCategoryUnsupportedPackages:
+ command.FlagWithInput("--unsupported ", path).Flag("--packages ")
+ default:
+ panic(fmt.Sprintf("Unknown hidden api flag file category type: %d", c))
+ }
+}
+
+type hiddenAPIFlagFileCategories []hiddenAPIFlagFileCategory
+
var HiddenAPIFlagFileCategories = hiddenAPIFlagFileCategories{
// See HiddenAPIFlagFileProperties.Unsupported
- {
- PropertyName: "unsupported",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Unsupported
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--unsupported ", path)
- },
- },
- hiddenAPIRemovedFlagFileCategory,
+ hiddenAPIFlagFileCategoryUnsupported,
+ // See HiddenAPIFlagFileProperties.Removed
+ hiddenAPIFlagFileCategoryRemoved,
// See HiddenAPIFlagFileProperties.Max_target_r_low_priority
- {
- PropertyName: "max_target_r_low_priority",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Max_target_r_low_priority
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--max-target-r ", path).FlagWithArg("--tag ", "lo-prio")
- },
- },
+ hiddenAPIFlagFileCategoryMaxTargetRLowPriority,
// See HiddenAPIFlagFileProperties.Max_target_q
- {
- PropertyName: "max_target_q",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Max_target_q
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--max-target-q ", path)
- },
- },
+ hiddenAPIFlagFileCategoryMaxTargetQ,
// See HiddenAPIFlagFileProperties.Max_target_p
- {
- PropertyName: "max_target_p",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Max_target_p
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--max-target-p ", path)
- },
- },
+ hiddenAPIFlagFileCategoryMaxTargetP,
// See HiddenAPIFlagFileProperties.Max_target_o_low_priority
- {
- PropertyName: "max_target_o_low_priority",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Max_target_o_low_priority
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--max-target-o ", path).Flag("--ignore-conflicts ").FlagWithArg("--tag ", "lo-prio")
- },
- },
+ hiddenAPIFlagFileCategoryMaxTargetOLowPriority,
// See HiddenAPIFlagFileProperties.Blocked
- {
- PropertyName: "blocked",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Blocked
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--blocked ", path)
- },
- },
+ hiddenAPIFlagFileCategoryBlocked,
// See HiddenAPIFlagFileProperties.Unsupported_packages
- {
- PropertyName: "unsupported_packages",
- propertyValueReader: func(properties *HiddenAPIFlagFileProperties) []string {
- return properties.Hidden_api.Unsupported_packages
- },
- commandMutator: func(command *android.RuleBuilderCommand, path android.Path) {
- command.FlagWithInput("--unsupported ", path).Flag("--packages ")
- },
- },
+ hiddenAPIFlagFileCategoryUnsupportedPackages,
}
// FlagFilesByCategory maps a hiddenAPIFlagFileCategory to the paths to the files in that category.
-type FlagFilesByCategory map[*hiddenAPIFlagFileCategory]android.Paths
+type FlagFilesByCategory map[hiddenAPIFlagFileCategory]android.Paths
// append the supplied flags files to the corresponding category in this map.
func (s FlagFilesByCategory) append(other FlagFilesByCategory) {
@@ -1014,7 +1010,7 @@
// If available then pass the automatically generated file containing dex signatures of removed
// API members to the rule so they can be marked as removed.
if generatedRemovedDexSignatures.Valid() {
- hiddenAPIRemovedFlagFileCategory.commandMutator(command, generatedRemovedDexSignatures.Path())
+ hiddenAPIFlagFileCategoryRemoved.commandMutator(command, generatedRemovedDexSignatures.Path())
}
commitChangeForRestat(rule, tempPath, outputPath)
diff --git a/java/java.go b/java/java.go
index 276cfcf..d536ca1 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1084,7 +1084,7 @@
return true
}
-func (j *TestHost) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
+func (j *TestHost) IsNativeCoverageNeeded(ctx android.IncomingTransitionContext) bool {
return ctx.DeviceConfig().NativeCoverageEnabled()
}
diff --git a/rust/rust.go b/rust/rust.go
index 34ce4c5..245ed2e 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -535,7 +535,7 @@
var _ cc.Coverage = (*Module)(nil)
-func (mod *Module) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
+func (mod *Module) IsNativeCoverageNeeded(ctx android.IncomingTransitionContext) bool {
return mod.coverage != nil && mod.coverage.Properties.NeedCoverageVariant
}
diff --git a/testing/code_metadata_proto/Android.bp b/testing/code_metadata_proto/Android.bp
index 8fcca19..f07efff 100644
--- a/testing/code_metadata_proto/Android.bp
+++ b/testing/code_metadata_proto/Android.bp
@@ -20,10 +20,24 @@
name: "soong-testing-code_metadata_proto",
pkgPath: "android/soong/testing/code_metadata_proto",
deps: [
- "golang-protobuf-reflect-protoreflect",
- "golang-protobuf-runtime-protoimpl",
- ],
+ "golang-protobuf-reflect-protoreflect",
+ "golang-protobuf-runtime-protoimpl",
+ ],
srcs: [
"code_metadata.pb.go",
],
}
+
+python_library_host {
+ name: "code-metadata-proto-py",
+ pkg_path: "code_metadata",
+ srcs: [
+ "code_metadata.proto",
+ ],
+ libs: [
+ "libprotobuf-python",
+ ],
+ proto: {
+ canonical_path_from_root: false,
+ },
+}
diff --git a/testing/test_spec_proto/Android.bp b/testing/test_spec_proto/Android.bp
index 1cac492..d5ad70b 100644
--- a/testing/test_spec_proto/Android.bp
+++ b/testing/test_spec_proto/Android.bp
@@ -20,10 +20,24 @@
name: "soong-testing-test_spec_proto",
pkgPath: "android/soong/testing/test_spec_proto",
deps: [
- "golang-protobuf-reflect-protoreflect",
- "golang-protobuf-runtime-protoimpl",
- ],
+ "golang-protobuf-reflect-protoreflect",
+ "golang-protobuf-runtime-protoimpl",
+ ],
srcs: [
"test_spec.pb.go",
],
}
+
+python_library_host {
+ name: "test-spec-proto-py",
+ pkg_path: "test_spec",
+ srcs: [
+ "test_spec.proto",
+ ],
+ libs: [
+ "libprotobuf-python",
+ ],
+ proto: {
+ canonical_path_from_root: false,
+ },
+}