Commit graph

2994 commits

Author SHA1 Message Date
Treehugger Robot
a36589c4ca Merge changes Ia4016240,Iba586155
* changes:
  Allow choosing which soong_build invocations to run in the debugger
  Show module type in a module section of the Android-TARGET.mk
2022-12-02 10:36:07 +00:00
Sasha Smundak
5c4729df93 Show module type in a module section of the Android-TARGET.mk
The first line of each section will be
```
include $(CLEAR_VARS)  # <module type>
...
```

Bug: 257037252
Test: treehugger
Change-Id: Iba586155b682fe4e1e5817d8397eda8f9d9c8789
2022-12-01 21:12:11 -08:00
Jingwen Chen
c4c34e1eab Convert apex_available (for supported modules) to bazel tags.
The tags will then be read by an aspect applied from apex attributes to
validate that the deps are explicitly opt-in to the appropriate apex.

The semantics of this is the same as the Soong apex_available property.

This also adds the "base_apex_name" attr to override_apex conversion so
that apex_available checks continue to work on the non-Google and non-Go
apex names.

Test: presubmits
Fixes: 218841706
Change-Id: I19b3637da9aa47573b252d74f62b601fbdc3784d
2022-12-01 06:25:25 +00:00
Anton Hansson
805e0a53ef Ignore native bridge archs for apex selection
This leads to an arm64 apex being used on a device that is mixed
x86_64 with nativebridge=arm64. A device like that doesn't appear
to work with arm64 binaries. For example, the boringssl-self-check
binary crashes on boot.

Bug: 260115309
Test: unit test
Test: boot emulator with this combination
Change-Id: Ic4a91974290a05b1799f755fcf52ef226d68f4c2
2022-11-29 12:56:37 +00:00
Alan Stokes
73feba3330 Allow stubs implementation to be omitted
When defining a stubs library, allow specifying that the
implementation library does not need to be installed. This allows for
cases where the implementation is deployed in some non-standard way -
e.g. inside a Microdroid virtual machine.

Without this, we get build errors like: "TARGET module
com.android.compos requires non-existent TARGET module: libvm_payload".

Default behavior is unchanged. The change is protected by an allowlist
to limit usage to the immediate use case.

Bug: 243512108
Test: builds; soong tests pass
Test: Remove allowlist, see build failure
Change-Id: Iaae75f2e93b842f5944a7518cc95069d62c5a638
2022-11-22 16:00:02 +00:00
Treehugger Robot
3d99948e29 Merge "Make htmlGzNotice an internal variable instead of apexBundle field." 2022-11-16 23:19:44 +00:00
Ulya Trofimovich
a672771df9 Merge "Do not assume that boot image profile exists when building ART apex." 2022-11-16 19:36:31 +00:00
Jingwen Chen
4a9630b4ad Make htmlGzNotice an internal variable instead of apexBundle field.
It's not read outside of the function / action generation logic, so keep
it inside the function.

Test: presubmits
Fixes: 190817312
Change-Id: I0626e6c86adc584abb2a251cbc7ffb1bec2c7f59
2022-11-16 19:12:35 +00:00
Ulya Trafimovich
f5c548db17 Do not assume that boot image profile exists when building ART apex.
If the apex is built without boot images, profile may not exist.

Test: treehugger
Change-Id: I0824100d0ac38f4b7b71b302b401a0c66c3ff3cf
2022-11-16 14:59:05 +00:00
Wei Li
78c07de1dc Add support of <APEX>-installed-files.txt in mixed build.
Bug: 239084750
Test: CIs
Change-Id: Ie3823d1a620c3924111e71aa97df727565261c98
2022-11-11 22:46:33 +00:00
Prerana Patil
62253d193b Merge "Revert "Don't add flattened files apex as dependencies of an image apex"" 2022-11-09 20:29:03 +00:00
Prerana Patil
b1896c88d5 Revert "Don't add flattened files apex as dependencies of an image apex"
This reverts commit b81814a7b4.

Reason for revert: breaking build 9271471

Change-Id: I1876f45b79779d7e8ec46a78bf71bf7fec09e62b
2022-11-09 18:14:34 +00:00
Liz Kammer
303978dcd2 Connect base.zip to mixed builds
Test: go test soong tests
Test: mixed_droid
Change-Id: Iaf1fbd1e7cde63892b01a9c9f4cd29ae69e2d6e3
2022-11-09 08:16:54 -05:00
Jingwen Chen
1ec7785ec5 bazel apex: Add mixed builds support for <module>_using.xml file.
This file contains the java APIs parsed by the 'dexdeps' tool within the gen_java_usedby_apex.sh.

Bug: 239084755
Fixes: 239084755
Test: presubmits
Change-Id: Ia271783a6be3ea3a343481306cde1aaba2166e88
2022-11-09 06:30:03 +00:00
Treehugger Robot
926d00c2ad Merge "Don't add flattened files apex as dependencies of an image apex" 2022-11-09 05:00:29 +00:00
Wei Li
cc73a05670 Add support of <APEX>_backing.txt in mixed build.
Bug: 239081456
Test: CIs
Change-Id: I8a8a5e606d5b1bc19294fc92cd469e7aa01cdb43
2022-11-08 12:00:42 -08:00
Jingwen Chen
0c9a276ded bazel apex: Add mixed builds support for <module>_using.txt file.
Test: presubmits
Change-Id: I7203fcccb09f6c93e702550ffa47a4029c3351dd
2022-11-07 23:16:12 +00:00
Liz Kammer
0e255ef6e6 Add apex_test for mixed builds
Test: go test soong tests
Change-Id: I33327e1fe7d6a4bbf32890d9fbd5453c28a9c5b1
2022-11-07 11:11:37 -05:00
Treehugger Robot
9fa8a2e220 Merge "Remove unnecessary TestMain()" 2022-11-05 00:30:04 +00:00
Liz Kammer
fdb6321d23 Remove unnecessary TestMain()
Test: go test Soong tests
Change-Id: I2a8710361b1a32d71417b6c7bbc19e87fa8b36ae
2022-11-04 16:24:29 -04:00
Cole Faust
b81814a7b4 Don't add flattened files apex as dependencies of an image apex
The image apex does not need all the files that make up a flattened
apex.

Bug: 254205429
Test: go tests
Change-Id: Iff05f2d01f11397bc9e9bf31868112575268969b
2022-11-04 11:05:49 -07:00
Colin Cross
a493e5ff91 Merge "Add support for per-arch configuration in apex_defaults" 2022-11-03 14:00:45 +00:00
Colin Cross
70572ed01e Add exclude_* properties to apex arch-specific properties
The libcronet prebuilt JNI library doesn't exist for riscv64 yet.
Add exclude_* properties to apex arch-specific properties so that
the libcronet dependency can be excluded from the apex that contains
when the arch is riscv64 until it exists for riscv64.

Test: TestApexWithArch
Change-Id: Ic395a077824f0f60b90178530fbfae8a96b3782f
2022-11-02 14:31:46 -07:00
Colin Cross
abacbe8436 HACK: use arm64 apex prebuilts for riscv64
There are no riscv64 apex prebuilts, which breaks the build when
provenance_metadata singelton tries to run a tool on all the input
apexes that don't exist.  Hack it to provide the arm64 apex for now
if no riscv64 apex is specified, which will allow the build to pass.

Test: lunch aosp_riscv64-userdebug && m droid
Change-Id: Ic39936539803615ea4b7f817daf7b59ab7c40e7e
2022-11-01 19:13:17 +00:00
Wei Li
32dcdf9038 Support new attributes added in ApexInfo in mixed build.
Bug: 243748589
Test: CI
Change-Id: I6c9869464fe91ebf62811d92cf4403f2c7c9e8a9
2022-10-28 14:06:57 -07:00
Yu Liu
4c212ce058 Support apex_test.
Bug: 249744489
Test: Manual and unit test.
Change-Id: I866debf7ffee54a0f4649b5e5425a8e3cc3042a1
2022-10-24 10:35:12 -07:00
Nikita Ioffe
e58f527dfc Add support for per-arch configuration in apex_defaults
Bug: 243512044
Test: m
Change-Id: Icd63e8c11b6f65c5b425e4d89b016d400cac72c5
2022-10-24 17:24:38 +01:00
Jiyong Park
61807339b8 Merge "Install appSet using InstallFileWithExtraFilesZip" 2022-10-21 00:17:52 +00:00
Jingwen Chen
6817bbb3c8 Introduce BazelStringOrLabelFromProp.
Soong supports string properties, but they are overloaded, and can mean
one of three things:

* path reference
* module reference
* string literal

Bazel has different types: label and string attributes. Thus there needs
to be a way to categorize them correctly in bp2build.

This CL introduces a new function to be used on properties like
apex_key.private_key / apex_key.public_key, as well as
android_app.certificate / apex.certificate.

It is important to disambiguate the prop betenn a string literal
attribute or file/rule target label attribute, so this functions does
just that.  The new attributes are then further handled by their
respective macros (apex_key, android_binary, apex).

Bug: 253557437
Fixes: 253557437
Test: presubmits, new tests

Change-Id: Id8111cdd60d3aabcae7d17fe9da84d0ee3966023
2022-10-20 14:57:37 +00:00
Jiyong Park
f648d53154 Install appSet using InstallFileWithExtraFilesZip
This fixes a bug that only the primary output of an appSet is installed
when the appSet is part of a flattened APEX.

Bug: 247072627
Test: m GoogleExtServices on a device using flattened APEX.
system/apex/com.android.extservices.gms/priv-app/GoogleExtServices@TM
has these apks:

GoogleExtServices.apk  GoogleExtServices-arm64_v8a.apk
GoogleExtServices-hdpi.apk  GoogleExtServices-ldpi.apk
GoogleExtServices-mdpi.apk  GoogleExtServices-tvdpi.apk
GoogleExtServices-xhdpi.apk  GoogleExtServices-xxhdpi.apk
GoogleExtServices-xxxhdpi.apk

(before the fix, there only was GoogleExtServices.apk)

Change-Id: Icbc4dd002f856a3f751badec781ad132c423ac9b
2022-10-19 18:22:37 +09:00
Vinh Tran
827db14152 Merge "Default apex's compile_multilib to "first" in bp2build" 2022-10-17 14:12:29 +00:00
Vinh Tran
8f5310f90c Default apex's compile_multilib to "first" in bp2build
In Soong, decodeMultilib, used to get multilib to determine the dep variations, return "first" if defaultMultilib is set to "common". apex sets defaultMultilib to "common" which means equivalent compileMultilib in bp2build for apex should be "first" (See new Soong unit tests for more context).

This CL fixes bp2build for apex to be more correct.

Bug: 251559512
Test: go tests
Change-Id: Id1cb4407980fc1fab91822c81326f37fb4adfa0a
2022-10-13 16:59:30 -04:00
Colin Cross
21c71a35bd Merge "Move checking of minApiForArch for apex into cc" 2022-10-13 20:15:30 +00:00
Chen Guoyin
401f298e50 Add riscv64 support for apex prebuilt
This add support for src field in bp file.

Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: I9393696951db375d53436f9d5a9841b6a072cea3
2022-10-13 00:00:11 +08:00
Colin Cross
8ca61c1820 Move checking of minApiForArch for apex into cc
I49220cbec628f1508709741dc56b62aaac7786d9 attempted to allow
apexes to depend on native code whose min_sdk_version had been
increased to meet the minimum supported API level for a new
architecture.  It wasn't quite right, as it assumed that the
primary architecture of the apex would be the newest, and
it applied to all dependencies, not just ones that were
specfiic to the new architecture.  Move the checking into
cc.ShouldSupportSdkVersion, where it can be specific to an
individual architecture variant.

Bug: 250918230
Test: TestApexMinSdkVersion_MinApiForArch
Change-Id: I303cf485ba54b4c6bf63a9f9b49286ff9b2c9c83
2022-10-07 16:04:50 -07:00
Jingwen Chen
1d873331ad apex_key bp2build: disambiguate module and src deps.
(and remove unused keyName field.)

The private_key and public_key props of an apex_key can point to either
a module or a string. If it's a module, then respect it. If it's a
string, there's additional product variable lookup to find the apex_key
files in product_vars's DefaultAppCertificate parent dir.

This is similar to android_app_certificate.

Test: presubmits
Change-Id: Ib258da14cb0c2df8b5f817fcbc46afebcf225db8
2022-10-06 05:56:05 +00:00
Colin Cross
ec731a83e3 Merge "Use MinApiForArch to set minSdkVersion for apexes" 2022-10-05 22:03:22 +00:00
Colin Cross
a497606f1d Merge changes I154a6f3a,I79f0c20a,I605ae9af,I647c7305,I95e96e3e, ...
* changes:
  Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
  Support AllowMissingDependencies in prebuilt_apex modules
  Support AllowMissingDependencies for apex dependencies
  Add AllowMissingDependencies support for prebuilt_etc module with no src property
  Make OutputFileForModule work for AllowMissingDependencies
  Fix panics when target arch is riscv64
2022-10-05 21:25:17 +00:00
Colin Cross
56534df14f Use MinApiForArch to set minSdkVersion for apexes
Apexes for new architectures have to increase their minSdkVersion
to the minimum supported version for the architecture.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I49220cbec628f1508709741dc56b62aaac7786d9
2022-10-04 19:15:45 -07:00
Colin Cross
553a31be9d Support AllowMissingDependencies in prebuilt_apex modules
Arch-specfic prebuilt_apex modules may be missing prebuilts for new
architectures.  Mark the module as missing dependencies and allow
build analysis to continue when AllowMissingDependencies is set.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I79f0c20a0c9443fe443f9ed9bc846aa649f6b6a6
2022-10-04 16:38:14 -07:00
Colin Cross
1d48715961 Support AllowMissingDependencies for apex dependencies
Use android.OutputFileForModule instead of cc.Module.OutputFile,
which will already handle the AllowMissingDependencies case.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I605ae9afe06ac450adec1d2a856e529e45ed5cb5
2022-10-04 16:38:14 -07:00
Colin Cross
a2aaa2fdef Fix panics when target arch is riscv64
Fix panics in api_level.go and apex.go when using riscv64 as the target
arch.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I85c7685f3d14fa2dc7ffbcdea7f490feca304ef7
2022-10-04 10:53:07 -07:00
Jingwen Chen
bea58093b4 Share certificate bp2build between android_app and apex.
The certificate module is handled the same in Soong between android apps
and apexes, so share the bp2build code as well.

There are a few changes in this CL:

- If override_apex.certificate is unset, the generated apex also unsets
  it. This prevents the generated apex from using the base apex's
  certificate, which is most likely incorrect (e.g. google variant using
  the cert for the aosp variant). Instead, rely on the default
  certificate handling in the macro.
- If the certificate prop is a string, then it gets generated into
  certificate_name in order to disambiguate. This behavior is identical
  to android_app.

Test: added various unit tests.

Bug: 249089160
Fixes: 249089160
Change-Id: I99e18964ff546429a985d0f64dc21e2c69d35d9d
2022-10-03 09:20:47 +00:00
Treehugger Robot
b5a04d7905 Merge "Put base APK when AppSet is included in APEX" 2022-09-30 03:44:21 +00:00
Jiyong Park
4169a25f54 Put base APK when AppSet is included in APEX
This change fixes a bug that base APK of an AppSet is not put into the
APEX.

Bug: 236299724
Test: m nothing
Change-Id: I1010ec66d8551fcc1e2d9119be7ecdba22186607
2022-09-29 21:30:25 +09:00
Pranav Gupta
eba03b0935 Tag apex_set's 'set' config with android:"path"
This allows apex_set's set config to use other soong modules as a dependency

Bug:249169376
Change-Id: I8da20c6f474328d63d9aa3811f94e3e04b89ea4c
Test: Added a test case to check soong module assignment to the set field of an apks_set rule
2022-09-27 16:29:36 +00:00
Jiyong Park
e1b6914f58 Use PackedAdditionalOutputs when reading apk_set for canned_fs_config
When an app_set module is included in an APEX, we don't use its
`builtFile` which is the main APK, , but `PackedAdditionalOutputs()`
which is the zip file where all APK files (main + additional) files are
packed. We then unzip them into the corresponding directory inside the
APEX.

However, `buildFile` still has been used when constructing
canned_fs_config whose content should match with what are actually
included in the APEX. Fixing the bug by using
`PackedAdditionalOutputs()` instead.

Bug: 236299724
Test: m nothing (apex_test.go amended)
Test: follow https://buganizer.corp.google.com/issues/236299724#comment34
* mkdir for-236299724
* cd for-236299724
* repo init -u https://android.googlesource.com/platform/manifest -b
* master --partial-clone --clone-filter=blob:none
* repo sync -c -j8
* unzip -l ~/Downloads/mainline_t_2022_jun_t1004275.zip | cut -c31- | grep | xargs rm -f
* unzip ~/Downloads/mainline_t_2022_jun_t1004275.zip
* source build/envsetup.sh
* choosecombo 1 aosp_arm64 userdebug
* m com.android.extservices.gms

Change-Id: If9752c07748300dbb963568de4e879b041b0a206
2022-09-26 14:55:35 +09:00
Treehugger Robot
2eade656df Merge "Remove obsolete com.android.bluetooth apex" 2022-09-16 05:28:06 +00:00
William Escande
f03a3b00fe Remove obsolete com.android.bluetooth apex
Also remove the soong hack that allowed us to build during the
transition

Bug: 243054261
Test: build + TH
Merged-In: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
Change-Id: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
2022-09-14 21:09:50 +00:00
Sam Delmerico
1e3f78f866 add jacocoagent by default to Java modules
On coverage builds, R8 will fail to properly optimize and fail the build
if ignore_warnings: false, because jacoco injects dependencies on
jacocoagent classes, but the jacocoagent library is not part of the
classpath libraries passed in to R8 in its arguments.

Instead we can add jacocoagent as a libs dependency for these modules so
that it will get pulled into the r8 flags.

Bug: 243903417
Test: m
Change-Id: Icc24cc260b896fc800125a0318308d823ccf7a83
2022-09-09 16:50:38 -04:00