Commit Graph

21357 Commits

Author SHA1 Message Date
Liz Kammer 2d2fd859bb Add imports_sdk_version to prebuilt_apis
This allows setting the prebuilt sdk's generated java_imports
sdk_version to "none".

Test: go tests
Test: m
Bug: 160455085
Change-Id: Id24aca811f0f09692971e63418da6685d8351737
2020-08-20 09:48:50 -07:00
Martin Stjernholm c004862309 Resolve prebuilt module explicitly for dex2oat tool dependencies.
Test: m nothing
Bug: 145934348
Change-Id: If27984be26976a3abe8cb5e21cf174d5e71beb8a
2020-08-20 16:05:45 +01:00
Ulya Trafimovich b8063c6a86 Use common helper functions for getting sorted map keys.
Add a new helper SortedIntKeys similar to SortedStringKeys.

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I08a43ec2cae7d1a82531295aca1a0658e3a0dd6f
2020-08-20 12:37:03 +01:00
Ulya Trafimovich 4b6d4c12cc Propagate transitive <uses-library> dependencies through static libraries.
Bug: 163037089
Test: lunch aosp_cf_x86-userdebug && m nothing
Test: added testcase in Soong
Change-Id: I943d497d779ca218a16e7208029189a1a69086c1
2020-08-20 12:34:42 +01:00
Ulyana Trafimovich 9b67bbd11c Merge "Collect paths to transitive SDK Java library dependencies." am: 9ce2221791
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1402668

Change-Id: I2f12e92ce08bd75d19073a0ba19aca2b07142422
2020-08-20 11:02:10 +00:00
Ulyana Trafimovich 9ce2221791 Merge "Collect paths to transitive SDK Java library dependencies." 2020-08-20 10:37:58 +00:00
Dan Shi 95d19422a6 Add extra_test_configs option
Bug: 163344047
Test: m -j HelloWorldHostTest hello_world_test HelloWorldTests
Change-Id: I237e3aa3f40df1f6387ba8ff6a16e56535cdeae9
2020-08-19 15:27:03 -07:00
Colin Cross 053fca10c9 Support ninja rsp files in soong_zip
Add a -r argument to soong_zip that reads a list of files from a file
like the -l argument but treats it as a Ninja rsp file with escaping.
Replace the -l arguments in Soong that are using rsp files with -r.

Fixes: 162435077
Test: TestReadRespFile, TestZip
Change-Id: I4605312e99406ab1bd0c37af9c5ad212393f0403
2020-08-19 21:18:56 +00:00
Colin Cross cb6143a142 Capture list of unused methods when shrinking in R8
Use the -printusage flag in R8 to output a list of the unused
methods.  Some of the files can be large (2MB for DocumentsUI,
87MB for all of AOSP), so immediately zip them and remove the
originals.  The zipped files will be merged and disted.

Bug: 151857441
Test: m TARGET_BUILD_APPS=DocumentsUI dist
Change-Id: I780e84e80eba7fe4d4fa15fec0f461890afd900b
2020-08-19 11:19:14 -07: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
Ulya Trafimovich 31e444e101 Collect paths to transitive SDK Java library dependencies.
Previously only the names were collected, and later used in the
manifest_fixer to add missing <uses-library> entries to the manifest.
Now we also need to collect build-time and on-device paths, to be used
in class loader context for dexpreopt. This commit only collects paths,
but does not pass them to dexpreopt yet.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I34b229ee68f16ba215ba03770feadb4d890ec2bf
2020-08-19 13:51:21 +01:00
Treehugger Robot 2a3d0ade4c Merge "Add AIDL compiler to allowed Rust paths" am: 2d815963ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1394307

Change-Id: Ib892f2d01237bf56592356fdefa32859d13a6378
2020-08-18 22:12:44 +00:00
Treehugger Robot 2d815963ba Merge "Add AIDL compiler to allowed Rust paths" 2020-08-18 22:00:42 +00:00
Ramy Medhat f668917c25 Add Goma deprecation PSA to soong.
Test: build with Goma
Change-Id: Ie7e146285afd40bc0a1dc17a0b898960f57a118b
2020-08-18 17:29:48 -04:00
Dan Albert d12afec49c Allow globally disabling some clang-tidy checks.
Test: used for the upcoming compiler update
Bug: None
Change-Id: Id17db2c48fa3e165da81a1d084827bde142406dd
2020-08-18 13:28:03 -07:00
Jaewoong Jung b3669f516c Merge "Add data bin and lib properties to sh_test" am: 1b7bc1c4b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403829

Change-Id: I7f8cc56597ffd5bcc23a40385172dab2baf7441f
2020-08-18 19:54:23 +00:00
Jaewoong Jung 1b7bc1c4b2 Merge "Add data bin and lib properties to sh_test" 2020-08-18 19:46:27 +00:00
Treehugger Robot b1d3c4c4d7 Merge "Revert "Deduplicate APEX variants that would build identically"" am: fc4d79598c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403647

Change-Id: I5f42f292247599f4f374ecdba31fdb72088de3ad
2020-08-18 17:32:22 +00:00
Treehugger Robot fc4d79598c Merge "Revert "Deduplicate APEX variants that would build identically"" 2020-08-18 17:19:40 +00:00
Jaewoong Jung 6e0eee522d Add data bin and lib properties to sh_test
This attempts to reland I7b64de4b06e9bba3fba3712b25dd9f9d112e1625
by fixing Mac-related test issues, yet again.

Test: sh_binary_test.go
Test: Modified ziptool-tests
Bug: 156980228
Change-Id: Id3952e136c1dabfcd34048b6c9f31d0125a623df
2020-08-18 09:25:34 -07:00
Jaewoong Jung de47113bd0 Merge "Revert "Add data bin and lib properties to sh_test"" am: ff6752dfbc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403827

Change-Id: I618d6e2a5d74b617466a666c903c36c0f86e8b18
2020-08-18 16:05:33 +00:00
Jaewoong Jung ff6752dfbc Merge "Revert "Add data bin and lib properties to sh_test"" 2020-08-18 15:53:33 +00:00
Jaewoong Jung 105699aee2 Revert "Add data bin and lib properties to sh_test"
This reverts commit a41a8877cb.

Reason for revert: Broke Darwin builds

Change-Id: I4371d735ffea51f7c349b4d223bc91c103163015
2020-08-18 15:34:45 +00:00
Jaewoong Jung baffa3d08e Merge "Add data bin and lib properties to sh_test" am: a55e8945fa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1402208

Change-Id: I7a7ac19f579e6a3ae1fa89e12a0e5772316f81a7
2020-08-18 15:32:58 +00:00
Jaewoong Jung a55e8945fa Merge "Add data bin and lib properties to sh_test" 2020-08-18 15:17:40 +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
Anton Hansson ac3addb71b Merge "Remove special-cased stub deps on framework-res" am: 85f59b7b54
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1398475

Change-Id: Ib1af1a2fead8bbe5e78b111b09246c70e1efe655
2020-08-18 12:12:21 +00:00
Anton Hansson 85f59b7b54 Merge "Remove special-cased stub deps on framework-res" 2020-08-18 11:58:57 +00:00
Anton Hansson 8dffd9e1aa Merge "Add a tagged output for app's exportPackage" am: 72ce814def
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1398474

Change-Id: If2e7914eff1aec89d76c3a666a57773547bf852d
2020-08-18 11:48:15 +00:00
Anton Hansson 72ce814def Merge "Add a tagged output for app's exportPackage" 2020-08-18 11:38:46 +00:00
Treehugger Robot aa3235edcc Merge "Deduplicate APEX variants that would build identically" am: ca29a25d38
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399832

Change-Id: Ic3727a541bb7a098fe81ca0d4cf92e2139f1a7ab
2020-08-18 05:07:22 +00:00
Treehugger Robot ca29a25d38 Merge "Deduplicate APEX variants that would build identically" 2020-08-18 04:50:12 +00:00
Treehugger Robot b8b19daf9d Merge "Make the default exec strategy for javac/r8/d8 remote local fallback." am: 90905c0c68
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399527

Change-Id: I7e2b1be312e1d0ccf2b77f463bce343852aa091f
2020-08-18 01:07:12 +00:00
Treehugger Robot 90905c0c68 Merge "Make the default exec strategy for javac/r8/d8 remote local fallback." 2020-08-18 00:54:03 +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 ed688224e9 Merge "Override EarlyModuleContext.Namespace" am: 8cb67e4358
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1401847

Change-Id: I798a7fa68345ed7407d8ab3d6c99933392915ad2
2020-08-17 19:49:24 +00:00
Treehugger Robot 8cb67e4358 Merge "Override EarlyModuleContext.Namespace" 2020-08-17 19:37:39 +00:00
Jaewoong Jung a41a8877cb Add data bin and lib properties to sh_test
This attempts to reland I7b64de4b06e9bba3fba3712b25dd9f9d112e1625
by fixing Mac-related test issues.

Test: sh_binary_test.go
Test: Modified ziptool-tests
Bug: 156980228
Change-Id: Icb7bfb183f6a1d429caefc05b0550aff292d7633
2020-08-17 10:01:41 -07:00
Treehugger Robot 73a14bb9e5 Merge "Rename class2greylist" am: 51636c0ae9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1398467

Change-Id: I636354f2b13cd9352855faf66b10d273318dfcbe
2020-08-17 16:35:29 +00:00
Treehugger Robot 51636c0ae9 Merge "Rename class2greylist" 2020-08-17 16:33:21 +00:00
Treehugger Robot 1fe098e329 Merge "Propagate settings for building in an unbundled tree." am: ba161370aa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1396067

Change-Id: I2b04c4721c1317281aaa9b9b28f62baa2940dc26
2020-08-17 13:48:50 +00:00
Treehugger Robot ba161370aa Merge "Propagate settings for building in an unbundled tree." 2020-08-17 13:35:16 +00:00
Anton Hansson 8f903f30ff Remove special-cased stub deps on framework-res
This dep is now possible to express in native Android.bp syntax,
which makes the build easier to understand.

Bug: 161214753
Test: build sdk, diff out/dist before and after
Change-Id: I878eda49b5bf54aaf581fc52e0fe9719e4bcdfce
Merged-In: I878eda49b5bf54aaf581fc52e0fe9719e4bcdfce
2020-08-17 11:00:03 +01:00
Anton Hansson 092aca410f Add a tagged output for app's exportPackage
This allows the android stubs to depend on framework-res' exportPackage
without special-casing inside the build system.

Bug: 161214753
Test: depending on this output in a followup CL
Change-Id: I8c5d17540d2624974983d73e56ba17898505dba8
2020-08-17 11:00:00 +01:00
Thiébaud Weksteen 745e90d802 Merge "rust: modify linting properties" am: 2346b014eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1398468

Change-Id: Ie468f2f2826c3b5016fff975c38d8c31b9add3b5
2020-08-17 07:13:20 +00:00
Thiébaud Weksteen 2346b014eb Merge "rust: modify linting properties" 2020-08-17 07:01:14 +00:00
Treehugger Robot be9a9035f2 Merge "Rename ApexName to ApexVariationName" am: a07777d434
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399831

Change-Id: Ia9682ee4bbf068131fa6f807f9f74075faba14ed
2020-08-15 06:52:17 +00:00
Treehugger Robot a07777d434 Merge "Rename ApexName to ApexVariationName" 2020-08-15 06:43:52 +00:00
Jaewoong Jung ce59a88137 Revert "Add data bin and lib properties to sh_test" am: cc1bfd6aa0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1401770

Change-Id: I193be0f0cbe1c5fb9abf12d881b40a9f14ba8171
2020-08-15 01:26:28 +00:00
Jaewoong Jung cc1bfd6aa0 Revert "Add data bin and lib properties to sh_test"
This reverts commit 91dbd520de.

Reason for revert: Fix CLs didn't completely fix the builds.

Test: sh_binary_test.go
Bug: 156980228
Bug: 164465992
Change-Id: I1ed214c2ea6cd460db909a103c4b3a9a895ad9f7
2020-08-14 18:11:23 -07:00