Commit graph

1186 commits

Author SHA1 Message Date
Xin Li
429c23c1fa Merge Android R
Bug: 168057903
Merged-In: I9d5d0da0f409bd6b131f7e0f6363be061d3045c1
Change-Id: Ie7feaf6a3d0787c750de17540969b876a4306b0a
2020-09-09 20:21:02 -07:00
Jiyong Park
41f637d653 Notice files for prebuilt_etc are included in APEX
This change fixes a bug that notice files for some module type (e.g.
prebuilt_etc) were not included in APEX. This happened because we relied
on WalkPayloadDeps which actually doesn't traverse module types that
don't implement ApexModule interface. prebuilt_etc is one such module
type. Fixing the problem by also iterating the filesInfo array which
has info about all modules that are included in the APEX.

Bug: 166575301
Test: m com.android.tzdata and inspect the built artifact.
NOTICE.html.gz is there.

Change-Id: Iceb055b60184aef2a3e65e44680304853eb79a53
2020-09-09 13:19:56 +09:00
Mark Chien
288f40ba51 Merge "Include bpf program in APEXes" am: 66a0ae60f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418308

Change-Id: I86983c1012615e95d1d9aac875a52e92248a17b8
2020-09-04 09:11:22 +00:00
Mark Chien
66a0ae60f8 Merge "Include bpf program in APEXes" 2020-09-04 08:58:21 +00:00
Ramy Medhat
16f23a4038 Check UseRBE is set before replacing any template with the RE version.
Test: presubmit
Change-Id: I6df58b4e700f0d231367af2710672d731d20a736
2020-09-03 01:29:49 -04:00
Colin Cross
90d0500699 Merge changes I59b7a32a,Ida7bc75a am: 0329f2398c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406259

Change-Id: I9b2b709c59630394aa528c64b4fbe60b52d50be5
2020-09-03 00:21:49 +00:00
Colin Cross
0329f2398c Merge changes I59b7a32a,Ida7bc75a
* changes:
  Only request image and version variations for device SDK dependencies
  Create os and arch variants for GoBinaryTool modules
2020-09-02 23:51:53 +00:00
markchien
2f59ec98d1 Include bpf program in APEXes
bpf program is put to an APEX via 'bpfs' property. It is
placed under etc/bpf directory in it.

Fix: 167530625
Test: m
Change-Id: Ia36b486f0cffb619ecc4f7a318cde881abc5baf4
2020-09-02 22:18:25 +08:00
Jooyung Han
4c92cad10e Merge commit '0703fd873fe2ed492266a4457a1e217971c2f4f0' into manual_merge_1e3d9fb376aaf1be6de1bd16a9004ccc95226ab0
Change-Id: I7115a50254e23e3f7d9cdab960c671195746978e
2020-09-02 14:19:18 +09:00
Xin Li
ca52d2ff53 Merge "Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)" into stage-aosp-master 2020-09-01 20:01:23 +00:00
Jooyung Han
0703fd873f apex: support prebuilt_firmware for vendor apexes
prebuilt_firmware module is one of many prebuilt_etc-like modules. When
it is soc-specific, it is installed in /vendor/firmware. Similarly, when
prebuilt_firmware is embeded in a vendor apex, installing it in
<apex>/firmware instead of <apex>/etc.

Bug: 162701747
Test: lunch sunfish-userdebug
      m && device boots && vibrator works
Change-Id: I00d28cde42259aaf8221e3897df77efc42b0c1ca
2020-09-01 10:45:13 +09:00
Colin Cross
9c35c9ae63 Merge "Remove hack for platform availability of modules with missing apexes" 2020-08-31 04:20:18 +00:00
Xin Li
65cb5c69ea Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae
Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
2020-08-29 01:17:45 -07:00
Nikita Ioffe
a0254b5289 Merge "Add F2FS support for APEX build system" 2020-08-28 21:55:24 +00:00
Colin Cross
d2c81a7933 Remove hack for platform availability of modules with missing apexes
The affected modules weren't actually built in the affected build,
delay the platform availability check in Make instead to allow
the build to proceed.

Bug: 154888298
Test: m checkbuild
Change-Id: I21778e38e04635545b352dee2043a33ec9da246b
2020-08-28 13:32:02 -07:00
Theotime Combes
4ba38c1a3f Add F2FS support for APEX build system
Add the new property payload_fs_type in apex module type. Either 'f2fs'
or 'ext4'. Default 'ext4'.

Test: m

Bug: 158453869
Change-Id: I36f373251bd597e11acb62af75437a87e2a531ec
Merged-In: I36f373251bd597e11acb62af75437a87e2a531ec
2020-08-28 12:03:00 +00:00
Jooyung Han
b9007609f6 apex: dedup jni_libs when generating apex_manifest
When we package both 32/62, there could be two instances of the same
library. We need to dedup the list of jni_libs.

Bug: n/a
Test: m com.android.cronet (which uses jni_libs)
      check apex_manifest.pb
Change-Id: I9a9f42f0f5219ab7bc50d945b54113b5d823b7f3
2020-08-28 16:33:16 +09: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
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
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
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
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
a07777d434 Merge "Rename ApexName to ApexVariationName" 2020-08-15 06:43: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
910eb70891 Merge "Add structured representation for colon-separated jar lists." 2020-08-06 15:07:27 +00:00
Colin Cross
2eddd06879 Merge "Add libraryDependencyTag to track dependencies on static and shared libraries" 2020-08-06 00:06:28 +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
ea3574b5fa Merge "Support com.android.gki.* in apex_available." 2020-08-04 19:06:08 +00:00
Treehugger Robot
cf04073b43 Merge "Update language to comply with inclusive guidance" 2020-07-31 22:50:49 +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
222de6f13b Merge "Prevent GKI APEXes to write to $OUT/apex." 2020-07-30 23:45:23 +00:00
Jooyung Han
b0c4d3b319 Merge "apex: set ":vndk" as required for vendor apexes" 2020-07-30 00:00:44 +00:00
Yifan Hong
93a90db516 Prevent GKI APEXes to write to $OUT/apex.
Multiple GKI APEXes may write to the same path
under $OUT/apex. Prevent it.

Fixes: 162366062
Test: build GKI APEX

Change-Id: I1b19870b10d6da2a85c3f7b9d93408d3a0fe90bc
2020-07-29 13:39:57 -07:00
Colin Cross
6e511a9a9f Add libraryDependencyTag to track dependencies on static and shared libraries
dependencyTag uses a set of predefined tags to identify different types
of dependencies.  There are already multiple bits of metadata stored
in the dependency tag (Library, Shared, ReexportFlags), and supporting
them all requires a combinatorial explosion of predefined tags and
causes issues when using equality comparisons if a new bit of metadata
is added.

Add a new libraryDependencyTag type that will contain the metadata
bits, and replace the quality comparisons with checks on the metadata
bits.

There are 5 TODOs where modifying the checks identified problems with
the existing checks.  These were left in place to produce identical
build output and will be fixed separately.

Bug: 162437057
Test: no change to build.ninja or {Android,make_vars,late}-${TARGET_PRODUCT}.mk
Change-Id: I72d4207dcf381c07c92e00e5a03968ebb5ed8d30
2020-07-29 13:22:30 -07: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
4514d96e18 Merge "Add apex.use_vndk_as_stable property" 2020-07-29 01:27:46 +00:00
Liz Kammer
cada807a92 Update language to comply with inclusive guidance
Update android_app_set to use word install rather than master for
android_app_sets, this better matches the phrasing used for apex_set.

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Test: m nothing
Change-Id: I429e7f8b16c42c10ad4d9543110f5ce814a893b1
2020-07-28 15:47:38 -07: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
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
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
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
Liz Kammer
0a51aa2c98 Use RelativeInstallPath for DataPaths in apex
The RelativeInstallPath is currently unused for apexes; however, as it
stands, relative install paths would be handled differently for
flattened and unflattened apexes.

Test: go java test
Test m nothing

Change-Id: Iad9350642cad27c4f745cea6e5fc9e11e7b06ee4
2020-07-21 13:29:37 -07: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
f70ceecc4c Merge "apex_set is force disabled when necessary" 2020-07-20 01:17:06 +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
0add164d0e Merge "Pass unstripped JNI libraries to Make" am: bf81ed4fd1 am: 9a6d827dc3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1356262

Change-Id: I99a111aafcab5a8a8a5b704b9dd67904c93b0aea
2020-07-16 23:19:16 +00:00
Treehugger Robot
bf81ed4fd1 Merge "Pass unstripped JNI libraries to Make" 2020-07-16 22:43:53 +00:00
Treehugger Robot
20efa41af8 Merge "Set LOCAL_APKCERTS_FILE for apk_set modules in apexes" 2020-07-13 11:39:43 +00:00
Colin Cross
56b330f8e7 Merge "Use unzip -DD" am: b7cea24fe3 am: cae5903677
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1361337

Change-Id: I68b97b33bd19206dfd96aca36bf4575a0bca5459
2020-07-13 06:21:07 +00:00
Colin Cross
d783bbbace Use unzip -DD
We put reproducible timestamps in zip files so that the artifacts
are consistent, but that leads to old timestamps in the output
directory if they are unzipped as part of the build.  Use
unzip -DD when unzipping to update the timestamps.

Bug: 161015009
Test: touch -d 2020-01-01 ref; find $OUT/system -not -newer ref
Change-Id: I70407a627cb070e24be510faa6a774e3d9eae3a8
2020-07-12 05:37:46 +00:00
Colin Cross
4fb652d681 Set LOCAL_APKCERTS_FILE for apk_set modules in apexes
I321e80fd636a955213761f56a3ac64bfe7f7f7c0 missed setting
LOCAL_APKCERTS_FILE for apk_set modules in apexes, which causes
invalid apkcerts.txt files.

Bug: 160652723
Test: m apkcerts-list
Change-Id: I1ccaafd04978374d0da10363a1d782cfeae428e7
Merged-In: I1ccaafd04978374d0da10363a1d782cfeae428e7
(cherry picked from commit 7e2b36c7d5)
2020-07-10 20:38:50 -07:00
Colin Cross
403cc15f1b Pass unstripped JNI libraries to Make
Pass a list of unstripped JNI libraries to Make so that they can be
installed into the symbols directory.

Bug: 159726429
Test: forrest
Change-Id: Ieb4bffbb3d0a09f476da011399c5b8b1611929d7
2020-07-10 13:44:32 -07:00
Colin Cross
44440f8bf3 Set LOCAL_APKCERTS_FILE for apk_set modules in apexes am: 7e2b36c7d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/12124681

Change-Id: I35ad9081f9908362f37d8fc558e392347a41b104
2020-07-10 04:42:13 +00:00
Colin Cross
7e2b36c7d5 Set LOCAL_APKCERTS_FILE for apk_set modules in apexes
I321e80fd636a955213761f56a3ac64bfe7f7f7c0 missed setting
LOCAL_APKCERTS_FILE for apk_set modules in apexes, which causes
invalid apkcerts.txt files.

Bug: 160652723
Test: m apkcerts-list
Change-Id: I1ccaafd04978374d0da10363a1d782cfeae428e7
2020-07-09 19:05:35 -07: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
Treehugger Robot
2c79c871d9 Merge changes Iefcf4fbe,I450d4769,I1ffc7e7b
* changes:
  Prepend default to allow overriding in the bp file.
  Do not follow SDK member dependencies for APEX payloads.
  Do not follow prebuiltDependencyTags in APEX payload walks.
2020-07-09 12:32:31 +00:00
Paul Duffin
3b984b7d23 Stop java_sdk_library_import from depending on source modules am: 44f1d8404b am: ad18b5c676
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1351595

Change-Id: I98193c398be14e639aae36983ce3cb30c81a7b6e
2020-07-08 18:33:54 +00:00
Paul Duffin
44f1d8404b Stop java_sdk_library_import from depending on source modules
Previously, java_sdk_library_import added the dependencies on its child
components in the deps mutator after prebuilts without a matching
source module are renamed to the source module name. That meant that
the java_sdk_library_import has to use the source module name and ended
up depending on the source module unless it was preferred.

This change adds a new component deps mutator that runs before the
PrebuiltRenameMutator so that the java_sdk_library_import can add
dependencies onto the prebuilt modules. It also updates an affected
test.

Bug: 159902351
Test: m nothing
Change-Id: I3576c4873302743e51aff547ea1497bef6d748ac
2020-07-08 16:46:16 +01: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
Oliver Nguyen
f6cd2a0cc6 Merge changes from topic "gcov-clang-migration" into rvc-dev
* changes:
  Make native_coverage clause work with ClangCoverage
  Introduce product variables to select Java code coverage paths in Soong.
  Rename native code coverage paths product variables in Soong.
2020-07-06 21:07:54 +00:00
Colin Cross
72cabc6255 Make native_coverage clause work with ClangCoverage
Make uses NATIVE_COVERAGE to enable gcov coverage and CLANG_COVERAGE
to enable clang coverage.  NATIVE_COVERAGE is translated to the Soong
Native_coverage product variable which triggers the native_coverage
clause in Android.bp files.  The clause also needs to be triggered
for CLANG_COVERAGE.

Rename the existing Native_coverage product variable to GcovCoverage,
and regenerate Native_coverage when either GcovCoverage or
ClangCoverage are set.

Also remove NativeLineCoverage, it wasn't doing anything differently
than Native_coverage.

Bug: 159059537
Test: m checkbuild
Merged-In: I215124a9b35a2ad50ad562079d392e3d33da11f4
Change-Id: I215124a9b35a2ad50ad562079d392e3d33da11f4
2020-07-02 11:21:36 -07:00
Treehugger Robot
ab22ca31e9 Merge "apex: add / in file_contexts as system_file" am: fae9e0cf9a am: 062e9afe7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1351465

Change-Id: I9b4e3f4340b937df93be56867e557e53bb86fa30
2020-07-02 04:41:34 +00:00
Jooyung Han
f45e20d635 DO NOT MERGE apex: install flattened from apex_set am: 2963716220
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/12034588

Change-Id: I444402e4a1619a82f196ce8d4c7bcb12f36e96f9
2020-07-01 14:16:54 +00:00
Jooyung Han
f221e59429 Merge "DO NOT MERGE apex: install flattened from apex_set" into rvc-dev 2020-07-01 14:05:36 +00:00
Anton Hansson
62783652ac Merge "Propagate owner property for apex modules" into rvc-dev am: ff1531e13b
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/12034797

Change-Id: I478d0442eee9e1eee74a853d51f21f797f2aeec0
2020-06-30 19:26:13 +00:00
Anton Hansson
1ee62c03ba Propagate owner property for apex modules
Bug: 160165426
Test: lunch aosp_taimen && m nothing
Change-Id: I1d274ea376c58ff44d69ef5440c919b67079ae4a
2020-06-30 13:55:23 +00:00
Jooyung Han
2963716220 DO NOT MERGE apex: install flattened from apex_set
apex_set is a set of prebuilt apex files. To support GSI which installs
both flattened and unflattened APEXes when apex_set is used, we extract
the contents from the selected APEX file.

Bug: 159711661
Test: TARGET_PRODUCT=gsi_gms_arm64 m
      should install flattened apexes in /system/system_ext/apex
Change-Id: I0a51b9f4a4537d3230aaa3eece532664ea18bc7c
2020-06-30 12:13:28 +00:00
Jooyung Han
2dfd54d07e apex: add / in file_contexts as system_file
apex_manifest.pb is added to payload.img by the build system and is
supposed to be read by apexd during activation.

So, / and /apex_manifest.pb should be labeled as "system_file" so
that apexd can read it regardless of how file_contexts is defined.

580eb4fe38 adds /apex_manifest.pb and this
change adds / as well to file_contexts.

Bug: 159767275
Test: add an apex with file_contexts with everything as vendor_file
      apexd should activate the apex.
Change-Id: I827fa3af49ca7f20f3f82fcb16868f60d94d9531
2020-06-29 14:54:22 +09:00
Treehugger Robot
08c3d0cf7f Merge changes Ifd2858dd,I2585dd99,I65e7a456 am: 0c6f111d7b am: d6b1515935
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348951

Change-Id: Idcc16a40f953019278ea34829ca297a353da0820
2020-06-29 02:47:14 +00:00
Treehugger Robot
0c6f111d7b Merge changes Ifd2858dd,I2585dd99,I65e7a456
* changes:
  apex: use SubName for requiredDeps
  apex: support "vendor: true"
  apex: AndroidMk writes common properties
2020-06-29 02:20:56 +00:00
Martin Stjernholm
59c19b3585 Merge "Disable flattening only for unbundled apps." am: c4fe0dd3cc am: a77dc06b2b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348984

Change-Id: If1a7768da1c1b652ec89acca4e948cc76bcb064e
2020-06-25 14:21:22 +00:00
Martin Stjernholm
c4fe0dd3cc Merge "Disable flattening only for unbundled apps." 2020-06-25 13:49:30 +00:00
Jooyung Han
efb184e499 apex: use SubName for requiredDeps
apexBundle keeps the required dependencies for native modules which are
external dependencies and then records it in .mk file as
LOCAL_REQUIRED_MODULES key.

LOCAL_REQUIRED_MODULES should list module name which are made of
cc.BaseModuleName() + SubName.

By the way, because a use_vendor:true apex is supposed to be installed
in /system/apex, we don't append SubName(.vendor) suffix.

Bug: 159211312
Bug: 155841765
Test: m
Change-Id: Ifd2858dda0b373110a0cd18a0c55db41f0fc2a99
2020-06-25 17:14:25 +09:00
Jooyung Han
7b5284bf33 Merge "apex: add apex_manifest.pb in file_contexts" am: dd85fd89b0 am: 5b811c02e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348942

Change-Id: I558889c69e09e79455b75c4399826fcaab9101fc
2020-06-25 06:54:28 +00:00
Jooyung Han
85d61767b5 apex: support "vendor: true"
When an apex sets "vendor: true", it becomes a vendor apex.

Vendor apexes use vendor variants for native modules and are
installed in /vendor/apex.

Bug: 159211312
Test: m
Change-Id: I2585dd990ba857a2ab3ec6ab24e09d4652e867f2
2020-06-25 15:37:47 +09:00
Jooyung Han
2ed99d00b4 apex: AndroidMk writes common properties
AndroidMkEntries handles bunch of common properties(e.g. LOCAL_INIT_RC,
LOCAL_VINTF_FRAGMENTS, etc).

However apex defines its own Custom() writer, so those properties should
be handled manually.

For example, when an apex defines "init_rc" properties, the value should
be passed to Make via LOCAL_INIT_RC.

Bug: 159211312
Test: m
Change-Id: I65e7a456486c9f5fe70c91b78ff181425035fcf2
2020-06-25 15:30:26 +09:00
Jooyung Han
dd85fd89b0 Merge "apex: add apex_manifest.pb in file_contexts" 2020-06-25 06:21:40 +00:00
Jooyung Han
14135e4c26 Merge "apex/apk: enforce min_sdk_version of all deps" am: 14a08f5b28 am: afdc5239b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1287253

Change-Id: I63074e39f5f319789920e55802d4f7934b556e0a
2020-06-25 01:47:24 +00:00
Jooyung Han
14a08f5b28 Merge "apex/apk: enforce min_sdk_version of all deps" 2020-06-25 01:18:52 +00:00
Martin Stjernholm
56507b4e0d Disable flattening only for unbundled apps.
This allows the unbundled master-art branch to still use flattened
APEXes in its test builds.

Bug: 159109002
Test: art/build/apex/runtests.sh on master-art
Test: m nothing
Change-Id: I768c6b7f5afbc348cd7730e4ba96507678434778
2020-06-24 22:33:44 +01:00
Jooyung Han
580eb4fe38 apex: add apex_manifest.pb in file_contexts
apex_manifest.pb is added to payload.img by the build system and is
supposed to be read by apexd during activation.

So, it should be labeled as "system_file" so that apexd can read it
regardless of how file_contexts is defined.

Bug: 159767275
Test: add an apex with file_contexts with everything as vendor_file
      apexd should activate the apex.
Change-Id: Ie34eb7ad905828976152d67a7dfabf0add0a5de4
2020-06-24 23:00:32 +09:00
Jiyong Park
c487ae15ba Merge "Don't remove entries for overriddable modules" 2020-06-24 11:33:39 +00:00
Christopher Ferris
45ba96ad76 Merge "Remove libc_scudo references." am: a5d1fab176 am: f25abb1d01
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1326235

Change-Id: Ic6392dfe26e181d1cb12d2ceaee388ef268eeee3
2020-06-24 03:44:12 +00:00
Christopher Ferris
a5d1fab176 Merge "Remove libc_scudo references." 2020-06-24 03:16:48 +00:00
Jooyung Han
749dc69af1 apex/apk: enforce min_sdk_version of all deps
Enforce min_sdk_version for every payload dependency of updatable
APEX/APKs.

android.CheckMinSdkVersion() calls ApexModule.ShouldSupportSdkVersion
for every transitive dependency from APEX/APK modules to see if it
meets the min_sdk_version requirements.

The common implementation for apex/android_app is provided in
android/apex.go.

Bug: 145796956
Bug: 152655956
Bug: 153333044
Test: m nothing
Change-Id: I4a947dc94026df7cebd552b6e8ccdb4cc1f67170
2020-06-24 02:00:33 +09:00
Colin Cross
92285368e2 Merge "Make native_coverage clause work with ClangCoverage" am: c9ef6ee1b7 am: e1dd7bf4ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1340832

Change-Id: I02b9d4f8fea3facdd4c41d633d49bd2006718fe5
2020-06-23 03:37:05 +00:00
Colin Cross
c9ef6ee1b7 Merge "Make native_coverage clause work with ClangCoverage" 2020-06-23 03:06:53 +00:00
Christopher Ferris
f70926eef0 Remove libc_scudo references.
Test: Builds and boots.
Change-Id: Iad97159e6193f7afffd8fbc9456427eee5d150e3
Merged-In: Iad97159e6193f7afffd8fbc9456427eee5d150e3
(cherry picked from commit 1f16b27511)
2020-06-22 15:27:56 -07:00
Colin Cross
1a6acd4f39 Make native_coverage clause work with ClangCoverage
Make uses NATIVE_COVERAGE to enable gcov coverage and CLANG_COVERAGE
to enable clang coverage.  NATIVE_COVERAGE is translated to the Soong
Native_coverage product variable which triggers the native_coverage
clause in Android.bp files.  The clause also needs to be triggered
for CLANG_COVERAGE.

Rename the existing Native_coverage product variable to GcovCoverage,
and regenerate Native_coverage when either GcovCoverage or
ClangCoverage are set.

Also remove NativeLineCoverage, it wasn't doing anything differently
than Native_coverage.

Bug: 159059537
Test: m checkbuild
Change-Id: I215124a9b35a2ad50ad562079d392e3d33da11f4
2020-06-22 11:13:42 -07:00
TreeHugger Robot
966e995729 Merge "Enforce permitted_packages for Q+ and R+ modules" into rvc-dev am: d65089b4a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11761419

Change-Id: I66510e2e3792623c77e0fea25d2043b963b1f951
2020-06-22 18:09:56 +00:00
TreeHugger Robot
d65089b4a4 Merge "Enforce permitted_packages for Q+ and R+ modules" into rvc-dev 2020-06-22 17:55:16 +00:00
Jooyung Han
b365f35fef Merge "apex: make allowed_files prop overridable" into rvc-dev am: d166f79278
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11931025

Change-Id: I2600c560d596446af255b117abfc07dc1d1f1860
2020-06-22 17:20:52 +00:00
Jooyung Han
938b593887 apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Merged-In: I12744b0465dc3cfc90a66643867e65b4092cd0f7
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
(cherry picked from commit faa5399b3f)
2020-06-23 02:10:46 +09:00
Jooyung Han
d166f79278 Merge "apex: make allowed_files prop overridable" into rvc-dev 2020-06-22 17:05:58 +00:00
Paul Duffin
9ee66da850 Fix check-boot-jars when a boot jar is provided by prebuilt
Previously, when a boot jar was provided by a java_sdk_library_import
module the check-boot-jars check failed because the file it depended on
was not available. In an incremental build the build failed due to the
file in the out directory not having a rule to generate it.

That was because the module was named prebuilt_<module>.<apex> instead
of <module>.<apex>. This was fixed by simply removing prebuilt_ prefix
from the name if it was present.

After fixing that the check-boot-jars still did not work properly
because it was expecting a jar file containing .class files but instead
was given a jar file containing .dex files which meant the check did
not work properly.

This was fixed by defining a new ApexDependency interface for use by
the apex/apex.go code to use instead of java.Dependency for generating
the androidmk entries. The *SdkLibraryImport type then implemented
those, by delegating to the implementation library.

Bug: 158304459
Bug: 159112414
Test: m check-boot-jars
      m checkbuild
	  manual inspection of the .jar file used by check-boot-jars to
	  ensure it contained .class files and not .dex files.
Change-Id: I545c5c9072dd472337d2f9b4dfdf08f53c981662
Merged-In: I545c5c9072dd472337d2f9b4dfdf08f53c981662
2020-06-20 11:38:08 +01:00
Jooyung Han
faa5399b3f apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
2020-06-20 12:56:49 +09:00
TreeHugger Robot
0de4de0c64 Merge "Don't remove entries for overriddable modules" into rvc-dev am: f58305a6a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11908302

Change-Id: I20b9d3c522447ebc32cf861ae9b75f09c3c4fccc
2020-06-19 14:18:42 +00:00
Jiyong Park
03a7f3efed Don't remove entries for overriddable modules
Previously, when there is apex_set that is overriding another module,
the entry for the overridden module is removed from apexkeys.txt.
However, this is wrong because the existence of the apex_set module
doesn't necessary mean that the module is insatalled instead of the
overridden module. That is determined by PRODUCT_PACKAGES which Soong
has no knowledge of. Therefore, we don't delete the entry for the
overridden (actually possibly overridable) modules in the file.

Bug: 158729168
Test: m
Merged-In: I85d0c756f862323bae556bf657d66ec50038985f
(cherry picked from commit ac5e79f900)
Change-Id: I85d0c756f862323bae556bf657d66ec50038985f
2020-06-19 13:29:16 +09:00
Andrei Onea
115e7e77d8 Enforce permitted_packages for Q+ and R+ modules
Q+ and R+ mainline modules may only add code in a restricted set of Java
package prefixes, that may never be changed.
If a mainline module owns the Java package prefix "foo.bar", it may have
classes in "foo.bar", "foo.bar.baz", "foo.bar.baz.bat" etc.

Test: m
Bug: 156725734
Change-Id: I30bf510ed473309871469bf439d7c81575450931
2020-06-18 16:57:39 +01:00
Jiyong Park
ac5e79f900 Don't remove entries for overriddable modules
Previously, when there is apex_set that is overriding another module,
the entry for the overridden module is removed from apexkeys.txt.
However, this is wrong because the existence of the apex_set module
doesn't necessary mean that the module is insatalled instead of the
overridden module. That is determined by PRODUCT_PACKAGES which Soong
has no knowledge of. Therefore, we don't delete the entry for the
overridden (actually possibly overridable) modules in the file.

Bug: 158729168
Test: m
Change-Id: I85d0c756f862323bae556bf657d66ec50038985f
2020-06-18 23:05:31 +09:00
Anton Hansson
71f093e485 Merge "Fix check-boot-jars when a boot jar is provided by prebuilt" am: 0e63a8e761 am: ac2a42054f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1341756

Change-Id: Ife514f78e7aea0b8ed05f74c21d3ce95054796cc
2020-06-17 20:02:20 +00:00
Paul Duffin
44b481b81b Fix check-boot-jars when a boot jar is provided by prebuilt
Previously, when a boot jar was provided by a java_sdk_library_import
module the check-boot-jars check failed because the file it depended on
was not available. In an incremental build the build failed due to the
file in the out directory not having a rule to generate it.

That was because the module was named prebuilt_<module>.<apex> instead
of <module>.<apex>. This was fixed by simply removing prebuilt_ prefix
from the name if it was present.

After fixing that the check-boot-jars still did not work properly
because it was expecting a jar file containing .class files but instead
was given a jar file containing .dex files which meant the check did
not work properly.

This was fixed by defining a new ApexDependency interface for use by
the apex/apex.go code to use instead of java.Dependency for generating
the androidmk entries. The *SdkLibraryImport type then implemented
those, by delegating to the implementation library.

Bug: 158304459
Bug: 159112414
Test: m check-boot-jars
      m checkbuild
	  manual inspection of the .jar file used by check-boot-jars to
	  ensure it contained .class files and not .dex files.
Change-Id: I545c5c9072dd472337d2f9b4dfdf08f53c981662
2020-06-17 16:59:43 +01:00
Yo Chiang
7b7f0d8265 Merge "Don't emit superfluous LOCAL_OVERRIDES_MODULES" am: f298a3f325 am: 1bc15fdfc9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1335760

Change-Id: Ie61e0025ddfab1a068bb209685938cb29a3895bd
2020-06-17 04:32:38 +00:00
Jiyong Park
8d6286befe apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.

Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt

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

Bug: 158729168
Test: m
Merged-In: I9507375342ec053309660d94c931a79bf4f21218
(cherry picked from commit 8d6c51ebcc)
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
2020-06-17 13:17:11 +09:00
Yo Chiang
f298a3f325 Merge "Don't emit superfluous LOCAL_OVERRIDES_MODULES" 2020-06-17 04:03:03 +00:00
Colin Cross
a2e64e7b84 Merge "Use inclusive language in Android.bp files" 2020-06-17 01:04:26 +00:00
Colin Cross
cbd62d07d4 Use inclusive language in Android.bp files
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
Merged-In: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-16 23:36:51 +00:00
Anton Hansson
c3754ba042 Merge "Let APEX build against preferred java_sdk_library_import" into rvc-dev 2020-06-16 17:47:16 +00:00
Paul Duffin
98c5d09541 Merge "Let APEX build against preferred java_sdk_library_import" am: e40383355b am: 86be0eafca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1331928

Change-Id: Ia4bb1dc336da459172dd74bedef7396085796dfc
2020-06-16 09:57:40 +00:00
Paul Duffin
f642a31ab5 Let APEX build against preferred java_sdk_library_import
If a java_sdk_library_import has a corresponding java_sdk_library then
make the java_sdk_library_import export both the xml and impl modules
created by the java_sdk_library.

Makes java_sdk_library_import consistent with java_sdk_library by
providing libraries within the same APEX access to the implementation
library instead of the stubs.

Bug: 158304459
Test: m nothing
      Test what happens when building com.android.tethering with and without
      a preferred "framework-tethering" java_sdk_library_import. Make sure that
      it does not change the generated APEX.
Merged-In: I2f4edea937ac377431a5696c92cbd467bded62ef
Change-Id: I2f4edea937ac377431a5696c92cbd467bded62ef
(cherry picked from commit eedc5d55ce)
2020-06-16 10:43:19 +01:00
Paul Duffin
e40383355b Merge "Let APEX build against preferred java_sdk_library_import" 2020-06-16 09:37:53 +00:00
Yo Chiang
12d9f7a103 Don't emit superfluous LOCAL_OVERRIDES_MODULES
Don't emit an empty LOCAL_OVERRIDES_MODULES line if APEX is not
overriding any module.

Test: TH noop
Change-Id: I7abbaccd54bf2ffa25a6c798260c81284ea5ecb2
2020-06-16 17:33:57 +08:00
Colin Cross
e8f7f90496 Merge changes from topics "soong-inclusive-language", "soong_inclusive_language2" into rvc-dev am: f4a5492ec9
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11859399

Change-Id: I1b009faacad99fcbfbf6cd06193f033ea37f6040
2020-06-16 03:43:15 +00:00
Colin Cross
f4a5492ec9 Merge changes from topics "soong-inclusive-language", "soong_inclusive_language2" into rvc-dev
* changes:
  Use inclusive language in Android.bp files
  Use inclusive language in build/soong
2020-06-16 03:28:15 +00:00
Treehugger Robot
c41c1a9d13 Merge "Remove libnativehelper modules from whitelist" 2020-06-15 17:00:35 +00:00
Colin Cross
a44a6b27f9 Use inclusive language in Android.bp files
Bug: 158889297
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-15 09:46:32 -07:00
Colin Cross
95f7b34e8e Use inclusive language in build/soong
Bug: 158889297
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
Merged-In: Id07890b7cbc2397291a658ca00e86b43c743aafc
(cherry picked from commit 440e0d0542)
2020-06-15 09:46:31 -07:00
Paul Duffin
eedc5d55ce Let APEX build against preferred java_sdk_library_import
If a java_sdk_library_import has a corresponding java_sdk_library then
make the java_sdk_library_import export both the xml and impl modules
created by the java_sdk_library.

Makes java_sdk_library_import consistent with java_sdk_library by
providing libraries within the same APEX access to the implementation
library instead of the stubs.

Bug: 158304459
Test: m nothing
      Test what happens when building com.android.tethering with and without
      a preferred "framework-tethering" java_sdk_library_import. Make sure that
      it does not change the generated APEX.
Change-Id: I2f4edea937ac377431a5696c92cbd467bded62ef
2020-06-15 16:57:09 +01:00
TreeHugger Robot
4666f7ef3a Merge "Remove libnativehelper modules from whitelist" into rvc-dev-plus-aosp 2020-06-15 15:27:56 +00:00
Jooyung Han
e30c7b98bc Merge "VNDK APEX should not provide native libs" am: 552d4730c3 am: 6b67734812
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1335522

Change-Id: Ieaa981ee386de3a31f45a87e60819b25baf98883
2020-06-15 14:27:50 +00:00
Orion Hodson
01615f36f2 Remove libnativehelper modules from whitelist
Bug: 147364041
Test: m nothing
Change-Id: I6a43511fee3feeb164e07d5620eea0564fbee302
Merged-In: I6a43511fee3feeb164e07d5620eea0564fbee302
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit 7e2354434907257f37255052d9bd08c554e263eb)
2020-06-15 13:32:14 +00:00
Orion Hodson
494c63b20e Remove libnativehelper modules from whitelist
Bug: 147364041
Test: m nothing
Change-Id: I6a43511fee3feeb164e07d5620eea0564fbee302
Merged-In: I6a43511fee3feeb164e07d5620eea0564fbee302
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit ab67d8f9b4)
2020-06-15 13:25:59 +00:00
Jooyung Han
45a96778c1 VNDK APEX should not provide native libs
While libz has stubs for other mainline modules, it doesn't provide
stubs when it is used as a VNDK lib.

In general, VNDK libs are only for vendor modules. So, we skip them even
if they have stubs.

Bug: 155456180
Test: m com.android.vndk.current
      provideNativeLibs of the APEX should be empty
Change-Id: I22401a2b1732a8560802c5be850181682e183a8e
2020-06-15 15:14:12 +09:00
Treehugger Robot
0c0583bd6b Merge "apex_sets is added to apexkeys.txt" am: 7a8e0cd23a am: f2ca2846db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1331104

Change-Id: Ieec1c09704a14bd670b947590eaba0e8d5ac9805
2020-06-13 02:51:39 +00:00
Colin Cross
973d6813cd manual merge of 2ef16cfcd4 to rvc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I768c3fe568fee764cb0b533e73a3fef719adf30c
2020-06-12 17:49:09 -07:00
Treehugger Robot
7a8e0cd23a Merge "apex_sets is added to apexkeys.txt" 2020-06-12 18:03:31 +00:00
Jiyong Park
8d6c51ebcc apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.

Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt

Bug: 158729168
Test: m
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
2020-06-13 01:24:51 +09:00
Colin Cross
440e0d0542 Use inclusive language in build/soong
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
2020-06-11 15:33:16 -07:00
Treehugger Robot
639e87e123 Merge "Fix type assertion error regarding dex_import" am: 36aef533cc am: 86e4acfaad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1328734

Change-Id: Ie52128b2cb0fd78bf6e36d57d4d68231208f94c8
2020-06-11 01:14:55 +00:00
Jiyong Park
e26a63e2fd Fix type assertion error regarding dex_import
Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f made it possible to add
dex_import modules into apex, but that change had a bug. When creating
Android.mk for the dex_import module, the code executed an unchecked
type assertion to convert java.DexImport to java.Dependency, which
cannot be successful. This change fixes the bug by doing a checked type
assertion instead.

Exempt-From-Owner-Approval: cp from AOSP

Bug: 157886942
Test: m (test added)
Merged-In: Id22c20d42effce539fab10b0d349bf340d467f02
(cherry picked from commit 9e83f0b531)
Change-Id: Id22c20d42effce539fab10b0d349bf340d467f02
2020-06-11 09:47:16 +09:00
Treehugger Robot
36aef533cc Merge "Fix type assertion error regarding dex_import" 2020-06-11 00:45:46 +00:00
Jaewoong Jung
9c646b161e Use Targets[Android] instead of DeviceArch funcs. am: 829b7135f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11820097

Change-Id: I216e04656108c7d7c7b35d39fa70f82ef656d38a
2020-06-10 21:50:16 +00:00
Jaewoong Jung
829b7135f3 Use Targets[Android] instead of DeviceArch funcs.
NDK prebuit script doesn't set device arch product variables, and so
causes SupportedAbis to panic.

Fixes: 158673325
Test: app_test.go, apex_test.go
Test: build-ndk-prebuilts.sh
Change-Id: I8331ef5bca12301318510ec9712770fd8d3a26a9
2020-06-10 12:30:51 -07:00
Elliott Hughes
f48d50bfb7 Merge "Remove TARGET_PREFER_32_BIT support." am: a82ad479a4 am: 274a80c492
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1289612

Change-Id: I8862a464aa374922dadedd68e47d1705b8ce5836
2020-06-10 18:36:54 +00:00
Jiyong Park
9e83f0b531 Fix type assertion error regarding dex_import
Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f made it possible to add
dex_import modules into apex, but that change had a bug. When creating
Android.mk for the dex_import module, the code executed an unchecked
type assertion to convert java.DexImport to java.Dependency, which
cannot be successful. This change fixes the bug by doing a checked type
assertion instead.

Bug: 157886942
Test: m (test added)
Change-Id: Id22c20d42effce539fab10b0d349bf340d467f02
2020-06-11 00:35:03 +09:00
Elliott Hughes
79ae341d4b Remove TARGET_PREFER_32_BIT support.
Bug: https://issuetracker.google.com/138812821
Test: builds
Change-Id: If96cccbd82ba1311165d61c947c928c6e7cd5593
2020-06-08 16:37:13 -07:00
Sasha Smundak
c4f0ff1d6c Cherrypick aosp/1318079 and aosp/1324841
Allow apex module to have android_app_set as its constituent.
Fix android_app_set documentation

Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: Id9b296d9301902deb463b299413491bc66d58944
2020-06-05 15:39:38 -07:00
Anton Hansson
d7fdfd6e77 Merge "dex_import can be added to apex" into rvc-dev 2020-06-05 10:05:50 +00:00
Anton Hansson
4ecb0d6bb0 Merge "Use Stem where output file name is expected in APEX" into rvc-dev 2020-06-05 10:05:50 +00:00
Treehugger Robot
dba1360d03 Merge "Allow apex module to have android_app_set as its constituent." am: a5c94e1409 am: 342b4810a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1318079

Change-Id: If27ef9b94e59620abcf2ef1179f51c2e5ca9b10f
2020-06-05 06:22:41 +00:00
Treehugger Robot
a5c94e1409 Merge "Allow apex module to have android_app_set as its constituent." 2020-06-05 05:52:51 +00:00
Sasha Smundak
18d98bc3e0 Allow apex module to have android_app_set as its constituent.
Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
2020-06-04 20:25:53 -07:00
Ulyana Trafimovich
abbe8875b3 Revert^2 "Rename DexJar interface method to DexJarBuildPath." am: 5539e7b568 am: 0852ac9a6d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1324492

Change-Id: I75dc93bb6aac621a0d90e5c5051cdeab98f5d1ef
2020-06-05 01:29:34 +00:00
Ulyana Trafimovich
5539e7b568 Revert^2 "Rename DexJar interface method to DexJarBuildPath."
This reverts commit b0dc851ff4.

Reason for revert: relanding original change. Build failures were
  caused by a race with another CL: https://r.android.com/1320920

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Ic9016582dae7773b4d4f84a63425f1ef7a5d061f
2020-06-04 17:20:38 +01:00
Ulyana Trafimovich
7e59e8e2df Merge "Revert "Rename DexJar interface method to DexJarBuildPath."" am: c55b679e7b am: 651a63ca9d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1324371

Change-Id: Ic3be6718aff2b04048bac17635b2858581fe7f8a
2020-06-04 11:13:23 +00:00
Ulyana Trafimovich
c55b679e7b Merge "Revert "Rename DexJar interface method to DexJarBuildPath."" 2020-06-04 10:47:47 +00:00
Ulyana Trafimovich
b0dc851ff4 Revert "Rename DexJar interface method to DexJarBuildPath."
This reverts commit 562c240185.

Reason for revert: breaks `lunch full-eng && m checkbuild`.

Change-Id: Id7c7d6240d98afaf8edd49b6c96cd05534b784cc
2020-06-04 10:37:36 +00:00
Ulyana Trafimovich
0cc337d35a Merge "Rename DexJar interface method to DexJarBuildPath." am: 2a08566634 am: 22cd1b5383
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1322701

Change-Id: I87a6570cc6184bb38dda1f83dac787c30d8aaa54
2020-06-04 10:36:28 +00:00
Ulyana Trafimovich
2a08566634 Merge "Rename DexJar interface method to DexJarBuildPath." 2020-06-04 10:05:33 +00:00
Jiyong Park
2cd081cf06 dex_import can be added to apex
Bug:157886942
Test: m
Change-Id: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
Merged-In: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
2020-06-04 10:28:44 +01:00
Treehugger Robot
a7f51bb3c0 Merge "dex_import can be added to apex" am: a8bf98852a am: 55110941ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1320920

Change-Id: I09342ecaf016ca85ab5ac5812c46af6932179258
2020-06-04 05:38:13 +00:00
Treehugger Robot
a8bf98852a Merge "dex_import can be added to apex" 2020-06-04 05:06:22 +00:00
Ulya Trafimovich
562c240185 Rename DexJar interface method to DexJarBuildPath.
This is a prerequisite change before adding DexJarInstallPath.

Test: lunch aosp_cf_phone-userdebug && m
Change-Id: I033e08b8bb06c0a844a6bbbfcdc48ce33e9c95cf
2020-06-03 11:40:45 +01: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
Jaewoong Jung
8066ebc38f Merge "Soong package structure refactoring" am: 264700345d am: ca9ed9158d
Original change: undetermined

Change-Id: I5cd95c02ab8af420dc2b7166ba24bdf0c7dc6496
2020-06-02 16:57:16 +00:00
Jiyong Park
77acec63fe dex_import can be added to apex
Bug:157886942
Test: m
Change-Id: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
2020-06-02 11:54:01 +09:00
Jaewoong Jung
4b79e98a6e 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.

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-01 13:44:48 -07:00
Jiyong Park
7a12fd11ee Merge "Use Stem where output file name is expected in APEX" am: 0e666433cd am: 611703096e
Change-Id: I94d8f5541deea86310ad3b249b670c61623f3b96
2020-06-01 01:02:03 +00:00
Jiyong Park
0e666433cd Merge "Use Stem where output file name is expected in APEX" 2020-06-01 00:35:48 +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
Jiyong Park
327b057e84 Merge "Notice file embededd in APEX is deterministic" into rvc-dev 2020-05-30 22:35:47 +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
Jiyong Park
cbe50c7073 Use Stem where output file name is expected in APEX
Bug: 157638999
Test: m
Merged-In: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
(cherry picked from commit f1493cc0f2)
Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
2020-05-30 21:15:24 +09: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
Treehugger Robot
94d161a3c7 Merge "Notice file embededd in APEX is deterministic" am: 9980c6e111 am: bd7f948507
Change-Id: I2cf22542513eff83fefef1503954015ffd3be6a9
2020-05-30 08:30:11 +00:00
Jiyong Park
f1493cc0f2 Use Stem where output file name is expected in APEX
Bug: 157638999
Test: m
Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
2020-05-30 13:26:55 +09:00
Jiyong Park
33c7736936 Notice file embededd in APEX is deterministic
Bug: 157724521
Test: m
Change-Id: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
2020-05-29 22:00:16 +09: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
Treehugger Robot
db1bd15ef0 Merge "apex respects stem of java_library modules" am: 00f5701ade am: 3013ea064f
Change-Id: I40a1a6803d8af53a7889b8986f59fbafd4d13ee1
2020-05-29 01:17:33 +00:00
Treehugger Robot
00f5701ade Merge "apex respects stem of java_library modules" 2020-05-29 00:45:03 +00:00
Kousik Kumar
0f5e5c724e Merge "Add support for remote-execution / caching of signapk actions" am: 8f37ec82d9 am: f52d6420ea
Change-Id: I3c51e0ff23903ba101d2029a632f99fc8342c2d9
2020-05-28 19:06:40 +00:00
Kousik Kumar
8f37ec82d9 Merge "Add support for remote-execution / caching of signapk actions" 2020-05-28 18:31:31 +00:00
Liz Kammer
1de62786c3 Merge "Only include test data in flattened apex 1 time" am: 25aeb7d19b am: aa5f42c3c4
Change-Id: Ia0ebe0e45a2f0fa7f3620313f94cd0835d2c8468
2020-05-28 17:33:00 +00:00
Liz Kammer
25aeb7d19b Merge "Only include test data in flattened apex 1 time" 2020-05-28 16:57:39 +00:00
Jiyong Park
a62aa23990 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.

Bug: 157638999
Test: m
Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
2020-05-28 23:48:16 +09:00
Kousik Kumar
309b1c0da3 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
2020-05-28 06:14:56 -07:00
Jiyong Park
b51e7ea3b8 Remove apex_available whitelist for the ART APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

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

Bug: 150999716
Test: m
Merged-In: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
(cherry picked from commit be6e2b6a18)
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
2020-05-28 04:06:41 +00:00
Jiyong Park
69efc4625a Merge changes from topic "apex_available_art" into rvc-dev am: b7431abffe
Change-Id: Idb9f30b74687f2c5da9494db60ae6614a67c0c4b
2020-05-28 01:11:19 +00:00
Jiyong Park
885910e198 DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R." am: 8b39919030
Change-Id: If72ac03ec041b30dc2636ba5412c375ac1566ca4
2020-05-28 01:11:17 +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
Liz Kammer
5bd365f1e5 Only include test data in flattened apex 1 time
Previously, if a data source was included in multiple APEX, it would
appear multiple times; however, this caused errors for overriding
commands for targets

Test: apex_test.go
Test: m nothing with change I54d92eca88fc04c949209d490e838d0a92ce8f87
Bug: 155820504
Change-Id: I98f04e0fd9fa3238f2bb0e5da3a86fc0797c38ba
2020-05-27 15:32:30 -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
Liz Kammer
6d88fe6caf Merge "Add test to ensure test data written for flat apex" am: 5903b669ad am: 63f3b9a501
Change-Id: Ic083ddbe0e3198eef112d6debb8bacbc2ab30ac2
2020-05-27 17:01:42 +00: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
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
5903b669ad Merge "Add test to ensure test data written for flat apex" 2020-05-27 16:24:08 +00: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
Paul Duffin
8ecb28156b java_sdk_library: Expose implementation within APEX am: 9b879594ed am: af853b758f
Change-Id: I428d88113401ab9e6befef2574a01d8579e91c55
2020-05-26 22:08:35 +00:00
Paul Duffin
9b879594ed 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
2020-05-26 18:32:44 +01:00
Nikita Ioffe
62bd3c7b47 Merge "Always set targetSdkLevel to DefaultAppTargetSdk" 2020-05-26 16:47:42 +00:00
satayev
84ff6be8e9 Merge "Generate combined deps-info for all updatable modules." am: ede18549e5 am: 3a0a6427bd
Change-Id: I2ae338e9f883695260d922e6607c73770a4c8c04
2020-05-26 14:03:00 +00:00
satayev
ede18549e5 Merge "Generate combined deps-info for all updatable modules." 2020-05-26 13:28:28 +00:00
Jiyong Park
8b39919030 DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
This reverts commit c9c7116721.

This revert is to avoid merge conflict when ag/11299431 is auto-merged
to master.

This change will again be reverted when ag/11299431 lands.

Bug: 150999716
Test: m

Change-Id: Ia0f7a0e0eb8cf6f6f4d0693de01777a8a750c769
2020-05-25 17:05:35 +09:00