Commit Graph

1379 Commits

Author SHA1 Message Date
Colin Cross
ef70e3f8bc Merge changes I6aa28149,I1ff35ea9 am: 3806fc0943 am: fb6ddeb5fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406258

Change-Id: I5d1ca5d5927b3a3c8641a17d2bc40cf10352c1e9
2020-08-27 01:28:50 +00:00
Colin Cross
42507337e5 Only request image and version variations for device SDK dependencies
AddFarVariationDependencies was broken, which allowed sdk modules to
request dependencies using image and version variations, even for
host modules that do not have image or version variations.  Make
the image and version variations conditional on device sdk modules.

Test: go test ./sdk
Change-Id: I59b7a32a3782254fd5feb828a5258ee13d4db812
2020-08-26 11:51:51 -07:00
Jeongik Cha
5f0b222aab Update apex/allowed_deps.txt
Bug: 165255241
Test: TARGET_BUILD_APPS=something UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true m
Merged-In: I9f98361aa248b82cb58527a5cd59e6d17c3e8723
Change-Id: I9f98361aa248b82cb58527a5cd59e6d17c3e8723
(cherry picked from commit 0c0234b982)
2020-08-26 12:43:06 +00:00
Colin Cross
9e93b1bb12 Remove TestApexWithJniLibs_Errors
AddFarVariationDependencies was broken, which allowed dependencies
on non-libraries to be added even though a link variation was
requested.  When AddFarVariationDependencies is fixed, attempting
to add a non-library to jni_libs results in the usual missing
variant error.

Test: none
Change-Id: I6aa281491b8af5f141a2d132e248c75f95d68ab5
2020-08-21 16:18:11 -07:00
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
Jeongik Cha
0c0234b982 Update apex/allowed_deps.txt
Bug: 165255241
Test: TARGET_BUILD_APPS=something UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true m
Change-Id: I9f98361aa248b82cb58527a5cd59e6d17c3e8723
2020-08-19 07:17:17 +00: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
Ulyana Trafimovich
a17ed4d5a7 Merge "Add structured representation for colon-separated jar lists." am: 910eb70891 am: 434e708101 am: 67ee1adb6a am: b696ad8f31 am: cc2d5c2215
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1354005

Change-Id: I2c29f4095add1b56a1d0222e88b54650577ea0b1
2020-08-06 17:11:02 +00:00
Ulyana Trafimovich
67ee1adb6a Merge "Add structured representation for colon-separated jar lists." am: 910eb70891 am: 434e708101
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1354005

Change-Id: I155b303e73442fb44f38621bf0fa9f2157a77370
2020-08-06 16:05:43 +00:00
Ulyana Trafimovich
910eb70891 Merge "Add structured representation for colon-separated jar lists." 2020-08-06 15:07:27 +00:00
Colin Cross
895b0cd4ec Merge "Add libraryDependencyTag to track dependencies on static and shared libraries" am: 2eddd06879 am: f6c453a3fd am: 7f034dabf1 am: 6ba6e16f17 am: a4c3ca5e1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1378332

Change-Id: Id5c3bd1af0f963a397e0af152b34a274401298ed
2020-08-06 13:46:40 +00:00
Colin Cross
7f034dabf1 Merge "Add libraryDependencyTag to track dependencies on static and shared libraries" am: 2eddd06879 am: f6c453a3fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1378332

Change-Id: I20996cc0ed388013f24966a2d8a9462177bfe45e
2020-08-06 13:12:06 +00:00
Colin Cross
2eddd06879 Merge "Add libraryDependencyTag to track dependencies on static and shared libraries" 2020-08-06 00:06:28 +00:00
Dan Albert
091ba117fe Merge "Update allowed deps for CRT objects." into rvc-dev-plus-aosp am: 5c18b33b7b am: bdc0326fb8 am: 4df45b4755
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/12222134

Change-Id: I7024ac6e2db9e5c65f77860f8aec4a5c5a898b52
2020-08-05 22:28:56 +00:00
Dan Albert
5c18b33b7b Merge "Update allowed deps for CRT objects." into rvc-dev-plus-aosp 2020-08-05 21:36:19 +00:00
Artur Satayev
c1584f0ef8 Merge "Add PHONY for apex-allowed-deps check." into mainline-prod 2020-08-05 14:07:08 +00:00
Ulya Trafimovich
249386ad69 Add structured representation for colon-separated jar lists.
With the addition of apexes and /system_ext some of the bootclasspath
and system server jars have moved from /system to the new locations.
This has been implemented by using lists of colon-separated strings
called "apex-jar pairs" (although "apex" was misleading as it could
refer to "platform" or "system_ext", not necessarily a real apex).

Using the colon-separated string representation is inconvenient, as it
requires splitting and reassembling the list components many times,
which harms performance and makes error handling difficult. Therefore
this patch refactors the colon-separated lists into a struct that
hides the implementation details.

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Id248ce639a267076294f4d4d73971da2f2f77208
2020-08-05 09:59:30 +01:00
Yifan Hong
e60f3060ab Merge "Support com.android.gki.* in apex_available." am: ea3574b5fa am: 64f018a438 am: bf36a921bc am: 88cd53cc7a am: b74877cee1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1375480

Change-Id: I975d79efde7f2e3c2fefc2e4f80ccf95973d93f7
2020-08-04 20:59:42 +00:00
Yifan Hong
bf36a921bc Merge "Support com.android.gki.* in apex_available." am: ea3574b5fa am: 64f018a438
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1375480

Change-Id: Ia2be931170e1e70ad8c1583999011b03ad8cc45e
2020-08-04 19:31:13 +00:00
Yifan Hong
ea3574b5fa Merge "Support com.android.gki.* in apex_available." 2020-08-04 19:06:08 +00:00
Artur Satayev
dde4f22b1a Add PHONY for apex-allowed-deps check.
Bug: 149622332
Test: m apex-allowed-deps-check
Change-Id: I5848779b4ad04dd4c95e2667f7f62dd2949ac95e
Merged-In: I5848779b4ad04dd4c95e2667f7f62dd2949ac95e
2020-08-04 17:32:00 +01:00
Artur Satayev
01aa11e833 Add PHONY for apex-allowed-deps check.
Bug: 149622332
Test: m apex-allowed-deps-check
Change-Id: I5848779b4ad04dd4c95e2667f7f62dd2949ac95e
2020-08-03 18:28:26 +01:00
Treehugger Robot
24634c5cc5 Merge "Update language to comply with inclusive guidance" am: cf04073b43 am: abeb7c4538 am: c03dc74149 am: 66c2f9a88d am: e6d4bbfa97
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1374706

Change-Id: Ib7d3592a1a9b7d2c1f03520d6673d06168b42fe8
2020-08-01 00:56:04 +00:00
Treehugger Robot
c03dc74149 Merge "Update language to comply with inclusive guidance" am: cf04073b43 am: abeb7c4538
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1374706

Change-Id: Ie032c705309843d27f26699818fa6a8065808a99
2020-07-31 23:35:03 +00:00
Treehugger Robot
cf04073b43 Merge "Update language to comply with inclusive guidance" 2020-07-31 22:50:49 +00:00
Paul Duffin
df4daaebff Fix prebuilt mutator ordering in tests am: 021f4e525f am: 8537c9cb30 am: 0f460aa9db am: fb52ad8c1d am: 6ad7fdee3d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1380179

Change-Id: I468c9a52ff6672fb1bf8d88711c93d36d9cf6c58
2020-07-31 18:39:47 +00:00
Paul Duffin
0f460aa9db Fix prebuilt mutator ordering in tests am: 021f4e525f am: 8537c9cb30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1380179

Change-Id: I77be0b785a95bdb943c8ead613f8e2d7b1d32776
2020-07-31 17:45:54 +00:00
Paul Duffin
021f4e525f Fix prebuilt mutator ordering in tests
Previously, the prebuilt mutators were added by the
cc.RegisterRequiredBuildComponentsForTest() function as a convenience
but unfortunately it lead to some of the mutators being in a different
order in the tests than in the normal build.

This change:
* Extracts the RegisterPrebuiltMutators() call from
  cc.RegisterRequiredBuildComponentsForTest()
* Makes sure that the prebuilt mutators are registered before the
  visibility gatherer and enforcer mutators.

Bug: 162505935
Test: m nothing
Change-Id: I7d959b558200b502f0a5e4653c41ea01414e142a
2020-07-31 16:12:01 +01:00
Yifan Hong
d22a84a88b Support com.android.gki.* in apex_available.
com.android.gki.* matches any APEX with the prefix com.android.gki.,
like com.android.gki.bar.

Test: use it
Bug: 162267963
Change-Id: Ie46fcb08b031611d26b2b6cde157253f51ba9bfc
2020-07-30 18:20:37 -07:00
Yifan Hong
e38b23bf39 Merge "Prevent GKI APEXes to write to $OUT/apex." am: 222de6f13b am: 2eda377fe7 am: b6dc9efd63 am: b1e4cf9276 am: 03ab95fc7b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1375481

Change-Id: I82350d332f7052a7128db5dd208fa41d33995e1d
2020-07-31 01:17:39 +00:00
Yifan Hong
b6dc9efd63 Merge "Prevent GKI APEXes to write to $OUT/apex." am: 222de6f13b am: 2eda377fe7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1375481

Change-Id: I7f2d6bee83af1118b041d4294d63e7fd5e6e0433
2020-07-31 00:27:44 +00:00
Yifan Hong
222de6f13b Merge "Prevent GKI APEXes to write to $OUT/apex." 2020-07-30 23:45:23 +00:00
TreeHugger Robot
f20cec92fe Merge changes I5a180544,Ifdf9bf97 into rvc-dev am: 0f4ab3cd46
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/12226427

Change-Id: I284fdbdbd4708f613996d7758d3d0b652e01840b
2020-07-30 17:47:55 +00:00
TreeHugger Robot
0f4ab3cd46 Merge changes I5a180544,Ifdf9bf97 into rvc-dev
* changes:
  Build transitive lint reports for apex modules
  Add environment variables to control lint checks
2020-07-30 17:33:59 +00: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