Commit Graph

782 Commits

Author SHA1 Message Date
Treehugger Robot
952140ab59 Merge "Reland: Deduplicate APEX variants that would build identically" am: 68bfe074c6 am: a3d1c127a2 am: 4d9984eeb1 am: 76309aab5d am: a106e405e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405087

Change-Id: I5ba652222b6c9ed40fd8c643f92485b26842bd9b
2020-08-21 08:43:24 +00:00
Treehugger Robot
4d9984eeb1 Merge "Reland: Deduplicate APEX variants that would build identically" am: 68bfe074c6 am: a3d1c127a2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405087

Change-Id: I7cf0c8d2c27757395e54fb4cc8592f438aa6ccaa
2020-08-21 07:38:47 +00:00
Treehugger Robot
68bfe074c6 Merge "Reland: Deduplicate APEX variants that would build identically" 2020-08-21 06:46:51 +00:00
Colin Cross
aede88c1c7 Reland: 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.

This relands I0529837476a253c32b3dfb98dcccf107427c742c with a fix
to always mark permissions XML files of java_sdk_library modules as
unique per apex since they contain the APEX filename, and a fix
to UpdateUniqueApexVariationsForDeps to check ApexInfo.InApexes
instead of DepIsInSameApex to check if two modules are in the same
apex to account for a module that depends on another in a way that
doesn't normally include the dependency in the APEX (e.g. a libs
property), but the dependency is directly included in the APEX.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I2ae170601f764e5b88d0be2e0e6adc84e3a4d9cc
2020-08-19 10:21:17 -07:00
Treehugger Robot
2172bcbfd6 Merge "Revert "Deduplicate APEX variants that would build identically"" am: fc4d79598c am: b1d3c4c4d7 am: 671aed59c9 am: d65caf6abb am: a9862dd9d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403647

Change-Id: I4a6c1fd673b35a260e865b183e0cfd6b3d67bd4e
2020-08-18 18:13:38 +00:00
Treehugger Robot
671aed59c9 Merge "Revert "Deduplicate APEX variants that would build identically"" am: fc4d79598c am: b1d3c4c4d7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403647

Change-Id: Ia2db2038480c3e09e7c82c1766f9b922e5cc6a11
2020-08-18 17:42:08 +00:00
Pete Bentley
0c7b26e0e2 Revert "Deduplicate APEX variants that would build identically"
This reverts commit d6b2525b00.

Reason for revert: <Breaks tests - confirmed by Forrest: b/165188843>

Change-Id: I7cb68cb87522415004390c0672dc774e0067b122
2020-08-18 13:44:59 +00:00
Treehugger Robot
86555c4c41 Merge "Deduplicate APEX variants that would build identically" am: ca29a25d38 am: aa3235edcc am: 1f160e818b am: a485326840 am: 888957e15e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399832

Change-Id: I81e8534c2a28478bdf896b245615087def124f11
2020-08-18 05:50:40 +00:00
Treehugger Robot
1f160e818b Merge "Deduplicate APEX variants that would build identically" am: ca29a25d38 am: aa3235edcc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399832

Change-Id: I4fe0cc33956d110e6bb1de49183470eb21992fbf
2020-08-18 05:19:52 +00:00
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
Treehugger Robot
93480617f7 Merge "Rename ApexName to ApexVariationName" am: a07777d434 am: be9a9035f2 am: 11ff8974eb am: 30bcd5efde am: 87733af000
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399831

Change-Id: Iebb18f17f745570384d883a1d98f37a80fed3ec5
2020-08-15 07:35:11 +00:00
Treehugger Robot
11ff8974eb Merge "Rename ApexName to ApexVariationName" am: a07777d434 am: be9a9035f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399831

Change-Id: I31f1d4eedbad29ac1562834ea70eb52e0c543ecd
2020-08-15 07:02:47 +00:00
Treehugger Robot
a07777d434 Merge "Rename ApexName to ApexVariationName" 2020-08-15 06:43:52 +00:00
Treehugger Robot
f019a14a84 Merge "Update ApexAvailableBaseline" am: 52cefc00f7 am: 1efeaa552c am: 33e3c3f94c am: ef4471483b am: 2a22fb207c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1396192

Change-Id: Iaad93c8be6c3d63f0c9b9f94e3c9eb5ab1a449c0
2020-08-14 05:12:55 +00:00
Treehugger Robot
33e3c3f94c Merge "Update ApexAvailableBaseline" am: 52cefc00f7 am: 1efeaa552c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1396192

Change-Id: I4c2f21c16c21f134df2b2b00f84c7b66f6a16fc1
2020-08-14 04:11:52 +00:00
Colin Cross
e07f2316b7 Rename ApexName to ApexVariationName
In preparation for reusing the same variation for multiple apexes,
rename ApexName to ApexVariationName.

Bug: 164216768
Test: all soong tests
Change-Id: I88f2c5b192ffa27acd38e01952d0cefd413222a0
2020-08-13 17:50:29 -07:00
Jeongik Cha
839fc6659c Update ApexAvailableBaseline
Remove ipmemorystore-aidl-interfaces-java in allowlist for
com.android.tethering

Bug: 146436251
Test: m nothing
Change-Id: I8b7f97d59c2fd191f467ad50a8fd66d9a5d37704
2020-08-11 13:07:18 +09:00
Jooyung Han
fd14bf1a61 Merge "apex: set ":vndk" as required for vendor apexes" am: b0c4d3b319 am: feb217de25 am: db457de0dd am: 3efdf3d287 am: 69676d264e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1376856

Change-Id: I3d97f4450bb927ae413ab7fbf59fe480c69c47cd
2020-07-30 01:25:15 +00:00
Jooyung Han
db457de0dd Merge "apex: set ":vndk" as required for vendor apexes" am: b0c4d3b319 am: feb217de25
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1376856

Change-Id: I4c3a194b68df9245ca0f39fc938e01acab4443a3
2020-07-30 00:30:36 +00:00
Jooyung Han
b0c4d3b319 Merge "apex: set ":vndk" as required for vendor apexes" 2020-07-30 00:00:44 +00:00
Paul Duffin
f289d09d9f Merge "Avoid creating APEX variant for sdk member" am: f91079f120 am: 89a55fdeab am: ce0832b6b4 am: fe20c26f23 am: 9b0e811a7d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371417

Change-Id: Ib196b8d31dc8a5c6a1b83e8b13860eb0618c6f5a
2020-07-29 12:56:32 +00:00
Paul Duffin
ce0832b6b4 Merge "Avoid creating APEX variant for sdk member" am: f91079f120 am: 89a55fdeab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371417

Change-Id: I2f78788711e46680321dbf926d63b308ec631bec
2020-07-29 12:05:41 +00:00
Paul Duffin
f91079f120 Merge "Avoid creating APEX variant for sdk member" 2020-07-29 11:33:12 +00:00
Jooyung Han
6c4cc9ce23 apex: set ":vndk" as required for vendor apexes
When a vendor APEX sets use_vndk_as_stable: true, then the apex doesn't
bundle VNDK libraries but instead it uses them from the "vndk" namespace
at runtime.

":vndk" is a pseudo-name for VNDK libraries, which is processed by
linkerconfig so that the generated linker configuration allows the
namespace for the apex to access VNDK libs.

Bug: 159576928
Test: test with a test-only vendor apex
      it runs okay with VNDK libs. (lsof shows that it opens libs from
      VNDK APEX)
Change-Id: I924ce0fea696162575f59589b8f858deddf436b3
2020-07-29 16:00:54 +09:00
Treehugger Robot
e6dc3252b5 Merge "Add apex.use_vndk_as_stable property" am: 4514d96e18 am: 23b4b611ce am: 24387e75b6 am: e6533cd15b am: 61c5710359
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1369777

Change-Id: I62ffe94d9810998395a05f4790143dafed41bc07
2020-07-29 02:41:25 +00:00
Treehugger Robot
24387e75b6 Merge "Add apex.use_vndk_as_stable property" am: 4514d96e18 am: 23b4b611ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1369777

Change-Id: Ie89bff6ef687936a825c050c2cb1a4296ed7a458
2020-07-29 01:45:57 +00:00
Treehugger Robot
4514d96e18 Merge "Add apex.use_vndk_as_stable property" 2020-07-29 01:27:46 +00:00
Yo Chiang
6201c3a8cc Merge "Use BaseModuleName() + SubName as apexFile.moduleName" am: 060dc0bea2 am: bc2647f97b am: cb7fa1a353 am: 4e62d37eda am: 3c5564ceff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371679

Change-Id: I7d0dc04f522b836aa4e61d07f66f5e65427b5a9b
2020-07-28 12:32:28 +00:00
Yo Chiang
cb7fa1a353 Merge "Use BaseModuleName() + SubName as apexFile.moduleName" am: 060dc0bea2 am: bc2647f97b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371679

Change-Id: I7413e68bdac18091ee1146e6536e97bb55df1ad5
2020-07-28 11:46:55 +00:00
Jooyung Han
df78e216a8 Add apex.use_vndk_as_stable property
Vendor APEXes(in general, APEXes for non-system partitions) which is
supposed to be tied to a specific VNDK version can set this new property
so that it excludes VNDK libs and use them from VNDK APEX (provided by
system parition).

For these APEXes to use VNDK libs from VNDK APEX, linkerconfig should
link "vndk" linker namespace to the namespaces of these APEXes.

Bug: 159195575
Test: m (soong test added)
Change-Id: If90650973239ef7aab0ff084488bda57d9b0364e
2020-07-27 11:36:52 +09:00
Treehugger Robot
8f27c4e612 Merge "Build transitive lint reports for apex modules" am: 13aa44fc15 am: 5388d97b37 am: 4826c2668d am: 7df9fd8e51 am: d99ca92460
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1370779

Change-Id: I8449eb661077630f03455bc90a9b1547aeb09e4d
2020-07-24 12:53:47 +00:00
Treehugger Robot
4826c2668d Merge "Build transitive lint reports for apex modules" am: 13aa44fc15 am: 5388d97b37
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1370779

Change-Id: I08069e90ec451f09aa7bbea3e8b4834d6cb7ef67
2020-07-24 12:16:40 +00:00
Yo Chiang
e812805e75 Use BaseModuleName() + SubName as apexFile.moduleName
This change fixes this error:
```
TARGET module com.android.adbd.flattened requires non-existent TARGET
module: prebuilt_libclang_rt.ubsan_standalone-arm-android
```

apexFile.moduleName is used as Make dependency name, so it should use
m.BaseModuleName() instead of m.Name(), because soong may prepend
"prebuilt_" to or mutate the output of m.Name() in other ways.

android/androidmk.go emits Android.mk modules with
`LOCAL_MODULE := module.BaseModuleName() + <SubName>`, so replace
apexFile.moduleName with BaseModuleName() + <SubName> as much as
possible.

Bug: 7456955
Test: Add unit test in apex/apex_test.go
Test: lunch blueline_hwasan && SANITIZE_TARGET='hwaddress fuzzer' m nothing
Test: Verify out/soong/Android-blueline_hwasan.mk
Change-Id: If8537fc1bedbe6c3405de3662a5df210a073c43f
2020-07-24 20:05:20 +08:00
Treehugger Robot
13aa44fc15 Merge "Build transitive lint reports for apex modules" 2020-07-24 11:50:39 +00:00
Treehugger Robot
57435ab685 Merge "apexDepsMutator uses WalkDeps" am: e8bc288702 am: 6b3adfad17 am: 6528e9c7ab am: cadc52e391 am: f0cbb33b64
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1369776

Change-Id: Iff055618fb36b2693d7104dbb588b40172c73b9a
2020-07-24 10:39:26 +00:00
Paul Duffin
a37eca27c8 Avoid creating APEX variant for sdk member
Previously, an APEX variant was created for a module that was a member
of an SDK just in case it had to be replaced with an APEX requested
snapshotted version of that member. That was necessary because that was
the only way to have APEX specific replacements.

Since then a new method called ReplaceDependenciesIf() has been added
which provides fine grained control over which dependencies are
replaced. This change uses that new method to handle the replacements
which allows the APEX variants to be removed.

Bug: 161928524
Test: m nothing
Change-Id: If3869dd6753dc182b099af566b20fbc9c9c6eff7
2020-07-24 11:10:10 +01:00
Treehugger Robot
6528e9c7ab Merge "apexDepsMutator uses WalkDeps" am: e8bc288702 am: 6b3adfad17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1369776

Change-Id: Iae6756d1e810734676fbbb10f41a6bb3cfb49624
2020-07-24 09:52:37 +00:00
Jooyung Han
698dd9f007 apexDepsMutator uses WalkDeps
apexDepsMutator marks all dependencies of apex modules. Previously, it
was converted from WalkDeps() to Top-down mutator to avoid the pitfall
of WalkDeps() bug. (It did't handle multiple visits via different
paths.)

Because WalkDeps() problem solved in aosp/1277516, apexDepsMutator can
be reverted to use WalkDeps().

Even though there's no observable difference between them, I revert this
for the up-coming change, which requires different pruning strategies
per apexes.

Bug: 159195575
Test: m
Change-Id: Ib09cbc7a3dfd143dd37b660b1aea6c71392ce2e3
2020-07-23 13:54:50 +09:00
Colin Cross
08dca38eb0 Build transitive lint reports for apex modules
Build and export transitive lint report zips for apex modules.

Bug: 153485543
Test: m TARGET_BUILD_APPS=com.google.android.wifi lint-check dist
Change-Id: I5a1805440452301a7e2c4ca91482b989638b54fb
2020-07-22 20:16:14 -07:00
Christopher Parsons
1901959274 Merge "Install data_libs using relative_install_path property" am: fef9d4b601 am: 4a016f49a9 am: 39e1f73131 am: dc52de4058 am: a42b2aac34
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359742

Change-Id: Ie1fcfbe935158b327827cf562024370807934760
2020-07-21 18:57:50 +00:00
Christopher Parsons
39e1f73131 Merge "Install data_libs using relative_install_path property" am: fef9d4b601 am: 4a016f49a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359742

Change-Id: I29f194fa1649a4f36f81f62d0c47c595e07994f5
2020-07-21 18:11:31 +00:00
Christopher Parsons
fef9d4b601 Merge "Install data_libs using relative_install_path property" 2020-07-21 17:26:57 +00:00
Chris Parsons
216e10a0f6 Install data_libs using relative_install_path property
Test: Added to data_libs tests
Test: Manually verified with bionic-unit-tests
Test: Treehugger
Change-Id: I28a8e08e3409f1e7c7bb72f4351310b57f35f513
2020-07-20 13:59:24 -04:00
Treehugger Robot
2e5bd33847 Merge "apex_set is force disabled when necessary" am: f70ceecc4c am: 005a5724ca am: 615d01cae9 am: bd13ffdc35 am: d392ec8d1c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1364697

Change-Id: I190f13a8a4436c18a8197a065f192d376b77e7dc
2020-07-20 02:25:47 +00:00
Treehugger Robot
615d01cae9 Merge "apex_set is force disabled when necessary" am: f70ceecc4c am: 005a5724ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1364697

Change-Id: Iee2b6e2c90304339df052806ea5e727ba7fffdab
2020-07-20 01:50:32 +00:00
Jiyong Park
10e926bc8d apex_set is force disabled when necessary
prebuilt_apex has been disabled when the device is configured for
flattened APEXes, sanitized, instrumented, or built unbundled. However,
apex_set which is another type of APEX prebuilt wasn't disabled for the
same conditions.

This change fixes the discripency. apex_set modules are also force
disabled when the prebuilts are not expected.

Bug: 161316762
Bug: 160933444
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m
The built image has only the flattened APEXes and the device boots

Change-Id: I6c90dfb28d565861a473a1bdce93269ec370601d
2020-07-17 12:37:16 +09:00
Treehugger Robot
57a428085e Merge changes Iefcf4fbe,I450d4769,I1ffc7e7b am: 2c79c871d9 am: 3757864b5f am: 0f472e62f9 am: d0a71cfc12 am: 0dfb92432e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1354643

Change-Id: Ic45c69f64ac0f82d229de78c026fe7a316728cd9
2020-07-09 13:31:34 +00:00
Treehugger Robot
0f472e62f9 Merge changes Iefcf4fbe,I450d4769,I1ffc7e7b am: 2c79c871d9 am: 3757864b5f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1354643

Change-Id: I35b96bffc99f9066982e6ea99332fb84c8f7a840
2020-07-09 12:56:24 +00:00
Martin Stjernholm
58c33f073d Do not follow prebuiltDependencyTags in APEX payload walks.
If prebuilts are active they will have the other direct dependencies
from the source modules.

Bug: 151303681
Test: m nothing
Test: `m` with prebuilts/runtime in the manifest (along with other
  fixes)
Change-Id: I1ffc7e7b528ed9db5ce6ca2ee96c9d23c6548c49
2020-07-07 18:12:41 +01:00
Treehugger Robot
a3543ddcc5 Merge changes Ifd2858dd,I2585dd99,I65e7a456 am: 0c6f111d7b am: d6b1515935 am: 08c3d0cf7f am: cb98726ff1 am: c4f4cb338e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348951

Change-Id: Ibaf2cfc38e688bfd77ceb4698008af9e63599934
2020-06-29 03:23:19 +00:00