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

Commit 3bc8e218 authored by Paul Duffin's avatar Paul Duffin
Browse files

Avoid permitted_packages related build failures in unbundled builds

Unbundled builds cause AlwaysUsePrebuiltSdks() to return true which
causes java_sdk_library_import modules to be preferred instead of their
corresponding java_sdk_library module. That causes the
platform-bootclasspath module to depend on prebuilt versions of modules
like framework-statsd which currently do not specify
permitted_packages and so cause a failure.

This is a temporary hack to prevent an unbundled build from checking
for permitted_packages. It can be removed once the prebuilts have been
updated to include the permitted_packages.

Bug: 193095050
Bug: 193889859
Test: m TARGET_BUILD_APPS=Calendar apps_only
      - before the change it failed in Soong.
      - after the change it started failing, later in Make, so the
        Soong problem has been worked around.
      - I reverted all the recent changes to permitted_packages and
        ran this and it still failed so that failure is unrelated to
        these changes.
Change-Id: I213d35437d76d61cf616d1f16dae213b311c6c8e
parent f87aae53
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -423,8 +423,13 @@ func (b *platformBootclasspathModule) generateBootImageBuildActions(ctx android.
	// Generate the framework profile rule
	// Generate the framework profile rule
	bootFrameworkProfileRule(ctx, imageConfig)
	bootFrameworkProfileRule(ctx, imageConfig)


	// If always using prebuilt sdks then do not generate the updatable-bcp-packages.txt file as it
	// will break because the prebuilts do not yet specify a permitted_packages property.
	// TODO(b/193889859): Remove when the prebuilts have been updated.
	if !ctx.Config().AlwaysUsePrebuiltSdks() {
		// Generate the updatable bootclasspath packages rule.
		// Generate the updatable bootclasspath packages rule.
		generateUpdatableBcpPackagesRule(ctx, imageConfig, updatableModules)
		generateUpdatableBcpPackagesRule(ctx, imageConfig, updatableModules)
	}


	// Copy non-updatable module dex jars to their predefined locations.
	// Copy non-updatable module dex jars to their predefined locations.
	nonUpdatableBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, nonUpdatableModules)
	nonUpdatableBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, nonUpdatableModules)