platform_build_soong/android
Colin Cross d6b2525b00 Deduplicate APEX variants that would build identically
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories.  This causes unnecessary
build time and disk space for duplicated work.

Deduplicate APEX variants that would build identically.  Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.

This has one significant change in behavior.  Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs.  After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.

In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs.  However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.

This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I0529837476a253c32b3dfb98dcccf107427c742c
2020-08-17 15:18:31 -07:00
..
soongconfig Soong package structure refactoring 2020-06-01 13:44:48 -07:00
Android.bp Merge "Reland "Add prebuilt_build_tool to allow genrules to use prebuilt tools"" 2020-08-07 20:27:40 +00:00
android_test.go Share buildDir for android/soong/android tests 2019-06-10 15:51:06 -07:00
androidmk.go Merge "Fix droiddoc disting when WITHOUT_CHECK_API is true." 2020-08-10 05:22:24 +00:00
androidmk_test.go Fix dist(s)-with-tag and add tests to prevent regression. 2020-07-21 12:30:39 +00:00
apex.go Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
apex_test.go Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
api_levels.go Merge "Apex: support codenames for min_sdk_version" 2020-04-25 04:41:44 +00:00
arch.go Merge "Remove TARGET_PREFER_32_BIT support." 2020-06-10 18:07:06 +00:00
arch_test.go Make it possible to specify separate rules for native_bridge case 2020-06-09 13:31:37 +02:00
bazel_overlay.go Create a AOSP Bazel overlay workspace with Soong 2020-08-06 10:24:21 +00:00
config.go Remove obsolete PDK build functionality 2020-08-11 01:11:44 +00:00
config_test.go
csuite_config.go Create C-Suite config module 2019-10-18 18:28:00 +00:00
csuite_config_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
defaults.go Add hook to be called after defaults have been applied 2020-05-06 08:55:19 +01:00
defaults_test.go Fix product variables in defaults modules 2020-02-06 17:43:29 -08:00
defs.go Reland "Add prebuilt_build_tool to allow genrules to use prebuilt tools" 2020-08-06 15:56:38 -07:00
depset.go Add DepSets 2020-07-16 12:50:11 -07:00
depset_test.go Add DepSets 2020-07-16 12:50:11 -07:00
env.go Call Delve using exec() instead of "dlv attach". 2020-05-18 09:50:18 +02:00
expand.go Fix android.Expand and ninja escaping 2019-07-11 14:52:17 -07:00
expand_test.go Fix android.Expand and ninja escaping 2019-07-11 14:52:17 -07:00
filegroup.go Reland "Support per-module MakeVars" 2020-08-06 15:56:09 -07:00
hooks.go Add SrcPath to InstallHookContext 2020-06-04 01:26:16 +01:00
image.go Add ramdisk image. 2020-01-22 16:54:18 -08:00
makefile_goal.go Add makefile_goal. 2020-07-28 09:51:15 -07:00
makevars.go Reland "Support per-module MakeVars" 2020-08-06 15:56:09 -07:00
metrics.go Collect metrics from inside soong_build 2020-02-25 20:50:00 +00:00
module.go Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
module_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
mutator.go Add CreateAliasVariation to BottomUpMutatorContext 2020-08-13 17:50:05 -07:00
mutator_test.go Add FinalDeps mutator phase, where CreateVariations is disallowed. 2020-01-21 11:40:02 +00:00
namespace.go Simplify vendor conditionals 2020-01-24 16:43:40 -08:00
namespace_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
neverallow.go Update neverallows path for sdkextensions 2020-08-11 10:32:21 +01:00
neverallow_test.go Add makefile_goal. 2020-07-28 09:51:15 -07:00
notices.go Make a soong-only copy of generate-notice-files.py 2020-03-03 13:50:53 -08:00
onceper.go Convert droidstubs to android.RuleBuilder 2019-07-18 14:28:14 -07:00
onceper_test.go Prevent hangs in OncePer when the callback panics 2019-05-14 18:40:13 +00:00
override_module.go Fix out/soong/Android-<>.mk reproducibility 2020-07-01 15:13:58 -07:00
package.go Simplify package by using LoadHook instead of mutators 2020-05-05 20:47:04 +01:00
package_ctx.go Refactor RBE support for Javac/R8/D8 to use the remoteexec package. 2020-04-28 11:37:20 -04:00
package_test.go Simplify package by using LoadHook instead of mutators 2020-05-05 20:47:04 +01:00
path_properties.go Dedup path properties across property structs 2019-07-16 09:52:23 -07:00
path_properties_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
paths.go Install data_libs using relative_install_path property 2020-07-20 13:59:24 -04:00
paths_test.go Apply "excludes" for OutputFileProducer 2020-07-05 10:23:14 +09:00
phony.go Define Soong phony rules in Make 2020-06-09 14:38:50 -07:00
prebuilt.go Do not consider disabled prebuilt variants. 2020-07-15 14:27:13 +01:00
prebuilt_build_tool.go Reland "Add prebuilt_build_tool to allow genrules to use prebuilt tools" 2020-08-06 15:56:38 -07:00
prebuilt_test.go Do not consider disabled prebuilt variants. 2020-07-15 14:27:13 +01:00
proto.go Add method to determine variations from a Target 2019-10-16 14:52:30 -07:00
register.go Define Soong phony rules in Make 2020-06-09 14:38:50 -07:00
rule_builder.go Add sandbox property to the javadoc rule. 2020-06-17 22:57:42 -04:00
rule_builder_test.go Add support for order-only dependencies to RuleBuilder 2020-02-28 18:16:13 +00:00
sandbox.go Sandbox soong_build by changing to root directory 2020-01-11 01:11:46 +00:00
sdk.go Disable all host OS variants except those explicitly included. 2020-08-03 21:06:50 +01:00
singleton.go Define Soong phony rules in Make 2020-06-09 14:38:50 -07:00
soong_config_modules.go Merge "soong config: add value_variable substitution" 2020-04-09 20:16:08 +00:00
soong_config_modules_test.go soong config: add value_variable substitution 2020-03-24 07:15:16 -07:00
test_suites.go Add dist target for robolectric-tests.zip 2020-07-20 17:19:02 -07:00
testing.go Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
util.go Add gcov coverage support to Rust modules. 2020-05-05 10:30:15 -04:00
util_test.go Optimize FirstUniqueStrings and FirstUniquePaths 2020-03-02 15:00:15 -08:00
variable.go Remove obsolete PDK build functionality 2020-08-11 01:11:44 +00:00
variable_test.go Fix product variables in defaults modules 2020-02-06 17:43:29 -08:00
visibility.go Fix special case when appending a visibility rule to //visibility:private. 2020-05-14 16:52:24 +01:00
visibility_test.go Add //visibility:override to allow control over inheritance 2020-05-12 20:07:46 +01:00
vts_config.go Rename VTS to VTS10 2020-03-28 16:42:17 -07:00
vts_config_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
writedocs.go Add missing soong_docs inputs 2020-06-26 10:36:18 -04:00