Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a4ccd18 authored by Ulyana Trafimovich's avatar Ulyana Trafimovich Committed by Ulya Trafimovich
Browse files

Revert^2 "Use boot image extension for framework libraries."

This reverts commit 3fae7662
Reason: re-applying the change after resolving the problem with
coverage builds (in a related CL).

Use boot image extension for framework libraries.
This patch splits the system boot image in two parts:

  - The ART boot image. This is the primary boot image that is
    included in the ART apex and contains dexpreopted Core Libraries.

  - The framwework boot image extension. It depends on the ART boot
    image and contains framework libraries.

The third "apex" boot image (used in the JIT-zygote experiment)
remains unchanged; it is a monolithic primary boot image that
contains both libcore and framework libraries.

Dexpreopting of APKs now uses the framework boot image extension
(which in turn pulls in the ART boot image as a dependency).

Bug: 146462581
Bug: 119800099

Test: aosp_walleye-userdebug boots.

Change-Id: I06c5ac5fca011fa639ed208735462ab32451df3a
parent 11e1ae02
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ func TestDexpreoptBootJars(t *testing.T) {

	pathCtx := android.PathContextForTesting(config)
	dexpreoptConfig := dexpreopt.GlobalConfigForTests(pathCtx)
	dexpreoptConfig.ArtApexJars = []string{"foo", "bar", "baz"}
	dexpreoptConfig.BootJars = []string{"foo", "bar", "baz"}
	setDexpreoptTestGlobalConfig(config, dexpreoptConfig)

	ctx := testContext()
@@ -59,9 +59,10 @@ func TestDexpreoptBootJars(t *testing.T) {

	dexpreoptBootJars := ctx.SingletonForTests("dex_bootjars")

	bootArt := dexpreoptBootJars.Output("boot.art")
	bootArt := dexpreoptBootJars.Output("boot-foo.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",
@@ -82,19 +83,19 @@ func TestDexpreoptBootJars(t *testing.T) {
	expectedOutputs := []string{
		"dex_bootjars/system/framework/arm64/boot.invocation",

		"dex_bootjars/system/framework/arm64/boot.art",
		"dex_bootjars/system/framework/arm64/boot-foo.art",
		"dex_bootjars/system/framework/arm64/boot-bar.art",
		"dex_bootjars/system/framework/arm64/boot-baz.art",

		"dex_bootjars/system/framework/arm64/boot.oat",
		"dex_bootjars/system/framework/arm64/boot-foo.oat",
		"dex_bootjars/system/framework/arm64/boot-bar.oat",
		"dex_bootjars/system/framework/arm64/boot-baz.oat",

		"dex_bootjars/system/framework/arm64/boot.vdex",
		"dex_bootjars/system/framework/arm64/boot-foo.vdex",
		"dex_bootjars/system/framework/arm64/boot-bar.vdex",
		"dex_bootjars/system/framework/arm64/boot-baz.vdex",

		"dex_bootjars_unstripped/system/framework/arm64/boot.oat",
		"dex_bootjars_unstripped/system/framework/arm64/boot-foo.oat",
		"dex_bootjars_unstripped/system/framework/arm64/boot-bar.oat",
		"dex_bootjars_unstripped/system/framework/arm64/boot-baz.oat",
	}
+9 −5
Original line number Diff line number Diff line
@@ -167,15 +167,15 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
		}

		// Framework config for the boot image extension.
		// It includes both the Core libraries and framework.
		// It includes framework libraries and depends on the ART config.
		frameworkCfg := bootImageConfig{
			extension:        false,
			extension:        true,
			name:             frameworkBootImageName,
			stem:             "boot",
			installSubdir:    frameworkSubdir,
			modules:          concat(artModules, frameworkModules),
			dexLocations:     concat(artLocations, frameworkLocations),
			dexLocationsDeps: concat(artLocations, frameworkLocations),
			modules:          frameworkModules,
			dexLocations:     frameworkLocations,
			dexLocationsDeps: append(artLocations, frameworkLocations...),
		}

		// Apex config for the  boot image used in the JIT-zygote experiment.
@@ -231,6 +231,10 @@ 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)
}