Revert "Use boot image extension for framework libraries."

This reverts commit 4d2eeed0da.

Reason for revert: breaks avd/avd_boot_health_check test
  on cf_x86_phone-userdebug_coverage on branch rvc-release
  (the device fails to boot).

Test: m
Test: aosp_walleye-userdebug boots

Bug: 145749668

Exempt-From-Owner-Approval: revert

Change-Id: Ie1d93a200222e26461c1bcd384fdb69b7351e259
This commit is contained in:
Ulyana Trafimovich 2019-12-11 10:31:32 +00:00
parent ce482dce02
commit 3fae7662ee
3 changed files with 22 additions and 23 deletions

View File

@ -178,6 +178,12 @@ func skipDexpreoptBootJars(ctx android.PathContext) bool {
return false
}
func skipDexpreoptArtBootJars(ctx android.BuilderContext) bool {
// with EMMA_INSTRUMENT_FRAMEWORK=true ART boot class path libraries have dependencies on framework,
// therefore dexpreopt ART libraries cannot be dexpreopted in isolation => no ART boot image
return ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK")
}
type dexpreoptBootJars struct {
defaultBootImage *bootImage
otherImages []*bootImage
@ -187,7 +193,7 @@ type dexpreoptBootJars struct {
// Accessor function for the apex package. Returns nil if dexpreopt is disabled.
func DexpreoptedArtApexJars(ctx android.BuilderContext) map[android.ArchType]android.OutputPaths {
if skipDexpreoptBootJars(ctx) {
if skipDexpreoptBootJars(ctx) || skipDexpreoptArtBootJars(ctx) {
return nil
}
return artBootImageConfig(ctx).imagesDeps
@ -216,8 +222,10 @@ func (d *dexpreoptBootJars) GenerateBuildActions(ctx android.SingletonContext) {
// Always create the default boot image first, to get a unique profile rule for all images.
d.defaultBootImage = buildBootImage(ctx, defaultBootImageConfig(ctx))
// Create boot image for the ART apex (build artifacts are accessed via the global boot image config).
d.otherImages = append(d.otherImages, buildBootImage(ctx, artBootImageConfig(ctx)))
if !skipDexpreoptArtBootJars(ctx) {
// Create boot image for the ART apex (build artifacts are accessed via the global boot image config).
d.otherImages = append(d.otherImages, buildBootImage(ctx, artBootImageConfig(ctx)))
}
if global.GenerateApexImage {
// Create boot images for the JIT-zygote experiment.
d.otherImages = append(d.otherImages, buildBootImage(ctx, apexBootImageConfig(ctx)))

View File

@ -48,7 +48,7 @@ func TestDexpreoptBootJars(t *testing.T) {
pathCtx := android.PathContextForTesting(config, nil)
dexpreoptConfig := dexpreopt.GlobalConfigForTests(pathCtx)
dexpreoptConfig.BootJars = []string{"foo", "bar", "baz"}
dexpreoptConfig.ArtApexJars = []string{"foo", "bar", "baz"}
setDexpreoptTestGlobalConfig(config, dexpreoptConfig)
ctx := testContext(bp, nil)
@ -59,10 +59,9 @@ func TestDexpreoptBootJars(t *testing.T) {
dexpreoptBootJars := ctx.SingletonForTests("dex_bootjars")
bootArt := dexpreoptBootJars.Output("boot-foo.art")
bootArt := dexpreoptBootJars.Output("boot.art")
expectedInputs := []string{
"dex_artjars/apex/com.android.art/javalib/arm64/boot.art",
"dex_bootjars_input/foo.jar",
"dex_bootjars_input/bar.jar",
"dex_bootjars_input/baz.jar",
@ -83,19 +82,19 @@ func TestDexpreoptBootJars(t *testing.T) {
expectedOutputs := []string{
"dex_bootjars/system/framework/arm64/boot.invocation",
"dex_bootjars/system/framework/arm64/boot-foo.art",
"dex_bootjars/system/framework/arm64/boot.art",
"dex_bootjars/system/framework/arm64/boot-bar.art",
"dex_bootjars/system/framework/arm64/boot-baz.art",
"dex_bootjars/system/framework/arm64/boot-foo.oat",
"dex_bootjars/system/framework/arm64/boot.oat",
"dex_bootjars/system/framework/arm64/boot-bar.oat",
"dex_bootjars/system/framework/arm64/boot-baz.oat",
"dex_bootjars/system/framework/arm64/boot-foo.vdex",
"dex_bootjars/system/framework/arm64/boot.vdex",
"dex_bootjars/system/framework/arm64/boot-bar.vdex",
"dex_bootjars/system/framework/arm64/boot-baz.vdex",
"dex_bootjars_unstripped/system/framework/arm64/boot-foo.oat",
"dex_bootjars_unstripped/system/framework/arm64/boot.oat",
"dex_bootjars_unstripped/system/framework/arm64/boot-bar.oat",
"dex_bootjars_unstripped/system/framework/arm64/boot-baz.oat",
}

View File

@ -135,10 +135,6 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
deviceDir := android.PathForOutput(ctx, ctx.Config().DeviceName())
artModules := global.ArtApexJars
// In coverage builds ART boot class path jars are instrumented and have additional dependencies.
if ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") {
artModules = append(artModules, "jacocoagent")
}
frameworkModules := android.RemoveListFromList(global.BootJars,
concat(artModules, getJarsFromApexJarPairs(global.UpdatableBootJars)))
@ -166,15 +162,15 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
}
// Framework config for the boot image extension.
// It includes framework libraries and depends on the ART config.
// It includes both the Core libraries and framework.
frameworkCfg := bootImageConfig{
extension: true,
extension: false,
name: frameworkBootImageName,
stem: "boot",
installSubdir: frameworkSubdir,
modules: frameworkModules,
dexLocations: frameworkLocations,
dexLocationsDeps: append(artLocations, frameworkLocations...),
modules: concat(artModules, frameworkModules),
dexLocations: concat(artLocations, frameworkLocations),
dexLocationsDeps: concat(artLocations, frameworkLocations),
}
// Apex config for the boot image used in the JIT-zygote experiment.
@ -230,10 +226,6 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
c.zip = c.dir.Join(ctx, c.name+".zip")
}
// specific to the framework config
frameworkCfg.dexPathsDeps = append(artCfg.dexPathsDeps, frameworkCfg.dexPathsDeps...)
frameworkCfg.imageLocations = append(artCfg.imageLocations, frameworkCfg.imageLocations...)
return configs
}).(map[string]*bootImageConfig)
}