Commit graph

1367 commits

Author SHA1 Message Date
Colin Cross
df2043e96a Don't install system image copies of libraries in unbundled apex builds
Apex builds are setting LOCAL_REQUIRED_MODULES to include external
dependencies into the system image.  This make sense for device builds,
but just causes extra unnecessary builds for unbundled apex builds
that are not building device images.  Skip the dependency during
unbundled builds.

Test: aosp-master-art mainline_modules_x86_64-userdebug builds
Change-Id: I363995b7309cc3c90b0a584d051050f105b5b915
2023-01-26 15:40:58 -08:00
Dennis Shen
e2ed70c61a Support trimmed variant build in soong
variable.go:
add a new product variable TrimmedApex which is controlled by
environment variable PRODUCT_TRIMMED_APEX

config.go:
all config to check if trimmed build is turned on or not

apex.go:
add overridable apex module property:
use_DCLA: <DCLA apex module>

"use_DCLA" allows user to just use the lib list in DCLA to determine
which native shared libraries to trim. This property is no-op if
TrimApexEnabled is set to false.

builder.go
1, if it is to produce a trimmed variant, fix the default version code
by making the last variant digit to 2. this is only useful in local
build. in production build, there is apex manifest injection by
coastguard that determines the actual version code.

2, create a new apex rule called: "TrimmedApexRule", this rule invokes
an apexer wrapper called apexer_with_trim_preprocessing which will
properly trim the target libs.

BUG: b/259381334
TEST: adbd banchan build for both static and trimmed variant
Change-Id: I38a91cdef86a3c9185d00610ab3dd7acd07fd90a
2023-01-26 15:57:21 +00:00
Cole Faust
4d247e6f21 Refactor python rules
The goal of this cl is to simplify the python rules,
mostly by removing the "decorator" pattern that they
currently use, and instead making separate module
types for libraries, binaries, and tests that inherit
from each other.

Bug: 259718110
Test: Verified ninja files are unchanged (they only change in the list of soong sources because I added/deleted files)
Change-Id: I1e836e2cc4782c7818f91db7df7895de3b8db7ca
2023-01-25 10:40:59 -08:00
Liz Kammer
b83b7b024e bp2build apex min_sdk_version w/ soong config var
Previously min_sdk_version did not handle soong config vars

Test: m bp2build and verify com.android.adbd
Change-Id: I48426a8e6e03b61234b77ce7d7ec07b1cab36b7b
2023-01-11 22:01:01 -08:00
Jingwen Chen
94098e880e apex mixed builds: use the .capex when required.
The .capex is the compressed apex. Depending on various conditions, the
.capex should be installed, and thus the
apex.go#ProcessBazelQueryResponse should set the .capex as the main apex
output file.

Fixes: 264873511
Test: new unit test with install rules
Test: m com.android.adbd --bazel-mode-staging gives:

$ ls -lah
out/target/product/generic_arm64/system/apex/com.android.adbd.capex
-rw-r----- 1 jingwen primarygroup 3.6M Jan 10 14:44 out/target/product/generic_arm64/system/apex/com.android.adbd.capex

Change-Id: Ic3143cc6999f111428c6adb76760be8ddc4b6344
2023-01-10 14:50:42 +00:00
Treehugger Robot
4520481c6a Merge changes I07db8afc,Ia89e0239
* changes:
  Stop module types being SdkAware
  Replace usages of SdkAware in sdk module with Module
2023-01-07 14:46:22 +00:00
Jooyung Han
862c0d68ff Check for duplicate bundled files from different modules.
A single file generated by different modules is almost never correct;
make it an error.

The check is skipped for some error cases, which will be handled in follow-ups.

Bug: 191770320
Test: m (soong test)
Change-Id: Ib3c6efd16bdf13b59f79be66d4f9dba49100f6cc
2022-12-21 10:15:37 +09:00
Jingwen Chen
889f2f2844 mixed builds: Make apex's GetBazelLabel return the label of the override_apex, if applicable.
And add test1_com.android.tzdata to prod allowlist.

Fixes: 261054570
Bug: 261054570
Test: mkcompare
Change-Id: I314a4e44ade958ba9a91f71430d76175d734579e
2022-12-20 07:35:20 +00:00
Vinh Tran
b6803a5f52 Add ApexInfo.RequiresLibs to mixed build handler for apex
Adding ApexInfo.RequiresLibs from Bazel to apexBundle.requiredDeps which is eventuallyread by apex androidmk writer for LOCAL_REQUIRED_MODULES to ensures the libs are installed as part of a bundle build.

In Soong, apexBundle.requiredDeps is set in
https://cs.android.com/android/platform/build/soong/+/master:apex/apex.go;l=2305-2323;drc=cb7e73bc0130a95f5991c925c349387185abc098

The same logic is replicated in Bazel at
https://cs.android.com/android/platform/build/bazel/+/master:rules/apex/cc.bzl;l=141-163;drc=cb7e73bc0130a95f5991c925c349387185abc098.

This CL is porting the required libs set by Bazel in mixed build.

Test: go test
Test: run build/bazel/ci/mixed_libc.sh
Bug: 215500321
Change-Id: Id7256d279ac09a8fd42db391a7e93ce0021d8345
2022-12-14 18:54:47 -05:00
Paul Duffin
d796f6f6dc Stop module types being SdkAware
Removes all usages of SdkBase and InitSdkAwareModule.

Bug: 260237150
Test: m nothing
Change-Id: I07db8afc805eadbeb5b23f2e1d2f51567eecfab0
2022-12-12 17:33:06 +00:00
Treehugger Robot
93ca271c21 Merge "Vendor apex sets "vndkVersion" when it uses vndk libs" am: da62908229
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2330035

Change-Id: Ie7557b723485adc600f52e5bbd585a6ce0d4721d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 03:24:16 +00:00
Jooyung Han
d045ebca4c Vendor apex sets "vndkVersion" when it uses vndk libs
Vendor apex with "use_vndk_as_stable:true" sets the dependency in
"requireNativeLibs: ":vndk"". But this isn't enough because the APEX
won't work if VNDK version mismatches.

Now, when a vendor apex uses VNDK libs, "vndkVersion" is set as well in
apex_manifest so that apexd can abort the installation/staging when
device's VNDK version mimatches.

Bug: 222620439
Test: VendorApexHostTestCases
Test: built vendor apex how has "vndkVersion" field in its
 apex_manifest
Change-Id: If03340c230efe854ab932cdf472c276f7646ad0c
2022-12-08 09:42:03 +09:00
Jingwen Chen
9867290c71 Merge "Convert apex_available (for supported modules) to bazel tags." am: 8ec23f846d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2321580

Change-Id: I813778da920431fe7a46384782ffbfc19e435444
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 07:41:55 +00: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
Treehugger Robot
6ba2a5b746 Merge "Allow stubs implementation to be omitted" am: 378124baf1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2301917

Change-Id: I6fb94bba4db679feb806ff8712d21eb7191b8b1c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-24 11:46:32 +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
7db19f9485 Merge "Make htmlGzNotice an internal variable instead of apexBundle field." am: 3d99948e29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2305471

Change-Id: I58654133c2d27b6d50dbd3716388e68c92233b17
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 23:51:23 +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
545835d5e9 Merge "Do not assume that boot image profile exists when building ART apex." am: a672771df9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2304851

Change-Id: Icec9811bdfee0183f46992a59a0f0899f5bbe9ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 19:54:15 +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
788cfa3bd4 Add support of <APEX>-installed-files.txt in mixed build. am: 78c07de1dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2293858

Change-Id: I149341ca99e071667dd76e6ca947cf8a0a2e5f68
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-12 03:55:25 +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
Liz Kammer
50c74643c7 Connect base.zip to mixed builds am: 303978dcd2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288162

Change-Id: Iff9e5f7cf0570b0062daf286a3ac9f85f41a3218
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 18:04:39 +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
112492c0ba bazel apex: Add mixed builds support for <module>_using.xml file. am: 1ec7785ec5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2290033

Change-Id: If1c73659efde6100b147a7ca416760fd4ee0312e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 09:24:07 +00: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
Wei Li
644c9fea7f Merge "Add support of <APEX>_backing.txt in mixed build." am: 9b9fe02960
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2290700

Change-Id: Ib470b91244d6d0ee29500d01beac2878064fd7ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 23:29:34 +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
e3716ca39e bazel apex: Add mixed builds support for <module>_using.txt file. am: 0c9a276ded
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2287093

Change-Id: I27b3b9d70ac36a99e00abbe840efbd1581f4f75e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 02:51:18 +00: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
22f7ad00ef Merge "Add apex_test for mixed builds" am: f1c70ed5ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288161

Change-Id: Ic48f6d8e0e15ce4c474810b99cfda4def165aa38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-07 22:28:45 +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
Colin Cross
1c9d4dc64d Merge "Add support for per-arch configuration in apex_defaults" am: a493e5ff91
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2266192

Change-Id: I5fbededf29db88b32585a079d4819a2d0e33069a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 14:38:09 +00:00
Colin Cross
a493e5ff91 Merge "Add support for per-arch configuration in apex_defaults" 2022-11-03 14:00:45 +00:00
Colin Cross
3958986725 Merge "Add exclude_* properties to apex arch-specific properties" am: a3599abc75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2283143

Change-Id: I79bc652a8f32cbd5bc9ea1c6549b75750dd4d1be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 01:28:47 +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
Wei Li
60c7023976 Merge "Support new attributes added in ApexInfo in mixed build." am: aff9a46ca5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2271722

Change-Id: I9bef770a5e86bb14518abbbbb95a1d410f195b5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-29 02:01:28 +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
99416d29a6 Merge "Support apex_test." am: 2ff53da9f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2265965

Change-Id: I13c1017e5c91f83c649933c0cdf33a38c0f225ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-26 17:07:57 +00: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
Treehugger Robot
6ec14861b7 Merge "Introduce BazelStringOrLabelFromProp." am: 95ac23eeeb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2255856

Change-Id: I54a2fd05ede068d2d103769f7144a06aba66bf40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-20 18:36:38 +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
Vinh Tran
7abf2c4f64 Merge "Default apex's compile_multilib to "first" in bp2build" am: 827db14152
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2243697

Change-Id: I6ffdf6e089443358751840e99981184ddd4d6a8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 14:37:59 +00: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
b5645cb929 Merge "Move checking of minApiForArch for apex into cc" am: 21c71a35bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2243980

Change-Id: Ie2123163a7d78d023db91d857dd012b83c3898f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 20:56:51 +00: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
Xin Li
4369cdc509 Merge tm-qpr-dev-plus-aosp-without-vendor@9129937
Bug: 248070379
Merged-In: I368aabf4d032c02773416f27affa12eb40e77b40
Change-Id: I7747fa3ef0bb518c1b2aedd9170b9d4d880dc3af
2022-10-06 11:59:15 -07: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
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
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
William Escande
5c832be715 Remove obsolete com.android.bluetooth apex
Also remove the soong hack that allowed us to build during the
transition

Bug: 243054261
Test: build + TH
Change-Id: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
2022-09-14 21:08:53 +00:00
Dennis Shen
4dd7ab8f24 Merge "Place native shared libs for soong build DCLA." am: ee959f49eb am: dec8ae572d am: 51ec697e2d am: 46df0dcbc7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2172270

Change-Id: I7c8fa8f14cc82e94f1b179722c2240f9a6c36c24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 18:45:48 +00:00
Dennis Shen
ee959f49eb Merge "Place native shared libs for soong build DCLA." 2022-08-19 17:23:24 +00:00
Dennis Shen
af41bc13da Place native shared libs for soong build DCLA.
Currently, DCLA is built in rapid. With new train build, DCLA will be
directly built in soong, just like a regular module, refer to
b/239679485. In old rapid built DCLA, native shared libs are placed the
following way inside apex:

/lib(64)?/foo.so/<sha256 foo.so>/foo.so

The sha256 hash is used to differentiate different libs. To ensure the
same lib placement in soong built DCLA, three changes are made:

(1) in apex.go, added an apex soong module property called
dynamic_common_lib_apex to indicate if this apex is a DCLA
(2) in builder.go, update apexRule to call into run_apexer binary
instead of apexer binary. run_apexer binary is a wrapper of apexer
binary. If it is DCLA, the wrapper binary will place the native
shared libs in desired location and update canned_fs_config accordingly.

TEST: manuualy added this field to adbd. Local build by banchan
and then inspect the payload image contensts. All libs are proprely
placed.

BUG: 241096765

Change-Id: I2a5e7ea75a6e9a7af1932ff7dccb9dc3a3785db9
2022-08-18 18:25:19 +00:00
Spandan Das
8e742d4188 Merge "Spellcheck" am: 6b7c1dbf88 am: d6068de346 am: 88654a8b88 am: 8db5f3ffd9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2175925

Change-Id: Ia17fd408f3ba2d878beb0265dc4c5bd9ce1bb243
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-05 23:35:02 +00:00
Spandan Das
d6068de346 Merge "Spellcheck" am: 6b7c1dbf88
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2175925

Change-Id: I19195f0a91317762b24bb99c10c06bab79fcf455
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-05 21:50:03 +00:00
Spandan Das
a5f39a12de Spellcheck
This should fix a spelling error that crept in during a documentation CL

Test: N/A
Change-Id: I085f7fd1399f06e3b8808ed54963abce0e06f7fe
2022-08-05 02:36:36 +00:00
Treehugger Robot
88f1d5d368 Merge "Implement mixed builds for apex modules, take 2." am: 88e7512572 am: 953254b150 am: 1c0be10898 am: e4fe8254fe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2167802

Change-Id: If608e5c6aaaabcef7c2586a19f6779cca91910d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-30 00:26:42 +00:00
Treehugger Robot
953254b150 Merge "Implement mixed builds for apex modules, take 2." am: 88e7512572
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2167802

Change-Id: I9efd3c2e6f8c93aa8d1add3cbe6802e24d73b084
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 23:06:00 +00:00
Sasha Smundak
fe9a5b833d Implement mixed builds for apex modules, take 2.
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
  generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"

The first take 6a2b7c40b was setting compressed APEX suffix incorrectly, and
was reverted in 8a3c91494.

Fixes: 239925080 239695521 232085015
Test: treehugger
Change-Id: I1720f8db3c7cc773183d25a815d9b7eeaf7c73ad
2022-07-28 14:43:50 -07:00
Martin Stjernholm
49e037486b Merge "Revert "Implement mixed builds for apex modules."" am: 0bb7f0494e am: 2fb081fd28 am: 3346a24aef am: 87b3ef440b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2165026

Change-Id: I277e0641c4423109c5f8b42b275d8e462f2d891e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 16:04:08 +00:00
Martin Stjernholm
2fb081fd28 Merge "Revert "Implement mixed builds for apex modules."" am: 0bb7f0494e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2165026

Change-Id: I375077ee73ba18308d0841ca76956757935dd992
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 14:08:18 +00:00
Martin Stjernholm
0bb7f0494e Merge "Revert "Implement mixed builds for apex modules."" 2022-07-26 13:52:18 +00:00
Martin Stjernholm
8a3c914942 Revert "Implement mixed builds for apex modules."
Revert submission 2147387-mixed_builds

Reason for revert: Breaks zipapex build on git_master-art-host
Bug: 239925080
Reverted Changes:
I9f1e03e5e:Implement mixed builds for apex modules.
I13d9a0270:Add container and bundle encription key pairs to t...

Change-Id: I0eaad4dd81cac16d634f4c9cec18137a38e30d47
2022-07-26 09:35:39 +00:00
Paul Duffin
e3e8ba7745 Merge "Export any platform_compat_config used by apex to sdk snapshot" am: 69d09f49ec am: fa26f65155 am: 4dcb86de2c am: a984b2b876
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2160797

Change-Id: I416dc6c804b2b110946d879f10fcbe1b5683132e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 23:39:41 +00:00
Paul Duffin
fa26f65155 Merge "Export any platform_compat_config used by apex to sdk snapshot" am: 69d09f49ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2160797

Change-Id: Icb98af219a66d7ad48518ac49c6150798361f62b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 22:29:39 +00:00
Paul Duffin
fcf79850d8 Export any platform_compat_config used by apex to sdk snapshot
Previously, the platform_compat_config modules needed to be explicitly
listed in the sdk snapshot and the apex. This change will automatically
export them to the sdk snapshot when the apex is listed in its apexes
property.

Bug: 232401814
Test: m tethering-module-sdk
      # Before this change the generated snapshot did not contain the
      # platform_compat_config, after this change it did.
      m art-module-sdk
      # As that explicitly specifies the platform_compat_config in its
      # compat_configs property this change has no effect.
Change-Id: Ia854b9a52db2b1619fca41a387ce98d7f9f9efe9
2022-07-20 14:18:24 +00:00
Alexander Smundak
8e728f144e Merge "Implement mixed builds for apex modules." am: 9ec1ff98b7 am: f7ccf8c822 am: 34a6bda87e am: 035e5fddd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2104104

Change-Id: I65ea31f7232738d87ed3319c684475fa7d44d561
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 15:01:44 +00:00
Alexander Smundak
f7ccf8c822 Merge "Implement mixed builds for apex modules." am: 9ec1ff98b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2104104

Change-Id: I1fb794735088c8d69bd425cbe6a9d4b62b9ca43d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 13:59:21 +00:00
Sasha Smundak
6a2b7c40b3 Implement mixed builds for apex modules.
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
  generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"

Bug: 232085015
Test: treehugger
Change-Id: I9f1e03e5e7a5b5dde35a5db10c253069543ac973
2022-07-18 13:34:36 -07:00
Paul Duffin
3611e6609d Merge "Add apexes property to sdk" am: 0d89b3dc27 am: 4057d6455a am: da014983b3 am: 00e64f4aa0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096447

Change-Id: Icaef07d099761c689ce7556b04b655971f30b4c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 12:08:22 +00:00
Paul Duffin
4057d6455a Merge "Add apexes property to sdk" am: 0d89b3dc27
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096447

Change-Id: Ib57f709febd0827967afcd301825d7dae568b67a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 10:59:52 +00:00
Paul Duffin
4e7d1c43e2 Add apexes property to sdk
Specifying an apex in the apexes propety will cause all the
*classpath_fragments that are contents of the APEX to be automatically
added as members of the sdk and appear in the snapshot.

The purpose of this change is to dedup the APEX and sdk definitions and
try and avoid some of the issues that we have been finding while
attempting to build against the prebuilts.

Two tests, one each for bootclasspath_fragment and
systemserverclasspath_fragment, have been refactored to compare the
output when adding the *fragment to the sdk directly of via the APEX.
That ensures switching to use the APEX will not change the sdk snapshot
unless it was previously missing a *fragment.

There was also a slight difference in where the hidden API flags were
copied from. That should have no impact on the output as the flags are
identical.

The sdk snapshot generation needed some tweaks to avoid generating a
prebuilt for the APEX.

Bug: 232401814
Test: m nothing
Change-Id: I7aaf16a3a0ab4bebf97765d1484215cc008dc4b8
2022-07-06 15:58:43 +00:00
William Escande
49bc23b601 Clear apex.go entries for bluetooth libs am: 89bca3f301
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/19111518

Change-Id: Ib43164dedb4fcd90addcecd570f195e08dc6428b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-30 00:55:59 +00:00
Xin Li
42307c80c7 Merge "Merge tm-dev-plus-aosp-without-vendor@8763363" into stage-aosp-master 2022-06-29 21:16:54 +00:00
Treehugger Robot
4f7d0eb241 Merge "Refactor apexBundle code." am: 114ad30d76 am: 7028b50308 am: a416730bf1 am: 05941e95e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2138053

Change-Id: I41db417767906075c49c274bab766773e5cebab2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 09:17:56 +00:00
Treehugger Robot
a416730bf1 Merge "Refactor apexBundle code." am: 114ad30d76 am: 7028b50308
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2138053

Change-Id: I20c91b9425adffb44115dfc59e4b40cfa562b669
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 08:32:59 +00:00
Sasha Smundak
6f9e91d5e9 Refactor apexBundle code.
Move dependency walker out of GenerateAndroidBuildActions, reduce IDE
warnings.

Test: treehugger
Change-Id: I520c59772b1da7102d2a2364b2c56789455ea7fb
2022-06-28 22:47:43 -07:00
William Escande
89bca3f301 Clear apex.go entries for bluetooth libs
The module availability to Bluetooth is currently hard-coded in apex.go.
We are in the process of cleaning the apex.go by adding the availability
in each required module

Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I883a12f89a6d7eb43778e04ac50d6af38dd97116
2022-06-29 01:04:15 +00:00
William Escande
0ac940fab3 Merge "Clear apex.go entries for bluetooth libs" into tm-qpr-dev am: aec111952d
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18743691

Change-Id: Ied2610e2599dea44e338b3d3f51bd5e873bf3400
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-28 23:25:51 +00:00
William Escande
aec111952d Merge "Clear apex.go entries for bluetooth libs" into tm-qpr-dev 2022-06-28 23:09:56 +00:00
Oriol Prieto Gascó
cda10e187b Merge "Hard-code apex_available handling for the btservices apex" into tm-dev am: 3bb9d7a8d9 am: bb63423da1 am: 7b8cb64821
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18972588

Change-Id: I7742de88e124be497b0f60a73fd81852c464848d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 18:38:07 +00:00
Oriol Prieto Gascó
7d7bc5bef1 Merge "Hard-code apex_available handling for the btservices apex" into tm-dev am: 3bb9d7a8d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18972588

Change-Id: I5c6cc4bc32174ba0739d7ed6b42ae0b1685c4ef6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 17:43:25 +00:00
Oriol Prieto Gasco
8132fbf8c1 Hard-code apex_available handling for the btservices apex
Bug: 236192423
Test: TH
Change-Id: Ie095ae22704a80e0ec171b1bb3fdc995f95a1c64
2022-06-19 23:13:25 +00:00
Treehugger Robot
9f7fa50427 Merge "Restrict IsSanitizerEnabled() to android.Config()." am: 1c6502eba2 am: 7125d5d606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2127446

Change-Id: Ie6b578793fa05304b869795af4e0ca4455b75d5b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 23:05:53 +00:00
Lukacs T. Berki
01a648afa0 Restrict IsSanitizerEnabled() to android.Config().
Turns out, the whole context is not needed and then let's not
plumb it any further than necessary.

Test: Presubmits.
Change-Id: I1a25738e5a6ca20dea0d973c2ce435b5e152399b
2022-06-17 08:59:37 +02:00
Jingwen Chen
bd5b1a3672 Merge "bp2build: convert apex.logging_parent." am: c90a3cd6f6 am: d0645003cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2122357

Change-Id: Ic3bd9285dba93cc5c9455c3e4d91d6d460f776f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-11 03:15:54 +00:00
Jingwen Chen
b732d7c765 bp2build: convert apex.logging_parent.
Test: CI
Fixes: 235559958

Change-Id: I7b578c67eedb0379603bcf2fc029d03facfbbb0f
2022-06-10 08:38:03 +00:00
Jingwen Chen
fe05ba0f01 Merge changes Ib9a08167,I925e98d5 am: 1f0b70e7c0 am: 08ee8f7360
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2119933

Change-Id: I817cdb98dbf3d390532ac14c6b0727d2ed894e15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 08:10:29 +00:00
Jingwen Chen
df165c9e85 Only override prebuilts property if the override_apex.prebuilts is
explicitly specified (not nil).

This allows the base apex's prebuilts to be surfaced to the override
apex target.

Discovered when com.google.android.adbd's prebuilts didn't contain its
init.rc module.

Bug: 222588072
Test: CI
Change-Id: I925e98d53f7d9208652c629799ab568521ba7dfe
2022-06-08 16:03:03 +00:00
Treehugger Robot
45f09a5eed Merge "Convert override_apex.package_name with bp2build." am: 335071dad2 am: 463a1e580f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2114879

Change-Id: I57e30e1053115a05e8c56122f175c50b9f3944fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 15:46:52 +00:00
Jingwen Chen
9b7ebca187 Convert override_apex.package_name with bp2build.
Bug: 216414792
Test: CI and new bazel/bp2build tests
Change-Id: I3974970cdd555b3912798e79e61d61786a4ff677
2022-06-06 10:08:53 +00:00
William Escande
cfbdc3bb69 Clear apex.go entries for bluetooth libs
The module availability to Bluetooth is currently hard-coded in apex.go.
We are in the process of cleaning the apex.go by adding the availability
in each required module

Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I545ad6039e501c70e3ff5d9fc74fabfd37067145
2022-06-04 02:13:54 +00:00
Wei Li
607978227e Convert the property "manifest" properly for override_apex. am: 40f9873612 am: e577ddd482
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2100361

Change-Id: I6baaa602a3d591974b68ac3d9362f8adc0529470
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 05:34:22 +00:00
Wei Li
40f9873612 Convert the property "manifest" properly for override_apex.
1) When it is not set in base apex, default file name should be set explicitly in bp2build converter of apex
2) The manifest file path should be used as-is when base apex and override_apex is in the same Android.bp
3) The manifest file path should be prepended with package of base apex when base apex and override_apex is in different Android.bp

Bug: 216442475
Test: m nothing
Change-Id: Icd3523ebc31d885f67bea02aec05dbfc77671e87
2022-05-23 17:22:35 -07:00
Oriol Prieto Gascó
c17b70053d Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" into tm-dev 2022-05-23 19:49:32 +00:00
Oriol Prieto Gascó
a70425fb2f Revert "Append APEX version instead of build ID for APK-in-APEX ..."
Revert "Make apexer replace instances of version placeholder str..."

Revert submission 17944887-apk-in-apex

Reason for revert: Caused a regression (b/230873680)
Reverted Changes:
Ic37eeba8b:Make apexer replace instances of version placehold...
I9cef1418c:Append APEX version instead of build ID for APK-in...

Change-Id: I3da8bcb782baf71cddce9e4e92fe3894fc187b5c
2022-05-20 13:05:34 +00:00
Liz Kammer
dbd8eb11f4 Remove unused uses_sdks property for apexes
(cherry picked from commit 7eed538208)

Bug: 232546567
Test: m nothing & compare build.ninja before/after
Merged-In: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
Change-Id: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
2022-05-20 07:45:48 +00:00
Paul Duffin
1c29093729 Merge "Pass pointer to dependencyTag instead of copying struct" am: 4dd76eb26c am: fe844bb3f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096446

Change-Id: Iea6ea2f668a11c8ef0ea3ab6822987c7bcb2d373
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 22:50:02 +00:00
Spandan Das
91250b1ae4 Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
Merged-In: Ie8881b857afcec44addf27fc360c5b8abf726bd2
(cherry picked from commit 42e89508ee)
2022-05-13 19:16:23 +00:00
Paul Duffin
520917af9d Pass pointer to dependencyTag instead of copying struct
A follow up change will add some more fields to the tag which will make
passing the struct around by value will get more expensive. Switching
to pointers will make this slightly more efficient.

Changing the type of the tags from dependencyTag to *dependencyTag
broke a test. Rather than simply patch the test and then maybe have to
patch it again in the next change this adds a a String() method that
will insulate the test from being affected by changes in the
dependencyTag contents.

Bug: 232401814
Test: m nothing
Change-Id: I23da742ebffb74ef3b9b68f772519ceb38332f5f
2022-05-13 16:06:36 +00:00
Treehugger Robot
7ee1422274 Merge "Clean up hard-coded min_sdk_version/apex_available" am: 1c87db50ca am: 793c10dcc7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2089563

Change-Id: I789fa4687a2bdac6f0130543b21c58cd7707d12f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 10:21:55 +00:00
Treehugger Robot
1c87db50ca Merge "Clean up hard-coded min_sdk_version/apex_available" 2022-05-13 04:56:59 +00:00
Wei Li
366fae54a1 Merge "Add bp2build converter for override_apex." am: 49611b39a9 am: 9acec92f04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092595

Change-Id: I4bcef1a0da29197a01dea449997e533a37e330cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 08:02:05 +00:00
Wei Li
1c66fc74d2 Add bp2build converter for override_apex.
Bug: 216442475
Test: m nothing
Change-Id: I2f106d15c1d235583b8b1a8f0ac4b48162ff4fdd
2022-05-11 22:22:04 -07:00
Spandan Das
f454194692 Merge changes Ie8881b85,I6c064f8a am: f923333a93 am: e41be189f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2090231

Change-Id: I1eebfc246a05fdb728d1c9460f322f657f7d36df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:47:28 +00:00
Spandan Das
f923333a93 Merge changes Ie8881b85,I6c064f8a
* changes:
  Enforce updatable=true on apps of updatable apexes
  Update sdk_version check for jni_libs of updatable apps
2022-05-10 18:20:27 +00:00
Spandan Das
42e89508ee Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
2022-05-10 00:01:34 +00:00
Treehugger Robot
32b22ed6e1 Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" am: beccdcdff2 am: da3367e8cf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2087883

Change-Id: Icf30af7b6fe6e1a6e6043bfe38f522ca3c0a9245
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 04:01:12 +00:00
Jooyung Han
932d2c1932 Clean up hard-coded min_sdk_version/apex_available
Set min_sdk_version/apex_available for modules used by
com.android.permission APEX.

Bug: 147364041
Bug: 158059172
Test: m
Change-Id: I93ff72ed765354d44a2ccb5105b5f2820f0358f5
2022-05-06 12:21:04 +09:00
Treehugger Robot
beccdcdff2 Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" 2022-05-06 03:17:24 +00:00
Oriol Prieto Gasco
17e2290e9f Revert "Append APEX version instead of build ID for APK-in-APEX ..."
Revert submission 2067907-apk-in-apex

Bug: 230873680

Reason for revert: Change broke aab generation b/230873680
Reverted Changes:
I9cef1418c:Append APEX version instead of build ID for APK-in...
Ic37eeba8b:Make apexer replace instances of version placehold...

Change-Id: Ib113d56901e815435f71bf878049cdabd210503c
2022-05-05 14:32:37 +00:00
Treehugger Robot
ef758eca54 Merge "Remove unused uses_sdks property for apexes" am: a6fcf9fd92 am: 9a37c9bb75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2071390

Change-Id: Icb6dec841f99bfafb4238255bf80934f6600d059
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 05:52:36 +00:00
Treehugger Robot
a6fcf9fd92 Merge "Remove unused uses_sdks property for apexes" 2022-05-03 03:24:59 +00:00
Treehugger Robot
38d7429735 Merge "Update locations of apex bzl files" am: a704eb1469 am: 1873bb0b18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2081644

Change-Id: I5cd4b83307f4d53c6b42ae13b0b52423b86174c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-30 01:03:43 +00:00
Cole Faust
5f90da372e Update locations of apex bzl files
Bug: 230893497
Test: ./build/bazel/vendor/google/build_mainline_modules.sh
Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Change-Id: Ib16bece720a9167d02d2ddd8c4f11257634d382b
2022-04-29 13:37:43 -07:00
Treehugger Robot
50da2c4530 Merge "Prototype changes for multitree" am: 184a6b87e5 am: 91255a653f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2076401

Change-Id: Icf425fdcfddcb1267d241175ec86758117e53afc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:09:34 +00:00
Inseob Kim
5eb7ee9fad Prototype changes for multitree
This change contains a prototype implementation for multitree. Several
interfaces and modules are added.

1. Imported/Exported
Modules implementing Exportable interface can export artifacts to other
components. "imported_filegroup" modules can import generated artifacts from other exported modules.

2. Multitree metadata
It contains information about imported/exported modules in each
component, and can be generated via "m update-meta".

3. cc library stub
It's based on prototype stub libraries. It uses imported/exported
mechanism to expose a C API, with a map.txt file and header files.

Bug: 230448564
Test: m
Change-Id: Id7ff7618e2c630c5617a564d8b23b60a1cc9c8e8
2022-04-28 08:20:10 +00:00
Jingwen Chen
3b1dcf4f46 Append APEX version instead of build ID for APK-in-APEX paths.
This CL removes the build_id.mk suffix and replaces it with a hardcoded
placeholder string that will be replaced with the actual version in
apex_manifest.json by apexer at apex construction time.

This means that as long as the apex version is incremented, the
APK-in-APEX will be installed to a new directory path from the package
manager's perspective.

Fixes: 229574810
Bug: 229625490
Bug: 226559955
Bug: 224589412
Bug: 227417611
Bug: 228157333
Bug: 228803590
Bug: 229136249

Test: atest StrictJavaPackagesTest
Test: soong tests
Test: deapexer list out/dist/com.google.android.permission.apex
Ignore-AOSP-First: this is an cherrypick
Change-Id: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
Merged-In: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
2022-04-26 12:54:50 +00:00
Jingwen Chen
97fbc24443 Merge "Append APEX version instead of build ID for APK-in-APEX paths." am: d21a8a5a42 am: 4eb789da50
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2067907

Change-Id: Ib5c681d03dc12c5f4839b810b79ef4800235ea30
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-25 12:41:18 +00:00
Liz Kammer
7eed538208 Remove unused uses_sdks property for apexes
Test: m nothing & compare build.ninja before/after
Change-Id: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
2022-04-21 11:13:45 -04:00
Jingwen Chen
6cb124b8d9 Append APEX version instead of build ID for APK-in-APEX paths.
This CL removes the build_id.mk suffix and replaces it with a hardcoded
placeholder string that will be replaced with the actual version in
apex_manifest.json by apexer at apex construction time.

This means that as long as the apex version is incremented, the
APK-in-APEX will be installed to a new directory path from the package
manager's perspective.

Fixes: 229574810
Bug: 229625490
Bug: 226559955
Bug: 224589412
Bug: 227417611
Bug: 228157333
Bug: 228803590
Bug: 229136249

Test: atest StrictJavaPackagesTest
Test: soong tests
Test: deapexer list out/dist/com.google.android.permission.apex
Change-Id: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
2022-04-21 10:20:51 +00:00
Jingwen Chen
8ce1efc5af Suffix the build ID to the dirname of APK-in-APEX files.
This fixes an issue with package manager's cache invalidation.

Test: CI

Bug: 226559955
Bug: 224589412
Change-Id: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
Merged-In: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
2022-04-19 13:57:01 +00:00
Albert Martin
eefabcf321 Flag to globally override apexes' min_sdk_version
Override all mainline updateable apexes' min_sdk_version
to same version to get single shared native libs on DCLA.

Test: Run "vendor/google/build/go/mainline_go_modules_arm.sh" and inspect built apexes
Bug: 212609891
Change-Id: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
Merged-In: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
2022-04-08 17:51:07 +00:00
Albert Martin
5b0f6b9717 Merge "Flag to globally override apexes' min_sdk_version" into tm-dev 2022-04-08 16:05:23 +00:00
Albert Martin
55ccba2f61 Flag to globally override apexes' min_sdk_version
Override all mainline updateable apexes' min_sdk_version
to same version to get single shared native libs on DCLA.

Test: Run "vendor/google/build/go/mainline_go_modules_arm.sh" and inspect built apexes
Bug: 212609891
Change-Id: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
2022-04-06 17:39:50 +00:00
Jingwen Chen
60a1ff9328 Suffix the build ID to the dirname of APK-in-APEX files. am: 11cca671ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/17508450

Change-Id: If1ddcbebf2f746fd345a29ba966bf5ac8c02c41f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-05 19:44:58 +00:00
Spandan Das
f14e254a28 Change permitted_packages check to be per-jar rather than per-apex
(cherry-pick of ag/17524387 into aosp)

Summary:
- updates the Q and R maps, the new keys are the bcp jars and not the
apexes. neverallow build rules ensure that these bcp jars have a
restricted set of permitted_packages
- remove BootclasspathJar from the neverallow rule. This is no longer
necessary since the keys in the maps are the bootjars themselves, and
not apexes

Bug: 205289292
Test: In build/soong, go test ./apex
Change-Id: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
Merged-In: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
(cherry picked from commit 440ff96728)
2022-04-04 17:42:00 +00:00
Anton Hansson
e1b1836939 Revert "Relax apex package restriction for T+ jars"
This reverts commit 1fdd6ca88a.

Reason for revert: b/205289292 tracks the real fix for this

Test: presubmit
Change-Id: I5a2edaf4f930dafa26659f85d9425e9041c72275
Merged-In: I5a2edaf4f930dafa26659f85d9425e9041c72275
2022-04-04 17:27:43 +00:00
Spandan Das
451c6d461b Merge changes I473731a6,Icb91de93,I5a2edaf4 into tm-dev
* changes:
  Remove android.safetycenter from framework-permission bcp permitted_packges
  Change permitted_packages check to be per-jar rather than per-apex
  Revert "Relax apex package restriction for T+ jars"
2022-04-04 14:50:56 +00:00
Bob Badour
0a6539dd21 Merge "Revert "Revert "Build notice files from license metadata.""" am: 3aae38d451 am: b0489dec23 am: bf82573d27
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2051564

Change-Id: I0a1a9a0ea0ccd052dbc84cc6b2cce0b128393f63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-02 01:48:21 +00:00
Bob Badour
de6a087d2d Revert "Revert "Build notice files from license metadata.""
This reverts commit 77807b3c27.

Reason for revert: fix and roll forward again

Change-Id: I80c796ca81ecf29df9522babe54d684a0d11b9e6
2022-04-01 18:00:00 +00:00
Wei Sheng Shih
67c0b63929 Revert "Build notice files from license metadata." am: 77807b3c27 am: 72f9cdb599 am: 6c698e406d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2052565

Change-Id: I7e4f410833a4b8349e476d6fca4b2161c8f254f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 17:26:29 +00:00
Wei Sheng Shih
77807b3c27 Revert "Build notice files from license metadata."
This reverts commit 43c2dcaef6.

Reason for revert: suspect build break

Bug: 227682036

Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97


Change-Id: Ibfb8b4fefc264f52f32ba661c269a9cd625d800a
2022-04-01 14:10:53 +00:00
Bob Badour
8d17118d5a Build notice files from license metadata. am: 43c2dcaef6 am: 6f7de5b1a9 am: cbcf8d9b05
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2047886

Change-Id: I6a76eee6321538b70c331a2e2a9cb1e5b644ac04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 23:13:51 +00:00
TreeHugger Robot
86aa11c043 Merge "Clear apex.go entries for bluetooth libs" into tm-dev 2022-03-31 21:37:02 +00:00
Bob Badour
43c2dcaef6 Build notice files from license metadata.
Switch from generate-notice-files.py and mergenotice.py to htmlnotice.

Bug: 151177513
Bug: 213388645
Bug: 210912771

Test: m droid dist reportmissinglicenses
Change-Id: I6cac049d24f35ec358c6f341a04f4ba6161703bf
2022-03-31 17:29:01 +00:00
Jingwen Chen
11cca671ac Suffix the build ID to the dirname of APK-in-APEX files.
This fixes an issue with package manager's cache invalidation.

Test: CI

Bug: 226559955
Bug: 224589412
Change-Id: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
Merged-In: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
2022-03-31 16:28:37 +00:00
Spandan Das
d3fae5f2ed Remove android.safetycenter from framework-permission bcp permitted_packges
The permitted_packages check is now per jar and not per apex. Remove
safetycenter from the map since this package prefix cannot be in
framework-permission

Bug: 205719989
Bug: 205289292
Test: TH
Change-Id: I473731a697fb09319037536dead97f5abf4bd6ea
2022-03-31 15:48:24 +00:00
Spandan Das
440ff96728 Change permitted_packages check to be per-jar rather than per-apex
(This CL has been implemented in master to prevent a merge conflict with
ag/16222633. It will be cherry-picked to AOSP)

Summary:
- updates the Q and R maps, the new keys are the bcp jars and not the
apexes. neverallow build rules ensure that these bcp jars have a
restricted set of permitted_packages
- remove BootclasspathJar from the neverallow rule. This is no longer
necessary since the keys in the maps are the bootjars themselves, and
not apexes

Bug: 205289292
Test: In build/soong, go test ./apex
Change-Id: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
2022-03-31 15:47:45 +00:00
Anton Hansson
ddf8c1bed9 Revert "Relax apex package restriction for T+ jars"
This reverts commit 1fdd6ca88a.

Reason for revert: b/205289292 tracks the real fix for this

Test: presubmit
Change-Id: I5a2edaf4f930dafa26659f85d9425e9041c72275
(cherry picked from commit 1d016c50d0ee18ebc81ce7966e616b9936befd5a)
2022-03-31 15:47:12 +00:00
Spandan Das
d4cb14b66e Merge "Do not propagate strict_updatability linting to conscrypt and framework-media java_sdk_libraries" am: 183ed1044c am: d2f5f1c690 am: 667639eda2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2043123

Change-Id: Ice8dce7d620ee8ecf71c9b701a884289230f7aa5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 17:38:47 +00:00
Spandan Das
2cf278e75b Do not propagate strict_updatability linting to conscrypt
and framework-media java_sdk_libraries

Tmp fix for
https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=errorprone&lkgb=8352129&lkbb=8353967&fkbb=8352538

Test: m
out/soong/.intermediates/external/conscrypt/conscrypt.module.public.api.stubs.system/android_common/lint/lint-baseline.xml
Test: (internal CI target) https://android-build.googleplex.com/builds/abtd/run/L67700000953708519
Bug: 182349282
Bug: 226637002
Bug: 226608044

Change-Id: I17e540877200f59bfd51e69e57d8bcca6cf3850f
2022-03-25 02:31:20 +00:00
Spandan Das
a1ec6ead90 Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217 am: ad40fffa64 am: 3dd2985871 am: db71cd071c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1977412

Change-Id: Ibbbeaaffb3a8baad67f50699d10a499155c3fd88
2022-03-24 17:59:24 +00:00
Spandan Das
ad40fffa64 Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217
* changes:
  Do not propagate strict updatability linting to libcore/
  Create allowlist to skip strict updatability lint check
  Propagate strict_updatability_linting to transitive deps of updatable apexes
  Export LintDepSetsIntf from java package
2022-03-24 16:38:20 +00:00
Colin Cross
4c4c1be915 Use single module for clang runtime libraries
The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture.

Bug: 220019988
Test: m checkbuild
Change-Id: I39e2cf8ae14edf8510276dab38011afaef85822c
Merged-In: I39e2cf8ae14edf8510276dab38011afaef85822c
2022-03-07 14:56:32 -08:00
Remi NGUYEN VAN
6817192157 Merge "Support overriding APEX java contents" am: 979b652dec am: 285ce79db5 am: e355a8aefb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2005472

Change-Id: I7ff2ac2325960e012d40d0398b26faf1d98e82ab
2022-03-03 02:42:21 +00:00
Remi NGUYEN VAN
e355a8aefb Merge "Support overriding APEX java contents" am: 979b652dec am: 285ce79db5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2005472

Change-Id: Iab09a8281fd0306b7c02255d9f465004a4c05a64
2022-03-03 02:21:33 +00:00
William Escande
5e48389e0f Clear apex.go entries for bluetooth libs
Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I53652c4c46bf1019a8062210b2503cf0a34d94cc
2022-03-02 20:23:11 +01:00
Remi NGUYEN VAN
be90172f0a Support overriding APEX java contents
In addition to the current "apps", support overriding
bootclasspath_fragments, systemserverclasspath_fragments, and java_libs.

This is useful to build APEXes with slightly different contents, for
example where the base APEX could contain libraries that only use stable
APIs, but the overriding APEX could contain a variant that also uses
non-finalized APIs.

Bug: 222247869
Test: m (runs apex tests)
Change-Id: I14da6f835c58b44be31e517598695ec8ff830648
2022-03-02 21:23:15 +09:00
Colin Cross
655be5dba9 Merge "Use single module for clang runtime libraries" into sc-v2-dev-plus-aosp am: 135513ae65
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/17036885

Change-Id: I72d5cdd315cad007f6f6a1a1a91f8ca272014f9c
2022-03-01 01:20:47 +00:00
Colin Cross
fc0df95df5 Use single module for clang runtime libraries
The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture.

Bug: 220019988
Test: m checkbuild
Change-Id: I39e2cf8ae14edf8510276dab38011afaef85822c
(cherry picked from commit 386ee59a23)
Merged-In:I39e2cf8ae14edf8510276dab38011afaef85822c
2022-02-28 21:01:05 +00:00
Treehugger Robot
7a866cbf3b Merge "apex: track transitive dependencies of rust jni lib" am: 7ff6e3d257 am: 3a2f53e559 am: 831b04f0b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1998313

Change-Id: I083a0d1a176df5c59804ee8bcf5e15cb85b28966
2022-02-25 01:03:49 +00:00
Treehugger Robot
7ff6e3d257 Merge "apex: track transitive dependencies of rust jni lib" 2022-02-24 23:50:14 +00:00
Jooyung Han
11f70d68ed Merge "apex supports ".apex" tag" am: 4c696f2a89 am: 58eccbde83 am: 8427919e24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1998312

Change-Id: I97efcc6b15faaf92d061701e2f7af33d07cd1124
2022-02-24 12:46:14 +00:00
Jiyong Park
34d5c33529 apex: track transitive dependencies of rust jni lib
dependencies of rust library registered as jni_lib are correctly
tracked.

Bug: 220397949
Test: m nothing
Change-Id: I43016a77656d04f59f798b02d541c6a19288ec9c
2022-02-24 18:02:44 +09:00
Jooyung Han
a6d3667b67 apex supports ".apex" tag
Tests can embed non-compressed .apex output with the tag.

Bug: 221024307
Test: soong test
Change-Id: Id4a239d1897237105a064cea8c97029f5b996a98
2022-02-24 13:59:45 +09:00
Spandan Das
d9c23abeca Do not propagate strict updatability linting to libcore/
propogation of this flag is determined by the location of the Android.bp
where a library is defined.
libcore/ libraries that are transtive deps of updatable apexes will
- inherit strict_updatability_linting:true if defined in libcore root
- not inherit strict_updatability_linting:true if defined in libcore
  subdir

Note that the module can explicitly list `lint:{strict_updatability_linting: true}'
in their Android.bp file, in which case they will not be allowed to
baseline NewApi errors

Test: m lint-check
Test: TH
Bug: 208656169
Bug: 182349282

Change-Id: I4c373b2960a7af16301d7f06aab448f39b937ea9
2022-02-23 21:49:56 +00:00
Ray Essick
de1e300802 Clean auto-allowed modules for media mainline
Cleans out the remaining modules that build system
auto-allowed for the media mainline modules com.android.media
and com.android.media.swcodec. With this change, both lists
are empty and all needed modules are documented with explicit
apex_available clauses.

Bug: 215589022
Bug: 147364041
Test: build
Change-Id: I7d809ae72ad21f6b2ed8b05613c44019a974f6fd
2022-02-10 17:37:51 -08:00
Spandan Das
08c911f4eb Create allowlist to skip strict updatability lint check
As of Jan 2022, some updatable mainline modules have (transitive) deps with
NewApi in their respective lint-baseline.xml. Create an allowlist to
relax this check temporarily for those mainline modules.

Test: m lint-check
Test: TH
Bug: 182349282

Change-Id: I9ccda6fccb973e9100e31b7e559f5642289ac717
2022-02-10 02:25:21 +00:00
Spandan Das
6677325124 Propagate strict_updatability_linting to transitive deps of updatable apexes
Create a topdown mutator to walk the deps of updatable apexes. If a dep
is lintable, set its strictUpdatabilityLinting to true

Creating a new mutator after apexInfoMutator makes it easy to maintain
an allowlist (e.g. override_apex does not require an entry in the
allowlist, its canonical name can be retrieved using ApexVariationName())

Test: In build/soong/, go test ./apex
Test: TH
Bug: 182349282

Change-Id: I1b390b0e3a8fb20754ce50c6b253d68d2b3f263b
2022-02-08 19:25:37 +00:00
Jooyung Han
35dc3aca98 Merge changes I11693286,I8d79a434 am: 472be14f26 am: 601cb3422d am: 4749d6884d am: c909932b23
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1972300

Change-Id: I21afcefa5fa7ee98efef8fad035463ba292909b7
2022-02-08 02:12:55 +00:00
Ray Essick
5d240fb8ad Clean auto-allowed modules for media mainline
Clean out list of modules automatically allowed to be used in the media
mainline modules, now that those modules have explicit apex_available
clauses in their Android.bp files.

Bug: 215589022
Bug: 147364041
Test: build
Change-Id: I2d3f57621796c99a119acc98e1ead358aebedc5d
2022-02-07 11:01:32 -08:00
Jooyung Han
c5a967630e use_vndk_as_stable APEX shouldn't include VNDK lib
Even though a vendor APEX sets use_vndk_as_stable:true it was possible
to include a VNDK lib by directly depending on it with
native_shared_libs.

But it's contradictory to have a VNDK lib while declaring not to include
VNDK libs. It was missing since pruning dependencies on VNDK libs was
done only for transitive deps.

Added a check to reject this.

Bug: 216847402
Test: m nothing(running soong tests)
Change-Id: I8d79a434b1bfe8e563cf8968fa76830b0e582f66
2022-02-04 13:07:11 +09:00
Wei Li
66b42aeb20 Merge "Add bp2build support for property "compressible" of apex module." am: a61dbd457e am: c311b19b3a am: 254b753da8 am: 7e82c20b19
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1956876

Change-Id: Ie5033ec7691a8613548ba124822cb272831bd5c7
2022-01-26 02:39:59 +00:00
Wei Li
f034cb4d7b Add bp2build support for property "compressible" of apex module.
Bug: 214466457
Bug: 207551677
Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Test: b test //build/bazel/tests/apex:build.bazel.examples.apex.minimal_apex
Test: b test //build/bazel/tests/apex:build.bazel.examples.apex.minimal_capex

Change-Id: I6bf12c1b0c52d4486968bb430a67a3c3110766db
2022-01-25 19:42:43 +00:00
Oriol Prieto Gasco
a07099d858 Make 'Compressible' an overridable property
This is needed to allow the Android Go versions of modules
(com.google.android.go.*) to select a different compression toggle than
their non-Go (com.google.android.*) conterparts. go/go-updatability

Bug: 203024418
Test: Preloaded go variants on wembley, booted Android.
Change-Id: Ic96aff5fafb65fbd08e8a69d47c994532e27819e
Merged-In: Ic96aff5fafb65fbd08e8a69d47c994532e27819e
(cherry picked from commit 2c4a96375a)
2022-01-22 00:45:58 +00:00
Jiakai Zhang
9d92964ddd Ignore some properties for T and above.
As requested by reminv@, their team wants the source code in
sc-mainline-prod to be strictly the same as the code in AOSP. Therefore,
we need to ignore `standalone_contents` in the
`systemserverclasspath_fragment` module and
`systemserverclasspath_fragments` in the `sdk` module in order to merge
aosp/1925682 into sc-mainline-prod.

- `standalone_contents` in the `systemserverclasspath_fragment` module
  does nothing but adds its contents as dependencies of the APEX.
- `systemserverclasspath_fragments` in the `sdk` module does nothing.

Bug: 203198541
Test: TARGET_BUILD_APPS=com.android.tethering vendor/google/build/mainline_modules_bundles.sh
Change-Id: I56ca22aa91a807cd113dfda2fabaeb49ecabe289
Merged-In: I09a6fd1d3db85c194330da9b751702a9bf069e26
2022-01-21 16:30:44 +00:00
Treehugger Robot
ff61c8a357 Merge "Improve apex build check explanation" am: c85964a734 am: ae0306f79d am: 80a95575bc am: 99857fc2c8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1954236

Change-Id: Id571592efb2d63455e5c65868fc399eabc98ca51
2022-01-20 22:24:18 +00:00
Treehugger Robot
c85964a734 Merge "Improve apex build check explanation" 2022-01-20 21:06:39 +00:00
Andrei Onea
d967aee96f Improve apex build check explanation
Discourage jarjaring code where there are alternatives with
better system health implications.

Test: m
Bug: 215233995
Change-Id: I1b076d00e1ad6aa32b41da6bda1033978b5e829d
2022-01-19 16:07:21 +00:00
Jingwen Chen
eefba215b9 Merge "Support multilib in apex." am: 539d41b686 am: 2cda5749f4 am: e1fc6a20ca am: 3ded2c64ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1932025

Change-Id: I214abe526ce8cb21dfba6b00ffa1ed284504644b
2022-01-19 12:13:09 +00:00
Jingwen Chen
539d41b686 Merge "Support multilib in apex." 2022-01-19 11:11:05 +00:00
Treehugger Robot
ad6fae4930 Merge "[NETD-BPF#34] Add a tag for bpf to specify the install folder" am: a9a5d36884 am: 9624d183f4 am: 7b49b608f6 am: 1a1604f9c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1888356

Change-Id: Ic82782a7a0f56a34881961cdee2b4c82bff893e5
2022-01-19 10:51:55 +00:00
Treehugger Robot
a9a5d36884 Merge "[NETD-BPF#34] Add a tag for bpf to specify the install folder" 2022-01-19 09:41:57 +00:00
Ken Chen
6320efb56e [NETD-BPF#34] Add a tag for bpf to specify the install folder
Currently, the bpf module netd.o (source system/netd/bpf_progs/netd.c)
will be built to /system/etc/bpf/netd.o. In Android T, it will be moved
to mainline module com.android.tethering.

The expected behavior is:
- In T device, it uses the netd.o in mainline module.
- In pre-T devices, it uses the original netd, built from platform.

However, netd.o will be double loaded if the tethering module is
installed in Pre-T devices. Because:
1. bpf in apex is packed into /apex/MAINLINE_MODULE/etc/bpf/
2. bpf in platform is packed into /system/etc/bpf/
3. bpfloader in pre-T loads ANY bpf modules under
/apex/com.android.tethering/etc/bpf/ and /system/etc/bpf/.

We can't change the behavior of bpfloader in pre-T devices. We can't
delete the /system/etc/bpf/netd.o from pre-T devices. Both of them are
not mainline modules. So the mainlined netd.o needs to be packed into a
folder other than /apex/com.android.tethering/etc/bpf/ or
/system/etc/bpf/.

This commit adds a tag 'sub_dir' for bpf module. The installation path
of bpf modules will be:
- /system/etc/bpf/SUB_DIR/     (for platform code)
- /apex/MAINLINE_MODULE/etc/bpf/SUB_DIR/     (for mainline module)

Bug: 202086915
Test: add test in apex_test.go and build
Merged-In: Icc6619768ab006de9f86620a7df1bb2853eaba13
Change-Id: Icc6619768ab006de9f86620a7df1bb2853eaba13
2022-01-19 08:04:00 +00:00
Ken Chen
fad7f9d8b7 [NETD-BPF#34] Add a tag for bpf to specify the install folder
Currently, the bpf module netd.o (source system/netd/bpf_progs/netd.c)
will be built to /system/etc/bpf/netd.o. In Android T, it will be moved
to mainline module com.android.tethering.

The expected behavior is:
- In T device, it uses the netd.o in mainline module.
- In pre-T devices, it uses the original netd, built from platform.

However, netd.o will be double loaded if the tethering module is
installed in Pre-T devices. Because:
1. bpf in apex is packed into /apex/MAINLINE_MODULE/etc/bpf/
2. bpf in platform is packed into /system/etc/bpf/
3. bpfloader in pre-T loads ANY bpf modules under
/apex/com.android.tethering/etc/bpf/ and /system/etc/bpf/.

We can't change the behavior of bpfloader in pre-T devices. We can't
delete the /system/etc/bpf/netd.o from pre-T devices. Both of them are
not mainline modules. So the mainlined netd.o needs to be packed into a
folder other than /apex/com.android.tethering/etc/bpf/ or
/system/etc/bpf/.

This commit adds a tag 'sub_dir' for bpf module. The installation path
of bpf modules will be:
- /system/etc/bpf/SUB_DIR/     (for platform code)
- /apex/MAINLINE_MODULE/etc/bpf/SUB_DIR/     (for mainline module)

Bug: 202086915
Test: add test in apex_test.go and build
Change-Id: Icc6619768ab006de9f86620a7df1bb2853eaba13
2022-01-19 04:02:29 +00:00
Yu Liu
4ae55d17f6 Support multilib in apex.
Bug: b/208325023
Test: Added unit tests, also tested with adbd apex build manually.
Change-Id: I47e04cd4eb5d05227f0a84683dcb66dff00e3514
2022-01-18 10:38:05 -08:00
Jiakai Zhang
594ed5022a Merge "Allow installing boot images outside of APEX." am: 0cd2a0e2bf am: c1744ee0a0 am: d437de134a am: 91c7d55489
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1947127

Change-Id: Id50d66720662cf5e06b2a8441feab2c5300aaf60
2022-01-14 18:51:40 +00:00
Jiakai Zhang
6decef916c Allow installing boot images outside of APEX.
After this change, `bootImageConfig.installDirOnDevice` can be set to a
path outside of the APEX, in which case, the boot image will not be
installed in the APEX. Instead, it will be installed to the given path
by Make.

This is a no-op change. Current behavior is not affected.

Bug: 211973309
Test: m nothing
Test: -
  1. m com.android.art
  2. See the boot image still being installed in the ART APEX.
Test: -
  1. Change `installDirOnDevice` of the ART boot image config to
     `system/framework`.
  2. See the boot image being installed in `/system/framework/<arch>`.
Change-Id: Ib13b17cc9e94dc5754c9b51b04df3307323b8783
2022-01-13 14:50:05 +00:00
Jiyong Park
b90099d84e Merge changes from topic "canned_fs_config" am: ae9cf26353 am: 33fd601118 am: a214351987 am: 7cc9a75156
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918605


Change-Id: I484e46ff819a5266c1e8046dae337e18ef3fefea
Merged-In: I484e46ff819a5266c1e8046dae337e18ef3fefea
Merged-In: I7f2576ff99c65bdb6c9ce4ace61bc783eea2f0d4
(cherry picked from commit 755e3808b2)
2022-01-04 12:54:44 +00:00
Treehugger Robot
dbd3553d83 Merge "Remove InstallBypassMake and ToMakePath" am: f1228f570a am: a9f335cf5a am: fd865c6688 am: 8ef2179a6e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1889722

Change-Id: If49c894804c5ca0dfd197ca848ff1c9ac79556f4
2021-12-17 07:36:53 +00:00
Treehugger Robot
f1228f570a Merge "Remove InstallBypassMake and ToMakePath" 2021-12-17 06:15:16 +00:00
Etienne Ruffieux
849c5e1c8b Merge "Renamed bluetooth apex name to com.android.bluetooth" am: a447c0973b am: c29e4fc462 am: 072039402d am: 8e91f00181
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924343

Change-Id: Id911065a6223ce56c3e566e848bb5db32260ce5f
2021-12-16 23:31:19 +00:00
Etienne Ruffieux
a447c0973b Merge "Renamed bluetooth apex name to com.android.bluetooth" 2021-12-16 18:10:45 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Etienne Ruffieux
1651267c9c Renamed bluetooth apex name to com.android.bluetooth
Tag: #feature
Bug: 206614050
Test: Compiles
Change-Id: I4dc9f3d12ddc12e320a97c68144d5b642d6ab29b
2021-12-15 15:49:04 +00:00
Jiyong Park
755e3808b2 Merge changes from topic "canned_fs_config" am: ae9cf26353 am: 33fd601118 am: a214351987 am: 7cc9a75156
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918606

Change-Id: I4846d0483dcd3e712ddb027d7c6c335654021cee
2021-12-15 11:08:07 +00:00
Jiyong Park
ae9cf26353 Merge changes from topic "canned_fs_config"
* changes:
  Add canned_fs_config to apex module type
  Build canned_fs_config using RuleBuilder
2021-12-15 09:57:42 +00:00
Jiyong Park
038e852ce1 Add canned_fs_config to apex module type
The property is used to customize uid/gid/mode/capabilities of files in
an APEX.

Bug: 209971551
Test: m
Change-Id: I484e46ff819a5266c1e8046dae337e18ef3fefea
2021-12-15 09:11:15 +09:00
Liz Kammer
6299b235bb Merge "Use one mutator for all bp2build conversion." am: 92344259c5 am: 782f37eaee am: 5f4df317ee am: 037105c0f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1878397

Change-Id: I56073dc653947ebf69d7a74e97c1092f06aab139
2021-12-14 20:25:04 +00:00
Liz Kammer
be46fccc40 Use one mutator for all bp2build conversion.
Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.

Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
2021-12-14 09:37:45 -05:00