From 3e582b817534a011c38783545640d2b189c45973 Mon Sep 17 00:00:00 2001 From: Jingwen Chen Date: Thu, 5 Oct 2023 10:03:06 +0000 Subject: [PATCH 1/2] Use parameter name hint for BazelLabelModuleDepsWithFn's markAsDeps. Test: presubmits Change-Id: I6015581c27ad8b9b5b81d0ed01ba219699b9630b --- android/bazel_paths.go | 6 +++--- cc/bp2build.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/bazel_paths.go b/android/bazel_paths.go index a554775fb..5db668e52 100644 --- a/android/bazel_paths.go +++ b/android/bazel_paths.go @@ -103,7 +103,7 @@ type BazelConversionPathContext interface { // or ":") and returns a Bazel-compatible label which corresponds to dependencies on the // module within the given ctx. func BazelLabelForModuleDeps(ctx Bp2buildMutatorContext, modules []string) bazel.LabelList { - return BazelLabelForModuleDepsWithFn(ctx, modules, BazelModuleLabel, true) + return BazelLabelForModuleDepsWithFn(ctx, modules, BazelModuleLabel, /*markAsDeps=*/true) } // BazelLabelForModuleWholeDepsExcludes expects two lists: modules (containing modules to include in @@ -154,11 +154,11 @@ func BazelLabelForModuleDepsWithFn(ctx Bp2buildMutatorContext, modules []string, // the excluded dependencies. func BazelLabelForModuleDepsExcludesWithFn(ctx Bp2buildMutatorContext, modules, excludes []string, moduleToLabelFn func(BazelConversionPathContext, blueprint.Module) string) bazel.LabelList { - moduleLabels := BazelLabelForModuleDepsWithFn(ctx, RemoveListFromList(modules, excludes), moduleToLabelFn, true) + moduleLabels := BazelLabelForModuleDepsWithFn(ctx, RemoveListFromList(modules, excludes), moduleToLabelFn, /*markAsDeps=*/true) if len(excludes) == 0 { return moduleLabels } - excludeLabels := BazelLabelForModuleDepsWithFn(ctx, excludes, moduleToLabelFn, false) + excludeLabels := BazelLabelForModuleDepsWithFn(ctx, excludes, moduleToLabelFn, /*markAsDeps=*/false) return bazel.LabelList{ Includes: moduleLabels.Includes, Excludes: excludeLabels.Includes, diff --git a/cc/bp2build.go b/cc/bp2build.go index 45fbf278a..ec5d5225b 100644 --- a/cc/bp2build.go +++ b/cc/bp2build.go @@ -1904,7 +1904,7 @@ func xsdConfigCppTarget(xsd android.XsdConfigBp2buildTargets) string { } func bazelLabelForWholeDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList { - return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticWholeModuleDeps, true) + return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticWholeModuleDeps, /*markAsDeps=*/true) } func bazelLabelForWholeDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList { @@ -1916,11 +1916,11 @@ func bazelLabelForStaticDepsExcludes(ctx android.Bp2buildMutatorContext, modules } func bazelLabelForStaticDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList { - return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticModule, true) + return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticModule, /*markAsDeps=*/true) } func bazelLabelForSharedDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList { - return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForSharedModule, true) + return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForSharedModule, /*markAsDeps=*/true) } func bazelLabelForHeaderDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList { From 8c49fc7cacc0e3da40483c7cfc90bcd078b09e09 Mon Sep 17 00:00:00 2001 From: Jingwen Chen Date: Thu, 5 Oct 2023 10:07:52 +0000 Subject: [PATCH 2/2] Fix comment for Bp2buildDepsMutator config. Test: presubmit Change-Id: I5c7f1fc188eb37d3a457f9d4e2365d89ce2190e9 --- android/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/config.go b/android/config.go index 622a672ca..524ff2f20 100644 --- a/android/config.go +++ b/android/config.go @@ -297,8 +297,7 @@ type config struct { // in tests when a path doesn't exist. TestAllowNonExistentPaths bool - // If testAllowNonExistentPaths is true then PathForSource and PathForModuleSrc won't error - // in tests when a path doesn't exist. + // If true, register the "bp2build_deps" mutator in the mutator pipeline. Bp2buildDepsMutator bool // The list of files that when changed, must invalidate soong_build to