Merge "Start using Providers instead of direct module access"
diff --git a/android/arch.go b/android/arch.go
index f4b0d66..f505ec6 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -811,10 +811,16 @@
}
}
-// Identifies the dependency from CommonOS variant to the os specific variants.
-type commonOSTag struct{ blueprint.BaseDependencyTag }
+type archDepTag struct {
+ blueprint.BaseDependencyTag
+ name string
+}
-var commonOsToOsSpecificVariantTag = commonOSTag{}
+// Identifies the dependency from CommonOS variant to the os specific variants.
+var commonOsToOsSpecificVariantTag = archDepTag{name: "common os to os specific"}
+
+// Identifies the dependency from arch variant to the common variant for a "common_first" multilib.
+var firstArchToCommonArchDepTag = archDepTag{name: "first arch to common arch"}
// Get the OsType specific variants for the current CommonOS variant.
//
@@ -831,7 +837,6 @@
}
}
})
-
return variants
}
@@ -955,6 +960,12 @@
addTargetProperties(m, targets[i], multiTargets, i == 0)
m.base().setArchProperties(mctx)
}
+
+ if multilib == "common_first" && len(modules) >= 2 {
+ for i := range modules[1:] {
+ mctx.AddInterVariantDependency(firstArchToCommonArchDepTag, modules[i+1], modules[0])
+ }
+ }
}
func addTargetProperties(m Module, target Target, multiTargets []Target, primaryTarget bool) {
diff --git a/android/module.go b/android/module.go
index 056b0a5..822e5bd 100644
--- a/android/module.go
+++ b/android/module.go
@@ -435,7 +435,7 @@
HostRequiredModuleNames() []string
TargetRequiredModuleNames() []string
- filesToInstall() InstallPaths
+ FilesToInstall() InstallPaths
}
// Qualified id for a module
@@ -1241,14 +1241,14 @@
// TODO(ccross): we need to use WalkDeps and have some way to know which dependencies require installation
ctx.VisitDepsDepthFirst(func(m blueprint.Module) {
if a, ok := m.(Module); ok {
- result = append(result, a.filesToInstall()...)
+ result = append(result, a.FilesToInstall()...)
}
})
return result
}
-func (m *ModuleBase) filesToInstall() InstallPaths {
+func (m *ModuleBase) FilesToInstall() InstallPaths {
return m.installFiles
}
diff --git a/android/prebuilt.go b/android/prebuilt.go
index 734871b..294a6e0 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -93,7 +93,7 @@
// more modules like this.
func (p *Prebuilt) SingleSourcePath(ctx ModuleContext) Path {
if p.srcsSupplier != nil {
- srcs := p.srcsSupplier()
+ srcs := p.srcsSupplier(ctx)
if len(srcs) == 0 {
ctx.PropertyErrorf(p.srcsPropertyName, "missing prebuilt source file")
@@ -122,7 +122,7 @@
// Called to provide the srcs value for the prebuilt module.
//
// Return the src value or nil if it is not available.
-type PrebuiltSrcsSupplier func() []string
+type PrebuiltSrcsSupplier func(ctx BaseModuleContext) []string
// Initialize the module as a prebuilt module that uses the provided supplier to access the
// prebuilt sources of the module.
@@ -156,7 +156,7 @@
panic(fmt.Errorf("srcs must not be nil"))
}
- srcsSupplier := func() []string {
+ srcsSupplier := func(ctx BaseModuleContext) []string {
return *srcs
}
@@ -177,7 +177,7 @@
srcFieldIndex := srcStructField.Index
srcPropertyName := proptools.PropertyNameForField(srcField)
- srcsSupplier := func() []string {
+ srcsSupplier := func(ctx BaseModuleContext) []string {
value := srcPropsValue.FieldByIndex(srcFieldIndex)
if value.Kind() == reflect.Ptr {
value = value.Elem()
@@ -287,7 +287,7 @@
// usePrebuilt returns true if a prebuilt should be used instead of the source module. The prebuilt
// will be used if it is marked "prefer" or if the source module is disabled.
func (p *Prebuilt) usePrebuilt(ctx TopDownMutatorContext, source Module) bool {
- if p.srcsSupplier != nil && len(p.srcsSupplier()) == 0 {
+ if p.srcsSupplier != nil && len(p.srcsSupplier(ctx)) == 0 {
return false
}
diff --git a/android/test_suites.go b/android/test_suites.go
index 34e487e..19444a8 100644
--- a/android/test_suites.go
+++ b/android/test_suites.go
@@ -41,7 +41,7 @@
files[testSuite] = make(map[string]InstallPaths)
}
name := ctx.ModuleName(m)
- files[testSuite][name] = append(files[testSuite][name], tsm.filesToInstall()...)
+ files[testSuite][name] = append(files[testSuite][name], tsm.FilesToInstall()...)
}
}
})
diff --git a/android/variable.go b/android/variable.go
index d752aec..a9495cc 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -390,7 +390,7 @@
AAPTPrebuiltDPI: []string{"xhdpi", "xxhdpi"},
Malloc_not_svelte: boolPtr(true),
- Malloc_zero_contents: boolPtr(false),
+ Malloc_zero_contents: boolPtr(true),
Malloc_pattern_fill_contents: boolPtr(false),
Safestack: boolPtr(false),
}
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 96a7a57..c52fd04 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -5598,6 +5598,36 @@
ensureMatches(t, copyCmds[2], "^unzip .*-d .*/app/AppSet .*/AppSet.zip$")
}
+func TestAppSetBundlePrebuilt(t *testing.T) {
+ ctx, _ := testApex(t, "", func(fs map[string][]byte, config android.Config) {
+ bp := `
+ apex_set {
+ name: "myapex",
+ filename: "foo_v2.apex",
+ sanitized: {
+ none: { set: "myapex.apks", },
+ hwaddress: { set: "myapex.hwasan.apks", },
+ },
+ }`
+ fs["Android.bp"] = []byte(bp)
+
+ config.TestProductVariables.SanitizeDevice = []string{"hwaddress"}
+ })
+
+ m := ctx.ModuleForTests("myapex", "android_common")
+ extractedApex := m.Output(buildDir + "/.intermediates/myapex/android_common/foo_v2.apex")
+
+ actual := extractedApex.Inputs
+ if len(actual) != 1 {
+ t.Errorf("expected a single input")
+ }
+
+ expected := "myapex.hwasan.apks"
+ if actual[0].String() != expected {
+ t.Errorf("expected %s, got %s", expected, actual[0].String())
+ }
+}
+
func testNoUpdatableJarsInBootImage(t *testing.T, errmsg string, transformDexpreoptConfig func(*dexpreopt.GlobalConfig)) {
t.Helper()
diff --git a/apex/prebuilt.go b/apex/prebuilt.go
index 9f6c8ad..ce16d73 100644
--- a/apex/prebuilt.go
+++ b/apex/prebuilt.go
@@ -50,6 +50,10 @@
properties prebuiltCommonProperties
}
+type sanitizedPrebuilt interface {
+ hasSanitizedSource(sanitizer string) bool
+}
+
type prebuiltCommonProperties struct {
ForceDisable bool `blueprint:"mutated"`
}
@@ -75,9 +79,10 @@
forceDisable = forceDisable || ctx.DeviceConfig().NativeCoverageEnabled()
forceDisable = forceDisable || ctx.Config().IsEnvTrue("EMMA_INSTRUMENT")
- // b/137216042 don't use prebuilts when address sanitizer is on
- forceDisable = forceDisable || android.InList("address", ctx.Config().SanitizeDevice()) ||
- android.InList("hwaddress", ctx.Config().SanitizeDevice())
+ // b/137216042 don't use prebuilts when address sanitizer is on, unless the prebuilt has a sanitized source
+ sanitized := ctx.Module().(sanitizedPrebuilt)
+ forceDisable = forceDisable || (android.InList("address", ctx.Config().SanitizeDevice()) && !sanitized.hasSanitizedSource("address"))
+ forceDisable = forceDisable || (android.InList("hwaddress", ctx.Config().SanitizeDevice()) && !sanitized.hasSanitizedSource("hwaddress"))
if forceDisable && p.prebuilt.SourceExists() {
p.properties.ForceDisable = true
@@ -135,6 +140,10 @@
Overrides []string
}
+func (a *Prebuilt) hasSanitizedSource(sanitizer string) bool {
+ return false
+}
+
func (p *Prebuilt) installable() bool {
return p.properties.Installable == nil || proptools.Bool(p.properties.Installable)
}
@@ -266,6 +275,18 @@
// the .apks file path that contains prebuilt apex files to be extracted.
Set *string
+ Sanitized struct {
+ None struct {
+ Set *string
+ }
+ Address struct {
+ Set *string
+ }
+ Hwaddress struct {
+ Set *string
+ }
+ }
+
// whether the extracted apex file installable.
Installable *bool
@@ -284,6 +305,41 @@
Prerelease *bool
}
+func (a *ApexSet) prebuiltSrcs(ctx android.BaseModuleContext) []string {
+ var srcs []string
+ if a.properties.Set != nil {
+ srcs = append(srcs, *a.properties.Set)
+ }
+
+ var sanitizers []string
+ if ctx.Host() {
+ sanitizers = ctx.Config().SanitizeHost()
+ } else {
+ sanitizers = ctx.Config().SanitizeDevice()
+ }
+
+ if android.InList("address", sanitizers) && a.properties.Sanitized.Address.Set != nil {
+ srcs = append(srcs, *a.properties.Sanitized.Address.Set)
+ } else if android.InList("hwaddress", sanitizers) && a.properties.Sanitized.Hwaddress.Set != nil {
+ srcs = append(srcs, *a.properties.Sanitized.Hwaddress.Set)
+ } else if a.properties.Sanitized.None.Set != nil {
+ srcs = append(srcs, *a.properties.Sanitized.None.Set)
+ }
+
+ return srcs
+}
+
+func (a *ApexSet) hasSanitizedSource(sanitizer string) bool {
+ if sanitizer == "address" {
+ return a.properties.Sanitized.Address.Set != nil
+ }
+ if sanitizer == "hwaddress" {
+ return a.properties.Sanitized.Hwaddress.Set != nil
+ }
+
+ return false
+}
+
func (a *ApexSet) installable() bool {
return a.properties.Installable == nil || proptools.Bool(a.properties.Installable)
}
@@ -304,7 +360,12 @@
func apexSetFactory() android.Module {
module := &ApexSet{}
module.AddProperties(&module.properties)
- android.InitSingleSourcePrebuiltModule(module, &module.properties, "Set")
+
+ srcsSupplier := func(ctx android.BaseModuleContext) []string {
+ return module.prebuiltSrcs(ctx)
+ }
+
+ android.InitPrebuiltModuleWithSrcSupplier(module, srcsSupplier, "set")
android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon)
return module
}
diff --git a/cc/library.go b/cc/library.go
index 3a46b11..ea12818 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -121,7 +121,10 @@
}
type StaticOrSharedProperties struct {
- Srcs []string `android:"path,arch_variant"`
+ Srcs []string `android:"path,arch_variant"`
+
+ Sanitized Sanitized `android:"arch_variant"`
+
Cflags []string `android:"arch_variant"`
Enabled *bool `android:"arch_variant"`
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index f21e4a9..45d3eb1 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -38,10 +38,11 @@
}
type prebuiltLinkerProperties struct {
-
// a prebuilt library or binary. Can reference a genrule module that generates an executable file.
Srcs []string `android:"path,arch_variant"`
+ Sanitized Sanitized `android:"arch_variant"`
+
// Check the prebuilt ELF files (e.g. DT_SONAME, DT_NEEDED, resolution of undefined
// symbols, etc), default true.
Check_elf_files *bool
@@ -107,7 +108,7 @@
p.libraryDecorator.flagExporter.setProvider(ctx)
// TODO(ccross): verify shared library dependencies
- srcs := p.prebuiltSrcs()
+ srcs := p.prebuiltSrcs(ctx)
if len(srcs) > 0 {
builderFlags := flagsToBuilderFlags(flags)
@@ -192,15 +193,18 @@
return nil
}
-func (p *prebuiltLibraryLinker) prebuiltSrcs() []string {
+func (p *prebuiltLibraryLinker) prebuiltSrcs(ctx android.BaseModuleContext) []string {
+ sanitize := ctx.Module().(*Module).sanitize
srcs := p.properties.Srcs
+ srcs = append(srcs, srcsForSanitizer(sanitize, p.properties.Sanitized)...)
if p.static() {
srcs = append(srcs, p.libraryDecorator.StaticProperties.Static.Srcs...)
+ srcs = append(srcs, srcsForSanitizer(sanitize, p.libraryDecorator.StaticProperties.Static.Sanitized)...)
}
if p.shared() {
srcs = append(srcs, p.libraryDecorator.SharedProperties.Shared.Srcs...)
+ srcs = append(srcs, srcsForSanitizer(sanitize, p.libraryDecorator.SharedProperties.Shared.Sanitized)...)
}
-
return srcs
}
@@ -227,8 +231,8 @@
module.AddProperties(&prebuilt.properties)
- srcsSupplier := func() []string {
- return prebuilt.prebuiltSrcs()
+ srcsSupplier := func(ctx android.BaseModuleContext) []string {
+ return prebuilt.prebuiltSrcs(ctx)
}
android.InitPrebuiltModuleWithSrcSupplier(module, srcsSupplier, "srcs")
@@ -440,3 +444,28 @@
android.InitPrebuiltModule(module, &prebuilt.properties.Srcs)
return module, binary
}
+
+type Sanitized struct {
+ None struct {
+ Srcs []string `android:"path,arch_variant"`
+ } `android:"arch_variant"`
+ Address struct {
+ Srcs []string `android:"path,arch_variant"`
+ } `android:"arch_variant"`
+ Hwaddress struct {
+ Srcs []string `android:"path,arch_variant"`
+ } `android:"arch_variant"`
+}
+
+func srcsForSanitizer(sanitize *sanitize, sanitized Sanitized) []string {
+ if sanitize == nil {
+ return nil
+ }
+ if Bool(sanitize.Properties.Sanitize.Address) && sanitized.Address.Srcs != nil {
+ return sanitized.Address.Srcs
+ }
+ if Bool(sanitize.Properties.Sanitize.Hwaddress) && sanitized.Hwaddress.Srcs != nil {
+ return sanitized.Hwaddress.Srcs
+ }
+ return sanitized.None.Srcs
+}
diff --git a/cc/prebuilt_test.go b/cc/prebuilt_test.go
index 52416ac..1f070a5 100644
--- a/cc/prebuilt_test.go
+++ b/cc/prebuilt_test.go
@@ -23,7 +23,7 @@
"github.com/google/blueprint"
)
-func testPrebuilt(t *testing.T, bp string, fs map[string][]byte) *android.TestContext {
+func testPrebuilt(t *testing.T, bp string, fs map[string][]byte, handlers ...configCustomizer) *android.TestContext {
config := TestConfig(buildDir, android.Android, nil, bp, fs)
ctx := CreateTestContext()
@@ -34,6 +34,10 @@
android.RegisterAndroidMkBuildComponents(ctx)
android.SetInMakeForTests(config)
+ for _, handler := range handlers {
+ handler(config)
+ }
+
ctx.Register(config)
_, errs := ctx.ParseFileList(".", []string{"Android.bp"})
android.FailIfErrored(t, errs)
@@ -42,6 +46,8 @@
return ctx
}
+type configCustomizer func(config android.Config)
+
func TestPrebuilt(t *testing.T) {
bp := `
cc_library {
@@ -321,3 +327,62 @@
assertString(t, libfooDep.String(),
filepath.Join(buildDir, ".intermediates/libfoo/linux_glibc_x86_64_shared/libfoo.so"))
}
+
+func TestPrebuiltLibrarySanitized(t *testing.T) {
+ bp := `cc_prebuilt_library {
+ name: "libtest",
+ static: {
+ sanitized: { none: { srcs: ["libf.a"], }, hwaddress: { srcs: ["libf.hwasan.a"], }, },
+ },
+ shared: {
+ sanitized: { none: { srcs: ["libf.so"], }, hwaddress: { srcs: ["hwasan/libf.so"], }, },
+ },
+ }
+ cc_prebuilt_library_static {
+ name: "libtest_static",
+ sanitized: { none: { srcs: ["libf.a"], }, hwaddress: { srcs: ["libf.hwasan.a"], }, },
+ }
+ cc_prebuilt_library_shared {
+ name: "libtest_shared",
+ sanitized: { none: { srcs: ["libf.so"], }, hwaddress: { srcs: ["hwasan/libf.so"], }, },
+ }`
+
+ fs := map[string][]byte{
+ "libf.a": nil,
+ "libf.hwasan.a": nil,
+ "libf.so": nil,
+ "hwasan/libf.so": nil,
+ }
+
+ // Without SANITIZE_TARGET.
+ ctx := testPrebuilt(t, bp, fs)
+
+ shared_rule := ctx.ModuleForTests("libtest", "android_arm64_armv8-a_shared").Rule("android/soong/cc.strip")
+ assertString(t, shared_rule.Input.String(), "libf.so")
+
+ static := ctx.ModuleForTests("libtest", "android_arm64_armv8-a_static").Module().(*Module)
+ assertString(t, static.OutputFile().Path().Base(), "libf.a")
+
+ shared_rule2 := ctx.ModuleForTests("libtest_shared", "android_arm64_armv8-a_shared").Rule("android/soong/cc.strip")
+ assertString(t, shared_rule2.Input.String(), "libf.so")
+
+ static2 := ctx.ModuleForTests("libtest_static", "android_arm64_armv8-a_static").Module().(*Module)
+ assertString(t, static2.OutputFile().Path().Base(), "libf.a")
+
+ // With SANITIZE_TARGET=hwaddress
+ ctx = testPrebuilt(t, bp, fs, func(config android.Config) {
+ config.TestProductVariables.SanitizeDevice = []string{"hwaddress"}
+ })
+
+ shared_rule = ctx.ModuleForTests("libtest", "android_arm64_armv8-a_shared_hwasan").Rule("android/soong/cc.strip")
+ assertString(t, shared_rule.Input.String(), "hwasan/libf.so")
+
+ static = ctx.ModuleForTests("libtest", "android_arm64_armv8-a_static_hwasan").Module().(*Module)
+ assertString(t, static.OutputFile().Path().Base(), "libf.hwasan.a")
+
+ shared_rule2 = ctx.ModuleForTests("libtest_shared", "android_arm64_armv8-a_shared_hwasan").Rule("android/soong/cc.strip")
+ assertString(t, shared_rule2.Input.String(), "hwasan/libf.so")
+
+ static2 = ctx.ModuleForTests("libtest_static", "android_arm64_armv8-a_static_hwasan").Module().(*Module)
+ assertString(t, static2.OutputFile().Path().Base(), "libf.hwasan.a")
+}
diff --git a/java/androidmk.go b/java/androidmk.go
index f72ee37..c21c83a 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -549,9 +549,6 @@
if dstubs.annotationsZip != nil {
entries.SetPath("LOCAL_DROIDDOC_ANNOTATIONS_ZIP", dstubs.annotationsZip)
}
- if dstubs.jdiffDocZip != nil {
- entries.SetPath("LOCAL_DROIDDOC_JDIFF_DOC_ZIP", dstubs.jdiffDocZip)
- }
if dstubs.metadataZip != nil {
entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.metadataZip)
}
diff --git a/java/app.go b/java/app.go
index e788ca9..46ca969 100755
--- a/java/app.go
+++ b/java/app.go
@@ -379,7 +379,6 @@
"can only be set for modules that set sdk_version")
}
- tag := &jniDependencyTag{}
for _, jniTarget := range ctx.MultiTargets() {
variation := append(jniTarget.Variations(),
blueprint.Variation{Mutator: "link", Variation: "shared"})
@@ -393,7 +392,7 @@
Bool(a.appProperties.Jni_uses_sdk_apis) {
variation = append(variation, blueprint.Variation{Mutator: "sdk", Variation: "sdk"})
}
- ctx.AddFarVariationDependencies(variation, tag, a.appProperties.Jni_libs...)
+ ctx.AddFarVariationDependencies(variation, jniLibTag, a.appProperties.Jni_libs...)
}
a.usesLibrary.deps(ctx, sdkDep.hasFrameworkLibs())
diff --git a/java/droiddoc.go b/java/droiddoc.go
index b3bb5ab..923a263 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -274,10 +274,6 @@
// if set to true, collect the values used by the Dev tools and
// write them in files packaged with the SDK. Defaults to false.
Write_sdk_values *bool
-
- // If set to true, .xml based public API file will be also generated, and
- // JDiff tool will be invoked to genreate javadoc files. Defaults to false.
- Jdiff_enabled *bool
}
//
@@ -586,9 +582,8 @@
srcFiles = filterByPackage(srcFiles, j.properties.Filter_packages)
// While metalava needs package html files, it does not need them to be explicit on the command
- // line. More importantly, the metalava rsp file is also used by the subsequent jdiff action if
- // jdiff_enabled=true. javadoc complains if it receives html files on the command line. The filter
- // below excludes html files from the rsp file for both metalava and jdiff. Note that the html
+ // line. javadoc complains if it receives html files on the command line. The filter
+ // below excludes html files from the rsp file metalava. Note that the html
// files are still included as implicit inputs for successful remote execution and correct
// incremental builds.
filterHtml := func(srcs []android.Path) []android.Path {
@@ -1023,9 +1018,6 @@
apiFilePath android.Path
- jdiffDocZip android.WritablePath
- jdiffStubsSrcJar android.WritablePath
-
metadataZip android.WritablePath
metadataDir android.WritablePath
}
@@ -1258,26 +1250,6 @@
})
}
-func (d *Droidstubs) apiToXmlFlags(ctx android.ModuleContext, cmd *android.RuleBuilderCommand) {
- if Bool(d.properties.Jdiff_enabled) && d.apiFile != nil {
- if d.apiFile.String() == "" {
- ctx.ModuleErrorf("API signature file has to be specified in Metalava when jdiff is enabled.")
- }
-
- d.apiXmlFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"_api.xml")
- cmd.FlagWithOutput("--api-xml ", d.apiXmlFile)
-
- if String(d.properties.Check_api.Last_released.Api_file) == "" {
- ctx.PropertyErrorf("check_api.last_released.api_file",
- "has to be non-empty if jdiff was enabled!")
- }
-
- lastReleasedApi := android.PathForModuleSrc(ctx, String(d.properties.Check_api.Last_released.Api_file))
- d.lastReleasedApiXmlFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"_last_released_api.xml")
- cmd.FlagWithInput("--convert-to-jdiff ", lastReleasedApi).Output(d.lastReleasedApiXmlFile)
- }
-}
-
func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersion javaVersion, srcs android.Paths,
srcJarList android.Path, bootclasspath, classpath classpath, sourcepaths android.Paths, implicitsRsp android.WritablePath, sandbox bool) *android.RuleBuilderCommand {
// Metalava uses lots of memory, restrict the number of metalava jobs that can run in parallel.
@@ -1386,7 +1358,6 @@
d.annotationsFlags(ctx, cmd)
d.inclusionAnnotationsFlags(ctx, cmd)
d.apiLevelsAnnotationsFlags(ctx, cmd)
- d.apiToXmlFlags(ctx, cmd)
if android.InList("--generate-documentation", d.Javadoc.args) {
// Currently Metalava have the ability to invoke Javadoc in a seperate process.
@@ -1663,74 +1634,6 @@
rule.Build(pctx, ctx, "nullabilityWarningsCheck", "nullability warnings check")
}
-
- if Bool(d.properties.Jdiff_enabled) {
- if len(d.Javadoc.properties.Out) > 0 {
- ctx.PropertyErrorf("out", "out property may not be combined with jdiff")
- }
-
- outDir := android.PathForModuleOut(ctx, "jdiff-out")
- srcJarDir := android.PathForModuleOut(ctx, "jdiff-srcjars")
- stubsDir := android.PathForModuleOut(ctx, "jdiff-stubsDir")
-
- rule := android.NewRuleBuilder()
-
- // Please sync with android-api-council@ before making any changes for the name of jdiffDocZip below
- // since there's cron job downstream that fetch this .zip file periodically.
- // See b/116221385 for reference.
- d.jdiffDocZip = android.PathForModuleOut(ctx, ctx.ModuleName()+"-"+"jdiff-docs.zip")
- d.jdiffStubsSrcJar = android.PathForModuleOut(ctx, ctx.ModuleName()+"-"+"jdiff-stubs.srcjar")
-
- jdiff := android.PathForOutput(ctx, "host", ctx.Config().PrebuiltOS(), "framework", "jdiff.jar")
-
- rule.Command().Text("rm -rf").Text(outDir.String()).Text(stubsDir.String())
- rule.Command().Text("mkdir -p").Text(outDir.String()).Text(stubsDir.String())
-
- srcJarList := zipSyncCmd(ctx, rule, srcJarDir, d.Javadoc.srcJars)
-
- cmd := javadocBootclasspathCmd(ctx, rule, d.Javadoc.srcFiles, outDir, srcJarDir, srcJarList,
- deps.bootClasspath, deps.classpath, d.sourcepaths)
-
- cmd.Flag("-J-Xmx1600m").
- Flag("-XDignore.symbol.file").
- FlagWithArg("-doclet ", "jdiff.JDiff").
- FlagWithInput("-docletpath ", jdiff).
- Flag("-quiet")
-
- if d.apiXmlFile != nil {
- cmd.FlagWithArg("-newapi ", strings.TrimSuffix(d.apiXmlFile.Base(), d.apiXmlFile.Ext())).
- FlagWithArg("-newapidir ", filepath.Dir(d.apiXmlFile.String())).
- Implicit(d.apiXmlFile)
- }
-
- if d.lastReleasedApiXmlFile != nil {
- cmd.FlagWithArg("-oldapi ", strings.TrimSuffix(d.lastReleasedApiXmlFile.Base(), d.lastReleasedApiXmlFile.Ext())).
- FlagWithArg("-oldapidir ", filepath.Dir(d.lastReleasedApiXmlFile.String())).
- Implicit(d.lastReleasedApiXmlFile)
- }
-
- rule.Command().
- BuiltTool(ctx, "soong_zip").
- Flag("-write_if_changed").
- Flag("-d").
- FlagWithOutput("-o ", d.jdiffDocZip).
- FlagWithArg("-C ", outDir.String()).
- FlagWithArg("-D ", outDir.String())
-
- rule.Command().
- BuiltTool(ctx, "soong_zip").
- Flag("-write_if_changed").
- Flag("-jar").
- FlagWithOutput("-o ", d.jdiffStubsSrcJar).
- FlagWithArg("-C ", stubsDir.String()).
- FlagWithArg("-D ", stubsDir.String())
-
- rule.Restat()
-
- zipSyncCleanupCmd(rule, srcJarDir)
-
- rule.Build(pctx, ctx, "jdiff", "jdiff")
- }
}
//
diff --git a/java/java.go b/java/java.go
index 2553a30..3ce1885 100644
--- a/java/java.go
+++ b/java/java.go
@@ -547,13 +547,8 @@
name string
}
-type jniDependencyTag struct {
- blueprint.BaseDependencyTag
-}
-
func IsJniDepTag(depTag blueprint.DependencyTag) bool {
- _, ok := depTag.(*jniDependencyTag)
- return ok
+ return depTag == jniLibTag
}
var (
@@ -573,6 +568,7 @@
instrumentationForTag = dependencyTag{name: "instrumentation_for"}
usesLibTag = dependencyTag{name: "uses-library"}
extraLintCheckTag = dependencyTag{name: "extra-lint-check"}
+ jniLibTag = dependencyTag{name: "jnilib"}
)
func IsLibDepTag(depTag blueprint.DependencyTag) bool {
@@ -1001,7 +997,7 @@
otherName := ctx.OtherModuleName(module)
tag := ctx.OtherModuleDependencyTag(module)
- if _, ok := tag.(*jniDependencyTag); ok {
+ if IsJniDepTag(tag) {
// Handled by AndroidApp.collectAppDeps
return
}
@@ -2436,6 +2432,10 @@
// Name of the class containing main to be inserted into the manifest as Main-Class.
Main_class *string
+
+ // Names of modules containing JNI libraries that should be installed alongside the host
+ // variant of the binary.
+ Jni_libs []string
}
type Binary struct {
@@ -2476,18 +2476,21 @@
j.wrapperFile = android.PathForSource(ctx, "build/soong/scripts/jar-wrapper.sh")
}
- // Depend on the installed jar so that the wrapper doesn't get executed by
- // another build rule before the jar has been installed.
- jarFile := ctx.PrimaryModule().(*Binary).installFile
-
+ // The host installation rules make the installed wrapper depend on all the dependencies
+ // of the wrapper variant, which will include the common variant's jar file and any JNI
+ // libraries. This is verified by TestBinary.
j.binaryFile = ctx.InstallExecutable(android.PathForModuleInstall(ctx, "bin"),
- ctx.ModuleName(), j.wrapperFile, jarFile)
+ ctx.ModuleName(), j.wrapperFile)
}
}
func (j *Binary) DepsMutator(ctx android.BottomUpMutatorContext) {
if ctx.Arch().ArchType == android.Common {
j.deps(ctx)
+ } else {
+ // This dependency ensures the host installation rules will install the jni libraries
+ // when the wrapper is installed.
+ ctx.AddVariationDependencies(nil, jniLibTag, j.binaryProperties.Jni_libs...)
}
}
diff --git a/java/java_test.go b/java/java_test.go
index 53053df..c751ea4 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -460,6 +460,14 @@
name: "bar",
srcs: ["b.java"],
static_libs: ["foo"],
+ jni_libs: ["libjni"],
+ }
+
+ cc_library_shared {
+ name: "libjni",
+ host_supported: true,
+ device_supported: false,
+ stl: "none",
}
`)
@@ -470,10 +478,17 @@
barWrapper := ctx.ModuleForTests("bar", buildOS+"_x86_64")
barWrapperDeps := barWrapper.Output("bar").Implicits.Strings()
+ libjni := ctx.ModuleForTests("libjni", buildOS+"_x86_64_shared")
+ libjniSO := libjni.Rule("Cp").Output.String()
+
// Test that the install binary wrapper depends on the installed jar file
- if len(barWrapperDeps) != 1 || barWrapperDeps[0] != barJar {
- t.Errorf("expected binary wrapper implicits [%q], got %v",
- barJar, barWrapperDeps)
+ if g, w := barWrapperDeps, barJar; !android.InList(w, g) {
+ t.Errorf("expected binary wrapper implicits to contain %q, got %q", w, g)
+ }
+
+ // Test that the install binary wrapper depends on the installed JNI libraries
+ if g, w := barWrapperDeps, libjniSO; !android.InList(w, g) {
+ t.Errorf("expected binary wrapper implicits to contain %q, got %q", w, g)
}
}
diff --git a/ui/metrics/metrics.go b/ui/metrics/metrics.go
index f5552a3..a13a106 100644
--- a/ui/metrics/metrics.go
+++ b/ui/metrics/metrics.go
@@ -139,7 +139,12 @@
}
// exports the output to the file at outputPath
-func (m *Metrics) Dump(outputPath string) (err error) {
+func (m *Metrics) Dump(outputPath string) error {
+ // ignore the error if the hostname could not be retrieved as it
+ // is not a critical metric to extract.
+ if hostname, err := os.Hostname(); err == nil {
+ m.metrics.Hostname = proto.String(hostname)
+ }
m.metrics.HostOs = proto.String(runtime.GOOS)
return writeMessageToFile(&m.metrics, outputPath)
}
diff --git a/ui/metrics/metrics_proto/metrics.pb.go b/ui/metrics/metrics_proto/metrics.pb.go
index 05efe13..95ef4da 100644
--- a/ui/metrics/metrics_proto/metrics.pb.go
+++ b/ui/metrics/metrics_proto/metrics.pb.go
@@ -197,12 +197,14 @@
// The metrics for calling Ninja.
NinjaRuns []*PerfInfo `protobuf:"bytes,20,rep,name=ninja_runs,json=ninjaRuns" json:"ninja_runs,omitempty"`
// The metrics for the whole build
- Total *PerfInfo `protobuf:"bytes,21,opt,name=total" json:"total,omitempty"`
- SoongBuildMetrics *SoongBuildMetrics `protobuf:"bytes,22,opt,name=soong_build_metrics,json=soongBuildMetrics" json:"soong_build_metrics,omitempty"`
- BuildConfig *BuildConfig `protobuf:"bytes,23,opt,name=build_config,json=buildConfig" json:"build_config,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ Total *PerfInfo `protobuf:"bytes,21,opt,name=total" json:"total,omitempty"`
+ SoongBuildMetrics *SoongBuildMetrics `protobuf:"bytes,22,opt,name=soong_build_metrics,json=soongBuildMetrics" json:"soong_build_metrics,omitempty"`
+ BuildConfig *BuildConfig `protobuf:"bytes,23,opt,name=build_config,json=buildConfig" json:"build_config,omitempty"`
+ // The hostname of the machine
+ Hostname *string `protobuf:"bytes,24,opt,name=hostname" json:"hostname,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *MetricsBase) Reset() { *m = MetricsBase{} }
@@ -396,6 +398,13 @@
return nil
}
+func (m *MetricsBase) GetHostname() string {
+ if m != nil && m.Hostname != nil {
+ return *m.Hostname
+ }
+ return ""
+}
+
type BuildConfig struct {
UseGoma *bool `protobuf:"varint,1,opt,name=use_goma,json=useGoma" json:"use_goma,omitempty"`
UseRbe *bool `protobuf:"varint,2,opt,name=use_rbe,json=useRbe" json:"use_rbe,omitempty"`
@@ -772,70 +781,71 @@
}
var fileDescriptor_6039342a2ba47b72 = []byte{
- // 1036 bytes of a gzipped FileDescriptorProto
+ // 1047 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xef, 0x4e, 0x1b, 0x47,
0x10, 0xcf, 0x61, 0x83, 0x7d, 0x73, 0xd8, 0x1c, 0x0b, 0x29, 0x97, 0x44, 0xa8, 0x96, 0xd5, 0x44,
0xa8, 0x6a, 0x48, 0x44, 0x23, 0x14, 0xa1, 0xa8, 0x12, 0x18, 0x44, 0x53, 0x04, 0x8e, 0x16, 0x4c,
0xa3, 0xf6, 0xc3, 0x69, 0x7d, 0xb7, 0x86, 0x4b, 0x7d, 0xb7, 0xd6, 0xee, 0x5e, 0x04, 0x79, 0x87,
- 0x3e, 0x55, 0x9f, 0xa5, 0xaf, 0x51, 0x55, 0x3b, 0x7b, 0x67, 0x1f, 0xad, 0xdb, 0xa0, 0x7c, 0xf3,
- 0xce, 0xef, 0xcf, 0xce, 0xec, 0xce, 0xce, 0x19, 0x5a, 0x29, 0xd7, 0x32, 0x89, 0xd4, 0xf6, 0x44,
- 0x0a, 0x2d, 0xc8, 0x9a, 0x12, 0x22, 0xbb, 0x0a, 0x87, 0x79, 0x32, 0x8e, 0xc3, 0x02, 0xea, 0xfe,
- 0x05, 0xe0, 0x9d, 0xda, 0xdf, 0x07, 0x4c, 0x71, 0xf2, 0x12, 0xd6, 0x2d, 0x21, 0x66, 0x9a, 0x87,
- 0x3a, 0x49, 0xb9, 0xd2, 0x2c, 0x9d, 0x04, 0x4e, 0xc7, 0xd9, 0xaa, 0x51, 0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b5,
+ 0xe8, 0x74, 0x4d, 0xbe, 0x85, 0x55, 0x1c, 0x18, 0x21, 0x1b, 0x8f, 0x45, 0x14, 0x46, 0x22, 0xcf,
+ 0x74, 0xd1, 0x67, 0x2b, 0x08, 0xec, 0x9b, 0x78, 0xcf, 0x84, 0xc9, 0x16, 0xf8, 0x55, 0xae, 0x4a,
+ 0x3e, 0x95, 0x4d, 0xd7, 0x9e, 0x51, 0xcf, 0x93, 0x4f, 0xdc, 0x7c, 0x3e, 0x52, 0x76, 0x13, 0x5e,
+ 0x73, 0x36, 0xb1, 0x34, 0xdb, 0x7d, 0x5e, 0xca, 0x6e, 0x7e, 0xe4, 0x6c, 0x62, 0x38, 0x07, 0x0f,
+ 0x7f, 0x29, 0x26, 0x54, 0x71, 0xee, 0x10, 0xff, 0x41, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xb8,
+ 0x9e, 0xa1, 0xd5, 0x51, 0x09, 0x00, 0x00,
}
diff --git a/ui/metrics/metrics_proto/metrics.proto b/ui/metrics/metrics_proto/metrics.proto
index 4d6118b..4e8e12b 100644
--- a/ui/metrics/metrics_proto/metrics.proto
+++ b/ui/metrics/metrics_proto/metrics.proto
@@ -96,6 +96,9 @@
optional SoongBuildMetrics soong_build_metrics = 22;
optional BuildConfig build_config = 23;
+
+ // The hostname of the machine.
+ optional string hostname = 24;
}
message BuildConfig {
diff --git a/ui/metrics/metrics_proto/regen.sh b/ui/metrics/metrics_proto/regen.sh
index 343c638..8eb2d74 100755
--- a/ui/metrics/metrics_proto/regen.sh
+++ b/ui/metrics/metrics_proto/regen.sh
@@ -1,3 +1,17 @@
#!/bin/bash
-aprotoc --go_out=paths=source_relative:. metrics.proto
+# Generates the golang source file of metrics.proto protobuf file.
+
+set -e
+
+function die() { echo "ERROR: $1" >&2; exit 1; }
+
+readonly error_msg="Maybe you need to run 'lunch aosp_arm-eng && m aprotoc blueprint_tools'?"
+
+if ! hash aprotoc &>/dev/null; then
+ die "could not find aprotoc. ${error_msg}"
+fi
+
+if ! aprotoc --go_out=paths=source_relative:. metrics.proto; then
+ die "build failed. ${error_msg}"
+fi