Commit graph

20582 commits

Author SHA1 Message Date
Inseob Kim
2743c1def6 Merge changes I059e639b,I4ebe1da8,Idf4fd37a,Id90082b5 into rvc-dev
* changes:
  Do not disable llndk libraries
  Create only one vendor variant depending on path
  Implement cc_object vendor snapshot
  Refine logic choosing vendor snapshot modules
2020-06-05 04:02:35 +00:00
Jaewoong Jung
30167e8003 Merge "Soong package structure refactoring" into rvc-dev 2020-06-04 16:48:42 +00:00
Tej Singh
8383972ec0 Revert "Always run package check"
This reverts commit aa7359ab0c.

Reason for revert: package-check.sh doesn't work on mac

Change-Id: Ia3dcee612c1f6b4121e1351c8710638ae41bc88a
Merged-In: I50af71d54d5f1f8b516bfcf1efbcf6217e89c83a
2020-06-03 18:45:54 +00:00
Inseob Kim
470b4cf826 Do not disable llndk libraries
LLNDK libraries shouldn't be disabled in any case.

Bug: 157106227
Test: m
Change-Id: I059e639b21d0edb8abc00773891d37e890a36cce
2020-06-03 15:50:07 +09:00
Inseob Kim
af578ffacc Create only one vendor variant depending on path
Not all vendor modules are meant to be working with multiple versions of
vndk unmodified. This restricts all vendor or vendor_available modules
to only one variant. Modules under proprietary directories will only
have BOARD_VNDK_VERSION variant, while modules under AOSP directories
will only have PLATFORM_VNDK_VERSION variant.

Bug: 157106227
Bug: 157133296
Test: capture snapshot from R
Test: try building master with R snapshot
Change-Id: I4ebe1da8d887cd76722fa8ab5ae9305da09074d4
2020-06-03 15:32:44 +09:00
Jaewoong Jung
fccad6b098 Soong package structure refactoring
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.

(This is a cherry-pick change.)

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
Merged-In: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-02 14:35:04 -07:00
Inseob Kim
502679e061 Implement cc_object vendor snapshot
cc_object modules are also necessary for vendor snapshot.

Bug: 157106227
Test: m vendor-snapshot
Change-Id: Idf4fd37a26f6f712f3cbab43133622f9f9bd9372
2020-06-02 14:43:06 +00:00
Inseob Kim
4d8d8fec4a Refine logic choosing vendor snapshot modules
This refines the vendor snapshot codes in order to fix logic errors.

- Capture toolchain_library and cc_library_headers correctly.
- Redirect unwind static library correctly.
- Filter out sanitize / coverage / lto by looking at HideFromMake.
- Add binary() function for clear and shorter codes.
- Include test modules.
- Add more tests to prevent further snapshot breakages.

Bug: 157106227
Test: m vendor-snapshot
Test: m nothing for all available targets
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true \
NATIVE_COVERAGE=true COVERAGE_PATHS="*" m nothing

Change-Id: Id90082b5ab730f928582ad24f022ba410855400e
2020-06-02 23:31:58 +09:00
Paul Duffin
aa7359ab0c Always run package check
Previously, the package check was only run when building checkbuild or
the phony target created for a specific module. It would not run when
building a module that depended upon a library with the
permitted_packages property. That was because the package check was
only run when the package-check.stamp file was built and that was only
added to the phony and checkbuild targets.

Instead of touching a separate package-check.stamp file to indicate
that the check has been performed this change copies the input jar file
to the package check to a separate ../package-check/<jar> file which is
then treated as the output of the library and is the input for any dex
processing. So, any modules that depend on this library will
transitively depend on the output file produced by the package check
command and so will ensure that the package check is always run.

Test: Removed "android.net" from the permitted_packages for
      "framework-tethering", build "framework-tethering" which
      triggered and failed the package check and
      "com.android.tethering" which did not.
      Made this change.
      Built "com.android.tethering" which triggered and then failed the
      package check.
      Removed change to "framework-tethering"
Bug: 157649935
Merged-In: Ib01aa09e13f80282218049270eb7a58ec5f9f605
Change-Id: Ib01aa09e13f80282218049270eb7a58ec5f9f605
(cherry picked from commit 91206d9ed1)
2020-06-02 14:05:34 +01:00
Inseob Kim
c344620ed6 Merge "Capture libeigen's header correctly" into rvc-dev 2020-05-31 15:49:54 +00:00
TreeHugger Robot
07e99ad358 Merge "Add support for remote-execution / caching of jar/zip actions" into rvc-dev 2020-05-31 02:17:58 +00:00
Kousik Kumar
6619d28c15 Merge "Add support for remote-execution / caching of signapk actions" into rvc-dev 2020-05-31 01:10:18 +00:00
Kousik Kumar
6888f1cb7a Merge "Add support for remote-execution / caching of turbine actions" into rvc-dev 2020-05-31 01:10:05 +00:00
Jiyong Park
327b057e84 Merge "Notice file embededd in APEX is deterministic" into rvc-dev 2020-05-30 22:35:47 +00:00
Kousik Kumar
c05da0a90e Add support for remote-execution / caching of jar/zip actions
Test: Ran a build with `RBE_JAR="true" RBE_JAR_EXEC_STRATEGY="remote"
RBE_ZIP="true" RBE_ZIP_EXEC_STRATEGY="remote" ... use_rbe m` and that
succeeded.

Bug: b/156765207
Change-Id: Ia17b532fbb282be414adf879914870082dd0841b
Merged-In: Ia17b532fbb282be414adf879914870082dd0841b
2020-05-30 19:59:10 +00:00
Kousik Kumar
15e9d0dbf8 Add support for remote-execution / caching of signapk actions
Test: "RBE_SIGNAPK=true RBE_SIGNAPK_EXEC_STRATEGY=remote ... use_rbe m" on crosshatch-userdebug and
signapk targets worked
Bug: b/156765091

Change-Id: I4b8c21320c2f38914ef39d3d8f036d885fab4e72
Merged-In: I4b8c21320c2f38914ef39d3d8f036d885fab4e72
2020-05-30 19:58:58 +00:00
Kousik Kumar
d8c3955119 Add support for remote-execution / caching of turbine actions
Test: Ran a sample turbine action with:
RBE_TURBINE_EXEC_STRATEGY="remote" RBE_TURBINE="true" ... use_rbe m out/soong/.intermediates/external/protobuf/libprotobuf-java-micro/android_common/turbine/libprotobuf-java-micro.jar
and checked in reproxy_log.txt that remote-metadata had status SUCCESS.

Bug: b/156765475
Change-Id: I85c334e6998c6dd2a68460b3580d50fffd900e6f
Merged-In: I85c334e6998c6dd2a68460b3580d50fffd900e6f
2020-05-30 12:58:20 -07:00
Jiyong Park
402ace6c25 Notice file embededd in APEX is deterministic
Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 157724521
Test: m
Merged-In: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
(cherry picked from commit 33c7736936)
Change-Id: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
2020-05-30 12:11:16 +00:00
Dan Willemsen
104d9eb54a Better handling of low memory situations
Drop down to a single high-mem task when we've got <=16GB, as the system
probably isn't completely free RAM, ninja will be using a couple gigs,
along with whatever "normal" actions will be running concurrently. So
it's unlikely that we can handle two 6-8GB actions along with everything
else.

Also print warnings when we detect <=16GB total RAM, or when we're
running more parallel jobs than than we have GB RAM. These both notify
the user and suggest lowering the `-j` value if they run into problems.

Bug: 141066538
Test: fake totalRAM to [0.5,8,16]GB, checking warning
Test: fake totalRAM to 17GB, `m -j4 nothing` has no warning
Test: `m -j187 nothing` on a 188GB system
Test: `m -j188 nothing` on a 188GB system
Change-Id: Ieb008e9f462d5f40fb65781d94cf116b1caf8446
Merged-In: Ieb008e9f462d5f40fb65781d94cf116b1caf8446
(cherry picked from commit 570a292bab)
2020-05-29 21:45:06 +00:00
TreeHugger Robot
42ffc3f000 Merge "Refactor RBE support for Javac/R8/D8 to use the remoteexec package." into rvc-dev 2020-05-29 19:33:20 +00:00
TreeHugger Robot
d5c8c67875 Merge "pom2bp: add apex_available/min_sdk_version" into rvc-dev 2020-05-29 16:06:11 +00:00
Inseob Kim
67f3dbca2f Capture libeigen's header correctly
libeigen exports entire directory, but only two directories contain
actual exported headers. And some of headers have no extension. This
adds a special behaviour for external/eigen when capturing snapshot.

Bug: 157106227
Test: m vendor-snapshot captures libeigen's headers
Change-Id: I82f27d4c6c4d472f47d54c545328150697b8cda3
2020-05-29 22:36:38 +09:00
TreeHugger Robot
5cfbb4332f Merge "Collect permitted packages from java_sdk_library instances" into rvc-dev 2020-05-29 13:18:05 +00:00
TreeHugger Robot
484129dfb9 Merge "Ensure package check is run for java_library in APEX" into rvc-dev 2020-05-29 11:40:19 +00:00
Paul Duffin
a105cf99d0 Collect permitted packages from java_sdk_library instances
Switching an updatable boot jar from java_library to java_sdk_library
changed the contents of the updatable-bcp-packages.txt due to the code
requiring the module to be *Library. This change updates that to allow
it to be any module that implements the
PermittedPackagesForUpdatableBootJars interface which is *Library and
anything that embeds that like *SdkLibrary.

Bug: 155164730
Test: m droid and check the contents of system/etc/updatable-bcp-packages.txt
Change-Id: I464af74628da311734f102f77ec8158daec5b32d
2020-05-29 12:35:18 +01:00
Jooyung Han
de58c39bd6 Merge changes from topic "apk-jni-enforce" into rvc-dev
* changes:
  Use sdkSpec to compare sdk_versions of APK/JNI
  Reland "enforce sdk_version for JNI libs for updatable APKs"
2020-05-29 10:33:59 +00:00
Paul Duffin
c552427032 Ensure package check is run for java_library in APEX
Package checks were not being run for java libraries that were in an
APEX and not on the platform. This change fixes that and updates the
script to report all failing classes to make it easier to update the
list of packages.

Test: m java
Bug: 157633658
Change-Id: I28044e08d3a40e9f3464bb2158ef6a28d57264d1
(cherry picked from commit 63d8febd35)
2020-05-29 09:18:13 +01:00
Paul Duffin
a84756c827 java_sdk_library: Propagate shared_library to snapshot
Passes the shared_library property through to the snapshot. It does not
optimize away the default value in order to make it easier to invert
the default value in future. The current default value was only chosen
for convenience because most existing usages were already treated as
shared libraries. It would be safer if modules had to opt in to be used
as shared libraries.

Bug: 155164730
Test: m nothing
Merged-In: I33c7323f2389b44ed49cebe517ae2cce349117f1
Change-Id: I33c7323f2389b44ed49cebe517ae2cce349117f1
(cherry picked from commit d7eb1c2a76)
2020-05-29 09:16:11 +01:00
Jiyong Park
27fc414b84 Add default_to_stubs option to java_sdk_library
Previously, when a lib that doesn't have sdk_version property set
depends on a java_sdk_library, the impl library was used for linking.
This might be too permissive because the client lib might be using empty
sdk_version because it needed some private APIs from the platform, but
not from the java_sdk_library. This actually happend for some of the CTS
tests. They don't set sdk_version, but were directly depending on
android.test.[base|runner|mock].stubs libraries. If we switch the
references to the stub libraries into the corresponding java_sdk_library
modules (e.g. aandroid.test.[base|runner|mock]), then we would be
allowing private APIs to the CTS tests, which is not good.

To solve this problem, default_to_stub property is introduced. It when set
to true prevents the impl lib from being used for linking. When a module
that doesn't have sdk_version depends on it, the widest API surface that
the java_sdk_library provides is linked instead.

Bug: 157007292
Test: m
Merged-In: Id2acc3cafb71d1e90d4fdc9c0c70a73983355e0f
Change-Id: Id2acc3cafb71d1e90d4fdc9c0c70a73983355e0f
(cherry picked from commit 932cdfeb06)
2020-05-29 09:15:09 +01:00
Jiyong Park
ed50ca8dd8 apex respects stem of java_library modules
apex now respects stem of java_library modules.

As a follow-up we need to suppor the same for other types of modules.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 157638999
Test: m
Merged-In: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
(cherry picked from commit a62aa23990)
Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
2020-05-29 14:15:36 +09:00
Jooyung Han
9d2c0f7af2 Use sdkSpec to compare sdk_versions of APK/JNI
"current" is converted to int differently if we use
sdkSpec.effectiveVersion for APK and android.ApiStrToNum for JNI.
For example, in REL branch, "current" is equiv to PlatformSdkVersion
for APK, but 10000(FutureApiVersion) for JNI.

Use sdkSpec.effectiveVersion to compare APK.min_sdk_version and
JNI.sdk_version.

Bug: 145796956
Test: m
Change-Id: I2c4dbb79ae8712004dc3a9e647aa53cd5de7b508
2020-05-28 23:08:04 +00:00
Jooyung Han
af7f91fc9d Reland "enforce sdk_version for JNI libs for updatable APKs"
JNI libs for "updatable" APKs or APKs in "updatable" APEXes should set
sdk_version which is equal to or less than APK's min_sdk_version.

In fact, we'd better check if min_sdk_version of JNI libs matches(or is
earlier than) min_sdk_version of the APK. But for now the build system
can't handle sdk_version/min_sdk_version correctly for JNI libs. That's
why sdk_version of JNI libs is enforced to match with min_sdk_version
of APK in this change.

(original commit: 98c4750f39)

Bug: 145796956
Test: m
Merged-In: I08543ccee7dfda0559a1fca108ceb5c28f84943f
Change-Id: I08543ccee7dfda0559a1fca108ceb5c28f84943f
(cherry picked from commit bbc3fb780b)
2020-05-28 23:06:52 +00:00
Anton Hansson
9e0264c379 Merge "java_sdk_library: Add annotations_enabled property" into rvc-dev 2020-05-28 10:15:23 +00:00
Jooyung Han
519705371a pom2bp: add apex_available/min_sdk_version
apex_available/min_sdk_version are required to be available for mainline
modules(APK/APEX).

- java_import/java_library_static
- android_library/android_library_import

Bug: 156996905
Test: prebuilts/sdk/update_prebuilts.sh
Merged-In: I201ebabaa533c5ee19e394ab30ca2fa0e3d7ce0e
Change-Id: I201ebabaa533c5ee19e394ab30ca2fa0e3d7ce0e
(cherry picked from commit 43d3025cd5)
2020-05-28 18:22:16 +09:00
Anton Hansson
1733d6acf8 Merge "Correct link type for module stubs" into rvc-dev 2020-05-28 08:49:30 +00:00
TreeHugger Robot
b676ead4e1 Merge "Add test_mainline_modules to the auto-gen test config(AndroidJUnitTest only)." into rvc-dev 2020-05-28 06:12:35 +00:00
Paul Duffin
f675264e3c Merge "java_sdk_library: Create separate impl library" into rvc-dev 2020-05-28 01:38:09 +00:00
Jiyong Park
b7431abffe Merge changes from topic "apex_available_art" into rvc-dev
* changes:
  Remove apex_available whitelist for the ART APEX
  DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
2020-05-28 00:49:45 +00:00
Jaewoong Jung
0feed89b7c Make android_app_import multi targets arch module.
I made a mistake and only fixed android_test_import in my previous
change, I5bbb2d2b733bbd6b868898285683ba5ff45be10b.

(This is a cherry-pick change.)

Bug: 154281342
Test: TreeHugger
Test: chromium-webview
Change-Id: I1575d9ef3f8596f1eb8db0867db09de08945d711
Merged-In: I1575d9ef3f8596f1eb8db0867db09de08945d711
2020-05-27 14:45:37 -07:00
Artur Satayev
07d215215b Merge changes I4ab7e1a3,Ib525b2f5,I2d4c54fb into rvc-dev
* changes:
  Generate combined deps-info for all updatable modules.
  Remove ApexBundleDepsInfo.MinSdkVersion()
  Add "updatable" property to ApexModule interface.
2020-05-27 20:58:27 +00:00
TreeHugger Robot
753c739e2f Merge "Add preprocessed property for android_test_import" into rvc-dev 2020-05-27 17:21:19 +00:00
Paul Duffin
9d582cc985 java_sdk_library: Create separate impl library
Most dependencies on java_sdk_library instances (JSL) simply reference
them by name and rely on the build to pick the correct part, impl,
stubs for a specific scope, headers or implementation jars or dex jars.
Generally, the build gets that decision right. If it does not the for
most of the components of the JSL there is a way to reference them
directly. However, that is not true for the implementation library as
that is created the JSL itself.

Access to the implementation library should be avoided as it opens up
the possibility that use will be made of an API that is not tracked and
maintained which could lead to compatibility issues. However, there is
a case where use of the implementation library is required and safe.
That is when it is being used from other libraries within the same APEX
as the JSL. In that case the JSL and its dependencies will be updated
together so compatibility is not an issue.

This change adds a new <module>.impl java_library that compiles the
implementation library in the same way as the JSL itself does. This will
allow the modules that are blocked from converting to JSL because of
this limitation to progress. Initially the library is only for use
for compiling but follow up changes will switch the rest of the build
from using the implementation library created by JSL to the separate
module.

It also adds the ability to give the separate .impl library a more
restrictive visibility than the JSL further limiting misuse.

Bug: 156618935
Test: m droid, flash, atest CtsProviderTestCases - sniff test
      tested that it fixes compilation issues with mainline module
Merged-In: Ifc4799feb4ada9dec8021efc13fe6a953bf2edd3
Change-Id: Ifc4799feb4ada9dec8021efc13fe6a953bf2edd3
(cherry picked from commit 5df793011d)
2020-05-27 18:15:57 +01:00
Paul Duffin
2ce1e81b3e java_sdk_library: Add annotations_enabled property
Passes it through to droidstubs.

Bug: 155164730
Test: m droid
Change-Id: I8b23a959ce33716dfc4572488a1fd3f6bab73a17
2020-05-27 17:52:53 +01:00
Artur Satayev
2b4b7bbe82 Generate combined deps-info for all updatable modules.
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.

Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Merged-In: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 849f844252)
2020-05-27 17:51:18 +01:00
Jooyung Han
93a06c10e9 Remove ApexBundleDepsInfo.MinSdkVersion()
For java.AndroidApp app, app.MinSdkVersion() was selected from
ApexBundleDepsInfo, not from java.Module.
This caused app.MinSdkVersion() to return "" always.

Besides, having two embeded fields and relying on depth to choose one of
them makes it hard to read.

Bug: 156537348
Test: m
Merged-In: Ib525b2f5132c596db8e33492d0a565ea23e91d1c
Change-Id: Ib525b2f5132c596db8e33492d0a565ea23e91d1c
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 98d63e1cc7)
2020-05-27 17:51:14 +01:00
Ulya Trafimovich
c0eb0b1ae5 Add "updatable" property to ApexModule interface.
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.

Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Merged-In: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 7c140d828a)
2020-05-27 17:50:51 +01:00
Liz Kammer
3d8779dd6f Merge "Add signing lineage for runtime_resource_overlay" into rvc-dev 2020-05-27 16:39:20 +00:00
Anton Hansson
5e8c81a91d Merge "Improve the structure of the link check method" into rvc-dev 2020-05-27 11:09:53 +00:00
Paul Duffin
174b26e7d3 Switch droiddoc to use SdkHeaderJars()
Previously, droiddoc was using SdkImplementationJars() to get a JAR to
add to the classpath in order to resolve unknown references in the
source.

Given that SdkHeaderJars() returns jars created by Turbine which are
(for compilation at least) functionally identical to the implementation
jars there is no point in using the implementation jars.

Bug: 148080325
Test: m nothing
Merged-In: I2b718cc1445c04e849dcb0b1f53bba2b0bd90c95
Change-Id: I2b718cc1445c04e849dcb0b1f53bba2b0bd90c95
(cherry picked from commit 649dadfb87)
2020-05-27 07:41:18 +01:00
Paul Duffin
bf19a97965 java_sdk_library: Expose implementation within APEX
Access to the implementation JARs is restricted to avoid code from
depending on implementation details that could change from one release
to the next which could cause compatibility issues. That is not a
problem when referenced from within the APEX that contains the
java_sdk_library.

As references from within the same APEX often need to access
implementation specific details of the java_sdk_library and doing that
from within the same APEX is safe this change all references to a
java_sdk_library made within the same APEX to use the implementation
jars instead of stub jars.

Bug: 155164730
Test: m droid
Change-Id: If239059690de61683c2ad2d8a0ce2e47286a3637
(cherry picked from commit 9b879594ed)
2020-05-27 07:41:18 +01:00