Commit graph

2994 commits

Author SHA1 Message Date
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
3a5be76dc0 Merge "Suffix the build ID to the dirname of APK-in-APEX files." 2022-04-21 09:24:22 +00:00
Colin Cross
b77e80015a Merge "Only install to $OUT/apex for installable apexes" am: e3db7f6d38 am: e0aec36cbe am: 112817c169
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2065677

Change-Id: Ibd03dc6e6a247ea18bdbec4feaf4675f042937d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 06:15:30 +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
Colin Cross
02730b93b2 Only install to $OUT/apex for installable apexes
When coverage is enabled there are two variants of the apex, one
installable and one not installable.  Don't try to install files
files to $OUT/apex for the non-installable variant.

Bug: 217453046
Test: m NATIVE_COVERAGE_PATHS="*" NATIVE_COVERAGE_EXCLUDE_PATHS="art bionic/libc device" CLANG_COVERAGE=true USE_HOST_MUSL=true com.android.runtime
Change-Id: I23e58c811ff943b9d5dec025fa619c8db835b29c
2022-04-19 00:45:07 +00:00
Jiyong Park
bdd748835c Merge "Remove apex10000_private variants" am: 9c58a3628b am: 74810ac14d am: 81de76843f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2062048

Change-Id: I35154eb0d2c5071a5ae5fe9e3b93e821dbe7ac64
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-12 21:00:17 +00:00
Jiyong Park
9c58a3628b Merge "Remove apex10000_private variants" 2022-04-12 19:37:57 +00:00
Jiyong Park
d4a0063d3e Remove apex10000_private variants
When a library is included in two APEXes whose platform_apis settings
are different, two apex variants of the library is created: apex1000 and
apex1000_private.

This change was introduced with ag/15061306, especially by the commit
[1].

However, that part should be reverted because it actually creates
unnecessary variants. It's unnecessary because the two variants of the
library are compiled (excluding the linking) exactly the same. If a
private symbol of its dependency was actually used when compiling the
apex1000_private variant, then the other apex1000 variant wouldn't have
been built because that private symbol must have caused a linkage error.

[1] https://googleplex-android-review.git.corp.google.com/c/platform/build/soong/+/15061306/2..4/android/apex.go#b527).

Bug: 228785792
Test: m
Change-Id: Id58d3e98a51de5e628ca72ef86e9cd11b0ee8971
2022-04-12 12:23:20 +09:00
Colin Cross
6bfe9bc4fa Merge changes I046d75db,Ie13817dc am: d2aa190bdc am: f2c86c8c76 am: 1a3ea67458
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2058908

Change-Id: I9ab91976903abbb4e3ec17b3d26db15447f074d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-12 00:58:51 +00:00
Colin Cross
abc0dab477 Move proguard test files to java package
The proguard test files are duplicated in apex and sysprop and will
be needed by app tests, move them to the java package.

Test: run all soong tests
Change-Id: Ie13817dcda8d98801d16a97ffceef1100c7d5380
2022-04-11 11:44:32 -07: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
Matt Banda
fd70f165f1 Merge "Surface Java APIs Used By APK-only Modules." into tm-dev 2022-04-07 00:04:38 +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
Wei Li
296d499653 Merge "Export provenance metadata for prebuilt APKs and APEXes." am: c055d88c16 am: c41308e05e am: d58ecd96a8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2045371

Change-Id: Idd4f83b79dd05e7f299cd26110bdc1f22d7b2e49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06 05:32:38 +00:00
Wei Li
340ee8e699 Export provenance metadata for prebuilt APKs and APEXes.
Bug: 217434690
Test: atest --host gen_provenance_metadata_test
Test: m provenance_metadata

Change-Id: I91c184b6e6fe5ccfc3fc65b55b09e7a3da9502a0
2022-04-05 16:16:16 -07:00
Matt Banda
8c80126987 Surface Java APIs Used By APK-only Modules.
Previously we were only generating used-by API-coverage for APEX modules.
This change adds support for APK-only modules such as NetworkStack and DocumentsUI.

Bug: b/216313756
Forrest Run: https://android-build.googleplex.com/builds/abtd/run/L10800000953846781

Test: TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86 ./vendor/google/build/build_unbundled_coverage_mainline_module.sh -j16

Change-Id: Id17e4a55c2a52e9903632a654e778f8d54982dfc
Merged-In: Id17e4a55c2a52e9903632a654e778f8d54982dfc
(cherry picked from commit 56d75785bd)
2022-04-05 21:28:29 +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
Treehugger Robot
c7f2125a26 Merge "Keep dependency files out of the apk file." am: 5f58c378b6 am: d4a37e0757 am: f82be53525
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2055425

Change-Id: Ifdaf251cae92a6cb38f338e1455390fea84fc5df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-05 06:50:38 +00:00
Treehugger Robot
5f58c378b6 Merge "Keep dependency files out of the apk file." 2022-04-05 05:53:22 +00:00
Bob Badour
2c8888edef Keep dependency files out of the apk file.
Bug: 227682036

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

Change-Id: I1a9775af7c652191bb1ce3b97c1cb9365b469c19
2022-04-04 19:21:18 -07: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
c64d309ce2 Fix breakage: bad path join using '/' literal am: 2a5c090c31 am: cf96d25b3d am: ec84245e25
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2052015

Change-Id: I5e8ea66626e0cde29a7c24f370b85548ae6b5d4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 09:27:15 +00:00
Bob Badour
2a5c090c31 Fix breakage: bad path join using '/' literal
Typo in filename s/b NOTICE.html.gz not NOTICES.html.gz

Bug: 227682036

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

Change-Id: I75cc28e3ef22d975ad46f4e167071f6d82ba253d
2022-03-31 23:40:28 -07: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
3c66771c62 Merge "Use single module for clang runtime libraries" 2022-03-08 06:51:43 +00:00
Colin Cross
159ea359cd Skip install rules for apexes with installable: false am: d9ccb6a2cb am: fbb6372522 am: 455a14dbb6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2014735

Change-Id: Ic7e7c8c30360baa1e8ba6f31aceb30a8718045b5
2022-03-08 06:36:24 +00:00
Colin Cross
455a14dbb6 Skip install rules for apexes with installable: false am: d9ccb6a2cb am: fbb6372522
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2014735

Change-Id: I0d548aae9c84b0ef963b490664274b790ab4e454
2022-03-08 06:15:18 +00:00
Colin Cross
d9ccb6a2cb Skip install rules for apexes with installable: false
When an apex sets installable: false call SkipInstall to prevent
creating the install rules, and don't report the install rules
to Make.

Fixes: 221261079
Test: m checkbuild
Change-Id: If94759b16f79ee10ddcf8ee89603ca9e822b74f5
2022-03-08 02:40:32 +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
Remi NGUYEN VAN
979b652dec Merge "Support overriding APEX java contents" 2022-03-03 01:26:19 +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
Jiakai Zhang
55fde925a4 Merge "Install required deps for flattened APEX." am: 0407606ce1 am: 1f7d72c559 am: 1a62a36c8b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1999190

Change-Id: Ia58a00a561846229c2cf1bdfcb1c34e4fc395d67
2022-02-28 16:40:36 +00:00
Jiakai Zhang
0407606ce1 Merge "Install required deps for flattened APEX." 2022-02-28 15:29:31 +00:00
Jiakai Zhang
d70dff7c9b Install required deps for flattened APEX.
The primary boot image is a required dep of the ART APEX. It needs to be
installed no matter the APEX is flattened or not.

Bug: 220991677
Test: 1. m OVERRIDE_TARGET_FLATTEN_APEX=true com.android.art
  2. See boot.art in /system/framework/<isa>
Change-Id: I1a69ae1b86df97fc44ea6c75c8bb9ec960c8d249
2022-02-28 11:18:29 +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
Gurpreet Singh
aa858d405c Merge "Manifest Fixer Params code refactor" am: 7761de5d4e am: bdf5b8030e am: 5f93fb0f44 am: e692318fe0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979469

Change-Id: I2cd15fc63d2e9f96b081732236c1f8aed6bb30e3
2022-02-10 19:11:08 +00:00
Gurpreet Singh
7761de5d4e Merge "Manifest Fixer Params code refactor" 2022-02-10 18:22:30 +00:00
Gurpreet Singh
c8a8ffb1f0 Merge "Geneate AndroidManifest file if the apex_test module does not have one." am: 7fbe3c7f59 am: 82371b5ac2 am: 4971051525 am: 1fb15d2702
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1971344

Change-Id: I994dd16006c857fec39bd44ce355f560f3ba4427
2022-02-10 16:27:46 +00:00
Gurpreet Singh
7deabfacd0 Manifest Fixer Params code refactor
This CL refactors the code related to ManifestFixer parameters.
The required parameters android.ModuleContext, manifest android.Path are
passed separately as the parameters and the optional parameters are
kept as part of the ManifestFixerParams struct.

By default, the member variable of struct have the zero (nil, false,
empty string) values. Hence, it is only required to pass the
parameters of interest at the time of function call to
ManifestFixer.

Manual testing done to check the working of the code.

Test: m nothing && m test_com.android.sdkext
Test: manually tested the generation of AndroidManifest in the out
directory with the testOnly attribute
Test: atest manifest_fixer_test --host
To test the existing unittests are not breaking.

Change-Id: I20cb6c06c57f8fe7811050288bcb03945dc0425b
2022-02-10 13:37:50 +00: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
Gurpreet Singh
a76f874d55 Geneate AndroidManifest file if the apex_test module does not have one.
If the build file contains the apex_test module, but the apex_test
module does not contain the AndroindManifest file, then create the
AndroidManifest file.

In such case, the apexer tool is already generating an AndroidManifest
file. In order to handle the testOnly attribute for apex_test modules, a
--test_only flag is appended to the opt flags.

The apexer tool reads the opt flags and if the --test_only flag is
present then it generate the AndroidManifest file with testOnly
attribute.

Bug: 213310150
Test: m nothing && m test_com.android.sdkext
Test: manually checked the generation of AndroidManifest file in the
unsigned zip file mentioned in the description.
This command allows to read the attribute of the binary xml file -
aapt2 dump xmltree test_com.android.sdkext.apex.unsigned --file
AndroidManifest.xml

Verified the presence of testOnly flag in the output.

Change-Id: Ic47378428b2dba51d73e75d912546c2374f68d57
2022-02-09 16:06:15 +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
Jooyung Han
472be14f26 Merge changes I11693286,I8d79a434
* changes:
  VNDK libs use "unique" APEX variants
  use_vndk_as_stable APEX shouldn't include VNDK lib
2022-02-08 01:03:41 +00:00
TreeHugger Robot
c85d6b4b25 Merge "Clean auto-allowed modules for media mainline" 2022-02-08 00:00:29 +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
Treehugger Robot
cd814286bc Merge "Allow installing boot images outside of APEX for prebuilt." am: 210957500c am: fd08d7e9a5 am: 941eaf9fa1 am: cbe9579d13
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1964908

Change-Id: I85428312f74919580a4c177d637f917cf6211639
2022-02-07 16:47:29 +00:00
Treehugger Robot
210957500c Merge "Allow installing boot images outside of APEX for prebuilt." 2022-02-07 15:58:36 +00:00
Jooyung Han
91f9203af4 VNDK libs use "unique" APEX variants
In case there are two vendor apexes(one with "use_vndk_as_stable:true",
and the other with "use_vndk_as_stable:false") a VNDK lib used by both
will have "APEX" variant and the former APEX will use "apex" variation.

For example,

 apex1(use_vndk_as_stable) -> foo -> libvndk
 apex2 -> bar -> libvndk

Since foo, bar and libvndk are mutated into two APEX variations("",
"apex10000"), foo will use the apex variation of libvndk.

To fix this, VNDK libs can use "unique" APEX variations. Then, in the
above example, foo will have "myapex1" variation and libvndk will have
two APEX variations("" and "apex2"). So foo will link to ""(non-APEX)
variation as fallback.

Bug: 216847402
Test: m nothing (soong tests)
Change-Id: I116932860ef79e22dc338a58b251e3ca693ab4f3
2022-02-04 13:07:14 +09: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
Gurpreet Singh
7286c45a7c Merge "Add testOnly attribute to AndroidManifest file of apex_test" am: ac0a9b00a4 am: dc3ffc8c3a am: 95068d632f am: 00568743ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1959021

Change-Id: I35cbfea1d3411bf8c6a5d05d5aaf09fd5f6073a8
2022-02-01 15:38:57 +00:00
Gurpreet Singh
75d65f360c Add testOnly attribute to AndroidManifest file of apex_test
If the build file contains the apex_test module, add the
testOnly attribute to the application element of the
corresponding AndroidManifest file and set its value to true.
If the testOnly attribute is already present and has value
false, then do nothing.

Tests added in manifest_fixer_test.py to check if the updated
AndroidManifest file has the testOnly attribute set to true or not.

Bug: 213310150
Test: atest --host manifest_fixer_test
Test: m nothing
Test: manually checked the AndroidManifest file generated
Change-Id: I36247dbe0261c342d451a4422c314fd8fe0c2369
2022-02-01 12:03:48 +00:00
Jiakai Zhang
e6e90db00a Allow installing boot images outside of APEX for prebuilt.
This change is similar to aosp/1947127, but for prebuilts.

After this change, if `bootImageConfig.installDirOnDevice` is set to a
path outside of the APEX, the build system will build a boot image from
the dex files and the profile extracted from the prebuilt APEX.
Otherwise, it keeps the current behavior: extracting the boot image from
the prebuilt APEX.

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

Bug: 211973309
Test: m nothing
Test: -
  On internal master:
  1. Patch aosp/1947128.
  2. Patch ag/16743847 and ag/16746804.
  3. m SOONG_CONFIG_art_module_source_build=false com.google.android.art
  4. See the boot image being installed in `/system/framework/<arch>`.
Change-Id: I24ca525309fecaf3ab7a67960fbf118cd00ecd1d
2022-01-28 15:08:06 +00: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
LaMont Jones
5d8246e2c9 Merge "Improve handling of errors from zipinfo" am: b02043b84d am: 4b3afb7798 am: 0bbc2d0229 am: ce2624cf88 am: d0cfac1546
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1790956

Change-Id: Ib60578ead4ccaa7ba09f628a6c9281c0cc70e6ce
Merged-In: Ib60578ead4ccaa7ba09f628a6c9281c0cc70e6ce
(cherry picked from commit c3fc0cdb16)
2022-01-04 12:41:12 +00:00
Treehugger Robot
268c96c081 Merge "Add comments and clarify errors in neverallow" am: 68542bfcb5 am: fee1c91a2e am: a185769983 am: 4712720e76
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874483

Change-Id: I731d083451be54e27fb356b8ba69027162b5b710
2021-12-21 20:44:05 +00:00
Liz Kammer
a3d7915c9e Add comments and clarify errors in neverallow
Sample of new error for violation:

error: system/bt/gd/rust/topshim/macros/Android.bp:10:1: module
"libtopshim_macros" variant "linux_glibc_x86_64": violates neverallow
requirements. Not allowed:
        module types: ["rust_benchmark" "rust_benchmark_host"
"rust_binary" "rust_binary_host" "rust_library" "rust_library_dylib"
"rust_library_rlib" "rust_ffi" "rust_ffi_shared" "rust_ffi_static"
"rust_fuzz" "rust_library_host" "rust_library_host_dylib"
"rust_library_host_rlib" "rust_ffi_host" "rust_ffi_host_shared"
"rust_ffi_host_static" "rust_proc_macro" "rust_test" "rust_test_host"]
      EXCEPT in dirs: ["device/google/cuttlefish/"
"external/adhd/" "external/crosvm/" "external/libchromeos-rs/"
"external/minijail/" "external/rust/" "external/selinux/libselinux/"
"external/uwb/" "external/vm_tools/p9/"
"frameworks/native/libs/binder/rust/" "frameworks/proto_logging/stats/"
"packages/modules/DnsResolver/" "packages/modules/Virtualization/"
"prebuilts/rust/" "system/core/libstats/pull_rust/"
"system/extras/profcollectd/" "system/extras/simpleperf/"
"system/hardware/interfaces/keystore2/" "system/librustutils/"
"system/logging/liblog/" "system/logging/rust/" "system/nfc/"
"system/security/" "system/tools/aidl/"
"tools/security/fuzzing/example_rust_fuzzer/"
"tools/security/fuzzing/orphans/" "vendor/"]

Old error:

error: system/bt/gd/rust/topshim/macros/Android.bp:10:1: module
"libtopshim_macros" variant "linux_glibc_x86_64": neverallow
-dir:device/google/cuttlefish/* -dir:external/adhd/*
-dir:external/crosvm/* -dir:external/libchromeos-rs/*
-dir:external/minijail/* -dir:external/rust/*
-dir:external/selinux/libselinux/* -dir:external/uwb/*
-dir:external/vm_tools/p9/* -dir:frameworks/native/libs/binder/rust/*
-dir:frameworks/proto_logging/stats/*
-dir:packages/modules/DnsResolver/*
-dir:packages/modules/Virtualization/* -dir:prebuilts/rust/*
-dir:system/core/libstats/pull_rust/* -dir:system/extras/profcollectd/*
-dir:system/extras/simpleperf/*
-dir:system/hardware/interfaces/keystore2/* -dir:system/librustutils/*
-dir:system/logging/liblog/* -dir:system/logging/rust/*
-dir:system/nfc/* -dir:system/security/* -dir:system/tools/aidl/*
-dir:tools/security/fuzzing/example_rust_fuzzer/*
-dir:tools/security/fuzzing/orphans/* -dir:vendor/*
type:"rust_benchmark" type:"rust_benchmark_host type:rust_binary
type:rust_binary_host type:rust_library type:rust_library_dylib
type:rust_library_rlib type:rust_ffi type:rust_ffi_shared
type:rust_ffi_static type:rust_fuzz type:rust_library_host
type:rust_library_host_dylib type:rust_library_host_rlib
type:rust_ffi_host type:rust_ffi_host_shared type:rust_ffi_host_static
type:rust_proc_macro type:rust_test type:rust_test_host

Test: go test soong tests
Change-Id: I1a7ee6bbc8258dfffa5a76f02c12fb1e54fdba1a
2021-12-21 12:00:43 -05:00
Jiakai Zhang
31d2c1f14c Merge changes I8f4eaed1,I358a62d3 am: 880e11112d am: 02d1c10b3a am: 58fe40abc1 am: 3a3250f40e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1928068

Change-Id: Ie325fa547912fd6618a50b463f40b7a1028047e1
2021-12-20 21:36:09 +00:00
Jiakai Zhang
880e11112d Merge changes I8f4eaed1,I358a62d3
* changes:
  Dexpreopt standalone system server jars from prebuilts.
  Dexpreopt standalone system server jars.
2021-12-20 19:52:37 +00:00
Jiakai Zhang
28bc9a8a7e Dexpreopt standalone system server jars from prebuilts.
This change adds support for dexpreopting standalone system server
jars from prebuilts.

Bug: 203198541
Test: -
  1. Add a standalone system server jar (e.g., by patching
     aosp/1906158)
  2. Build and drop a module SDK and an APEX.
  3. Build a system image from prebuilts.
  4. See the odex and vdex files generated in
     $ANDROID_PRODUCT_OUT/system/framework/oat/
Change-Id: I8f4eaed10a1053cd560b8583efa12dc495f58db1
2021-12-20 15:48:20 +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
Jiakai Zhang
0648a6aa05 Merge "Test that DisableGenerateProfile takes effects for APEXes." am: 5f496eed0a am: 9fdc009e7a am: 49af95975f am: e1e0972ea5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918607

Change-Id: Id34b71dcbfd666c992a890cecbbc9dd5d7c78b86
2021-12-16 21:04:06 +00:00
Etienne Ruffieux
a447c0973b Merge "Renamed bluetooth apex name to com.android.bluetooth" 2021-12-16 18:10:45 +00:00
Jiakai Zhang
5f496eed0a Merge "Test that DisableGenerateProfile takes effects for APEXes." 2021-12-16 14:50:51 +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
Martin Stjernholm
1b4dfd420e Merge "Remove the compat symlinks to ART binaries." am: 12cba52e4f am: dbb7391e35 am: 790e07602a am: bca53a2978
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1921457

Change-Id: Ie74ba40cb8eaceab84c62d87f8f5ae9ba5bee048
2021-12-15 11:08:21 +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
Martin Stjernholm
12cba52e4f Merge "Remove the compat symlinks to ART binaries." 2021-12-15 10:07:18 +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
Jiyong Park
1b0893eeba Build canned_fs_config using RuleBuilder
... in preparation for adding the support for custom canned fs config

Bug: 209971551
Test: m nothing
Change-Id: I7f2576ff99c65bdb6c9ce4ace61bc783eea2f0d4
2021-12-15 09:11:08 +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
Martin Stjernholm
0291abca62 Remove the compat symlinks to ART binaries.
App compact impact is hard to judge (see http://b/124106384#comment9
ff), so this tries it early in the dessert cycle.

This is also a workaround for b/209867137 where the symlink install
rules interact badly with the artifact_path_requirements.mk check.

Test: m installclean && m droid
  verify that $(PRODUCT_DIR)/system/bin doesn't have dalvikvm and
  dex2oat symlinks
Bug: 124106384
Bug: 209867137
Change-Id: I044fb40f656beeb7c6e61f1d418fa13f56714a70
2021-12-14 17:56:26 +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
Jiakai Zhang
7d3c9e0b5f Test that DisableGenerateProfile takes effects for APEXes.
Bug: 209630530
Test: m nothing
Change-Id: I5953f36e219ba63f8a01fa5dc60456db35eef5ac
2021-12-14 10:55:12 +00:00
Sophie Zheng
3ff621ed60 Merge "NDK API coverage" into sc-mainline-prod 2021-12-13 18:36:55 +00:00
Martin Stjernholm
78cb7356de Merge "Do not allow duplicate deapexer dependencies." am: d7c3fc0ae0 am: 49df6778ca am: 6bec093e48 am: 67cbe36b4a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1752641

Change-Id: Ibb5bf70395113d8614c6deec16ed68840e82994b
2021-12-13 17:09:02 +00:00
Martin Stjernholm
d7c3fc0ae0 Merge "Do not allow duplicate deapexer dependencies." 2021-12-13 15:52:19 +00:00
Jingwen Chen
b9b1c18cda Merge "bp2build: Fix apex.binaries to be a LabelListAttribute." am: 8d0bd355fd am: d6b0aab0cd am: ed10ce524f am: 825f5eb8a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1913474

Change-Id: I63b7ebb53243bcc0ba2b822421221a81c6744462
2021-12-13 11:21:27 +00:00
Jingwen Chen
8d0bd355fd Merge "bp2build: Fix apex.binaries to be a LabelListAttribute." 2021-12-13 10:03:50 +00:00
Colin Cross
bce7bacea8 Revert^2 "Build license metadata files in Soong" am: 4acaea9cbf am: d8395b1b2f am: c6d7cae3ca am: f3a84bc1a6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918948

Change-Id: I39f8e358355aafc79e135adecb8b4c8e082b036c
2021-12-11 04:51:58 +00:00
Colin Cross
d8395b1b2f Revert^2 "Build license metadata files in Soong" am: 4acaea9cbf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918948

Change-Id: I8682f46f7843e0d367b96a09135dad03e3df934c
2021-12-11 03:48:25 +00:00
Treehugger Robot
f4c2bf6559 Merge changes from topic "revert-1918946-revert-1899703-AMWIVCREEV-CCTEXIRRRV"
* changes:
  Revert^2 "Add dependency license annotations"
  Revert^2 "Build license metadata files in Soong"
2021-12-11 03:32:18 +00:00
sophiez
8c6937c6ba NDK API coverage
Fixed typo in dist path for backed by.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Ic67c0bd5644dec11829f0dc2535016fec788a067
Merged-In: Ic67c0bd5644dec11829f0dc2535016fec788a067
Bug: b/210034014
2021-12-11 01:16:42 +00:00
Colin Cross
b756f61589 Merge changes from topic "revert-1899703-AMWIVCREEV" am: 67938c2925 am: 34ca826598 am: 5400ba36b5 am: 9d9dc0a0a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918944

Change-Id: I8eee11e7acbb0da80b2ddeffd14e50c1b4540ac3
2021-12-11 00:28:43 +00:00
Colin Cross
4acaea9cbf Revert^2 "Build license metadata files in Soong"
b3264f2090

Change-Id: I5ea5f7e29eb1dbc72b8b30f010006a25f5f72fac
2021-12-10 23:05:02 +00:00
Colin Cross
67938c2925 Merge changes from topic "revert-1899703-AMWIVCREEV"
* changes:
  Revert "Build license metadata files in Soong"
  Revert "Add dependency license annotations"
2021-12-10 23:04:45 +00:00
Colin Cross
b3264f2090 Revert "Build license metadata files in Soong"
Revert submission 1899703

Reason for revert: b/210158272
Reverted Changes:
I142c19284:Reuse license metadata files from Soong
Ife89b8f23:Add dependency license annotations
I8e7410837:Build license metadata files in Soong

Change-Id: I48f2bf2e2797ac9d38f7ece35ba616b823035607
2021-12-10 23:02:57 +00:00
Colin Cross
d9b928c776 Build license metadata files in Soong am: 3dd2ff28ed am: 05ff6289c2 am: a25d6989dc am: 2904cf5cfc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899702

Change-Id: I35fabcb7e7210fc0e0f55c2db4f73a716561db66
2021-12-10 23:02:00 +00:00
Colin Cross
05ff6289c2 Build license metadata files in Soong am: 3dd2ff28ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899702

Change-Id: I96620d254f43dd9e8cfe02d1ed1dbc201c9cd381
2021-12-10 22:04:43 +00:00
Colin Cross
b435744fdc Merge changes from topic "soong-license-metadata"
* changes:
  Add dependency license annotations
  Build license metadata files in Soong
  Escape Host*Variable contents
2021-12-10 21:43:49 +00:00
Remi NGUYEN VAN
efb49afc8a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

(clean cherry-pick)

Bug: 208773835
Change-Id: Ib41ab443e36a694e3fac5f2ab0acabb3009f40a9
Test: m (runs apex tests)
Merged-In: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-10 10:52:01 +00:00
Remi NGUYEN VAN
e27821b48e Merge "Relax apex package restriction for T+ jars" am: 4d5cd1f267 am: b68677917b am: 5d704c695e am: 4f2a9cb427
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908871

Change-Id: I46dc567ed74ff40e45418bffd128e6301ae7acf0
2021-12-10 01:34:41 +00:00
Remi NGUYEN VAN
4d5cd1f267 Merge "Relax apex package restriction for T+ jars" 2021-12-10 00:15:17 +00:00
Colin Cross
6305dfbeac Merge "Set prebuiltCommon.installedFile for apex_set modules" am: 3c48297dde am: 8211f7f7b8 am: 3e21b79432 am: 10ae7770c7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915701

Change-Id: Ic9a9aebe1279986c4195bdf68771ab33afbcb7d1
2021-12-09 19:43:11 +00:00
TreeHugger Robot
aa7b36e681 Merge changes from topics "presubmit-am-0a046d9514b34cc1a3b2b3584e857f6c", "presubmit-am-22410ea0b46e4a3d961d51518c65514d", "presubmit-am-2646dd78e751450296e76a7e6fac60eb", "presubmit-am-2762d254a366481180c66eefcb7b8c53", "presubmit-am-36ef44194069468da39e59065e3b9d39", "presubmit-am-6e59a6b21a5047bd940a9bff59c79228", "presubmit-am-855c4e732f2645568065c3c870ecd0da", "presubmit-am-dae9703bfd65425b8b44605c42e9d5b9" into sc-mainline-prod
* changes:
  Allow java_sdk_library in an APEX to have higher min_sdk_version.
  Perform CheckMinSdkVersion for java_sdk_library.
  Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
  Add ModuleWithMinSdkVersionCheck type.
  Use textproto format for classpaths.proto generation.
  Propagate min and max sdk versions to classpaths.proto configs.
  Introduce max_sdk_version device property.
  Test SdkSpecForm.
2021-12-09 15:54:26 +00:00
satayev
812683ec25 Allow java_sdk_library in an APEX to have higher min_sdk_version.
Inidividual boot or system server jars may have higher min_sdk_version
than the contianing apex, since the runtime respects the values of
min/max_sdk_version; e.g. runtime would not load a boot jar with
higher min_sdk_version. This allows shipping new boot jars via apexes
that target older platforms.

Bug: 190818041
Test: presubmit
Change-Id: I08ec0b4463a17bc8265b948fe09da55eb4e52ac3
Merged-In: I08ec0b4463a17bc8265b948fe09da55eb4e52ac3
(cherry picked from commit 758968a700)
2021-12-09 14:35:32 +00:00
satayev
477a7baa79 Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
Merged-In: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
(cherry picked from commit ad99149a62)
2021-12-09 14:35:32 +00:00
satayev
cb0977f67e Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
Merged-In: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
(cherry picked from commit b3fd411465)
2021-12-09 14:35:32 +00:00
Remi NGUYEN VAN
1fdd6ca88a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

Bug: 208773835
Test: m (runs apex tests)
Change-Id: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-09 18:28:47 +09:00
Colin Cross
730e3f6139 Set prebuiltCommon.installedFile for apex_set modules
apex_set modules failed to set prebuiltCommon.installedFile, which
caused LOCAL_SOONG_INSTALLED_MODULE to be empty and base_rules.mk
to create a duplicate install rule.  Set it to the path to the
apex file installed by Soong.

Bug: 204136549
Bug: 209867137
Test: m SOONG_CONFIG_art_module_source_build=false
Change-Id: Ia7fec09598823343242ebd44f1732e6bba21d027
2021-12-09 05:24:15 +00:00
Dan Willemsen
d98c144f21 Merge "Add Darwin x86_64+arm64 universal binary support" am: ce69757379 am: 1bd7543d6e am: b2a6b903fb am: 4d913d8528
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1884611

Change-Id: I0b2e79c1ea2c2889c859fbbcd4ffb964531cf046
2021-12-09 00:04:21 +00:00
Treehugger Robot
a548a1c1c5 Merge changes I08ec0b44,I79b5a1fc,I469d6558 am: 6abfb33784 am: 3bcefabfeb am: dc2accaba0 am: a0b46c1d06
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907862

Change-Id: I0ffda740f28a4f1309fae0be43f40904ef4f2168
2021-12-09 00:03:32 +00:00
Colin Cross
3dd2ff28ed Build license metadata files in Soong
Soong has enough information to build the license metadata files
without resorting to the fixups required in Make.

Bug: 207445310
Test: m checkbuild
Change-Id: I8e74108376162b8fdb87ba098ebe94350aa1f7c4
2021-12-08 15:08:59 -08:00
Dan Willemsen
ce69757379 Merge "Add Darwin x86_64+arm64 universal binary support" 2021-12-08 21:08:43 +00:00
satayev
758968a700 Allow java_sdk_library in an APEX to have higher min_sdk_version.
Inidividual boot or system server jars may have higher min_sdk_version
than the contianing apex, since the runtime respects the values of
min/max_sdk_version; e.g. runtime would not load a boot jar with
higher min_sdk_version. This allows shipping new boot jars via apexes
that target older platforms.

Bug: 190818041
Test: presubmit
Change-Id: I08ec0b4463a17bc8265b948fe09da55eb4e52ac3
2021-12-08 11:36:34 +00:00
satayev
ad99149a62 Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
2021-12-08 11:36:31 +00:00
Jingwen Chen
b07c901e0d bp2build: Fix apex.binaries to be a LabelListAttribute.
apex.binaries accepts a list of module names, which should be resolved to
their fully qualified labels. Bazel treats string_list and label_list
attributes differently, most notably with the latter adding dependency edges.

Test: apex_conversion_test.go
Bug: 209743852
Change-Id: Iafdc5c728e8658cce0e99d42f32e7bb6fe2f3168
2021-12-08 10:10:19 +00:00
sophiez
2965f45751 Java APIs used by Mainline modules.
Add scripts to generate java APIs used by Mainline modules. This is
aosp/1879177 with fixed build error that caused by dexdeps analyzing
resource only APKs which doesn't contains any .dex files. Now skip the
error generates in that case in gen_java_usedby_apex.sh

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: Id539cbe1b7306ace69c047f95ffc02265a467511
Merged-In: Id539cbe1b7306ace69c047f95ffc02265a467511
2021-12-08 07:35:37 +00:00
Dan Willemsen
4745007bb1 Add Darwin x86_64+arm64 universal binary support
This is configured from Make by setting up Darwin+Arm64 as a HOST_CROSS
target (which is largely true, as binaries can't be executed on X86_64
machines). On the Soong side, it's a bit blurier, as we don't current
have any other users that are the same OS but not natively executable
(Linux/musl is executable, Windows/x86 is a different OS).

Instead of requiring cc_binary/etc to become multi-architecture-aware
and using something like common_first/MultiTarget, this defaults all
non-multi-architecture-aware modules to be built with both
architectures. It then adds a dependency with the
DarwinUniversalVariantTag so that supporting modules can get the outputs
of the other variant.

Cc uses that dependency tag to run lipo on shared libraries and binaries
so that the output of the x86_64 variant is actually a fat binary
including both architectures.

Bug: 203607969
Test: build sdk-repo targets on a Mac
Change-Id: Icbddb0a177c0ba19d3e0d11f8cf568e0d1ea3245
2021-12-07 22:01:25 -08:00
Martin Stjernholm
43c44b00d6 Do not allow duplicate deapexer dependencies.
Without these errors, the last encountered deapexer would silently be
used. However with PRODUCT_INSTALL_APEXES there will only be deapexer
for installable APEXes, and we can assume only a single installable
APEX exists for each APEX variant, so make it an error if it isn't the
case.

Corresponding to http://ag/15156931.

Test: m nothing SOONG_CONFIG_art_module_source_build=true
Test: m nothing SOONG_CONFIG_art_module_source_build=false
Test: m nothing SOONG_CONFIG_art_module_source_build=false
  with installable:true for the com.android.art.debug prebuilt APEX -
  check that it fails with an "ambiguous duplicate deapexer" error
Bug: 192006406
Bug: 192542393
Change-Id: I44566fd26b12f82a8a67fe4a69e56303460756d0
2021-12-07 23:30:30 +00:00
Jiakai Zhang
204d111865 Merge "Add ART boot image profile to the ART APEX." am: e6f63be764 am: 255734a03a am: c0adf3ba1c am: 5195a30de9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1904290

Change-Id: I9ceaeca0de9f290a41ba416eb862b7be147cb874
2021-12-07 16:29:34 +00:00
Jiakai Zhang
e6f63be764 Merge "Add ART boot image profile to the ART APEX." 2021-12-07 15:22:37 +00:00
Artur Satayev
6e8071d17a Merge "Add ModuleWithMinSdkVersionCheck type." am: a4fc08d204 am: 25f5783263 am: fe55ffd190 am: 44d0ef55da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907860

Change-Id: I147da371d445f09ca2f131df1be91545eba37772
2021-12-06 18:09:34 +00:00
satayev
b3fd411465 Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
2021-12-06 12:05:48 +00:00
Jiyong Park
a119a182bd Merge "Add future_updatable to the apex module" am: 103d511117 am: 88589cf238 am: 82a851b155 am: d0ce5a0925
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1904291

Change-Id: I83e1efce2f1464a30eb3bad406ce4d96dd419630
2021-12-06 10:58:43 +00:00
Jiyong Park
f402058d2c Add future_updatable to the apex module
The new property is used to mimic some of the build behaviors that
currently are applied only when an APEX is `updatable: true`. This
property is helpful to minimize the sudden impact (e.g. change in size)
when an APEX becomes updatable.

Currently, the behavior that this property mimics is the disabling of
the size optimization.

Bug: 207336449
Test: m
Change-Id: I500306afa1221625fda3e89a8d12d5d341791a1f
2021-12-06 02:18:13 +00:00
Jiakai Zhang
49b1eb6b04 Add ART boot image profile to the ART APEX.
We will need the profile when we generate the primary boot image on
device.

Bug: 203492478
Test: Run `banchan com.android.art x86_64 && m` and see
  `$ANDROID_PRODUCT_OUT/apex/com.android.art/etc/boot-image.prof`.
Test: Run `lunch aosp_cf_x86_64_phone-userdebug && m` and see both
  `$ANDROID_PRODUCT_OUT/apex/com.android.art/etc/boot-image.prof` and
  `$ANDROID_PRODUCT_OUT/system/etc/boot-image.prof`, in different
  sizes.
Test: Start Cuttlefish with the built image and see both
  `/apex/com.android.art/etc/boot-image.prof` and
  `/system/etc/boot-image.prof` on device.
Change-Id: Id879dc49b234133dfbb9563814328661a1f4a6c0
2021-12-03 20:02:10 +00:00
Daniel Norman
6879cf5c53 Merge "Forbid updatable: true on vendor APEXes." am: 7260025670 am: c046926ac5 am: ab360daa03 am: 917cdf20b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908986

Change-Id: Ic4df53e320891a24c5798f897ce10db8caec778a
2021-12-03 19:07:56 +00:00
Daniel Norman
6910911c64 Forbid updatable: true on vendor APEXes.
Vendor APEXes do not formally support updates outside of the main OTA
process. We should clarify this at build time.

Test: set vendor apex to updatable, observe failure
Test: apex_test.go
Change-Id: Ife8d242a42415ebf00d7dced72c07cda1fde1839
2021-12-02 12:53:12 -08:00
Liz Kammer
01cebf606b Merge "Support empty strings in bp2build" am: a9351ef6e6 am: 7cb87525ef am: 3044f94f32 am: 8ac1619830
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907331

Change-Id: I510c1b3e833a4d279fea7e2a34d125b6c5e6842d
2021-12-02 17:27:12 +00:00
Liz Kammer
a9351ef6e6 Merge "Support empty strings in bp2build" 2021-12-02 15:35:10 +00:00
Treehugger Robot
1e168fece0 Merge "Add Sh_binaries property" am: abd43ec406 am: eea12c1be9 am: e5d333f7e1 am: 9839c0cf56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899131

Change-Id: Iff3cdfe7c26af27ddb46adbacdc73f0fc82e6b90
2021-12-02 02:18:03 +00:00
Treehugger Robot
abd43ec406 Merge "Add Sh_binaries property" 2021-12-02 00:52:23 +00:00
Benjamin Brittain
aedf01bd62 Merge "Add support for Rust JNI Libraries" am: 7c721018bb am: 9915e2dfc6 am: f842076481 am: 66ddbf9e23
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1906713

Change-Id: I399a929010ecc54ea62542f5d64c2d279aec2dc9
2021-12-01 15:36:45 +00:00
Liz Kammer
46fb7aba4d Support empty strings in bp2build
Previously, could not set an empty string as a value of an attribute;
however, this is necessary in some cases. To not unnecessarily create an
empty string, use string pointers for attributes rather than strings.

Test: go test bp2build tests
Change-Id: I03b3a3567452d455246d22d81f86c317d06b7c39
2021-12-01 10:14:49 -05:00
Benjamin Brittain
7c721018bb Merge "Add support for Rust JNI Libraries" 2021-12-01 14:12:34 +00:00
Jiakai Zhang
c9ff3dc68a Merge "Add entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb" am: 2258b889bf am: 1d7dad1f09 am: 0cb50b1036 am: 33ea009498
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1876173

Change-Id: I9c1f63b38f151fface4001dd98800488b91e6926
2021-12-01 13:13:19 +00:00
Benjamin Brittain
9edc375a06 Add support for Rust JNI Libraries
Test: Verified Rust JNI lib is in apex

Change-Id: Icb013d7b2f4c5d8ec009ea4937185689cc0cac16
2021-11-30 13:38:15 -05:00
Jiakai Zhang
cee9e19a51 Add entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb
This CL updates platform_systemserverclasspath,
systemserverclasspath_fragment, and
prebuilt_systemserverclasspath_fragment to write entries for
STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb. A new property
`standalone_contents` is aded to `systemserverclasspath_fragment` and
`prebuilt_systemserverclasspath_fragment` to list the standalone system
server jars in the APEX, and entries will be written to
systemserverclasspath.pb accordingly at build time.

To add more context, these entries will be consumed by derive_classpath
in order to generate an environment variable
PRODUCT_STANDALONE_SYSTEM_SERVER_JARS. The environment variable will
then be comsumed by odrefresh to determine what jars to preopt on early
boot.

Note that the variable should not end with "CLASSPATH" because the list
is not used by runtime as a classpath. It is just a colon-separated list
of jars. System server loads the jars separately with paths hardcoded in
the code.

Bug: 203198541
Test: manual -
  1. Add some jars to PRODUCT_STANDALONE_SYSTEM_SERVER_JARS
  2. Add some other jars to PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
     and standalone_contents.
  3. Build an image.
  4. Flash the image to a device.
  5. adb shell echo \$STANDALONE_SYSTEMSERVER_JARS
  6. See the correct list of jars.
Change-Id: I09a6fd1d3db85c194330da9b751702a9bf069e26
2021-11-30 10:51:10 +00:00
Sundong Ahn
80c04891de Add Sh_binaries property
The sh_binary module is not supported the vendor variant. So, even if
there is "vendor: true" in sh_binary module, the image variant is
"image:" instead of "image:vendor.Tiramisu".
But the vendor APEX has vendor variant, so vendor APEX module and
sh_binary module have different variants and the sh_binary cannot be
added to vendor apex.
So the Sh_binaries property is added, and the image variant is removed
at DepsMutator.

Bug: 205065320
Test: make -j40 && sh_binary is added to vendor APEX && install check
Change-Id: I30e2d96a73b45e7b06eff24550542cb010008c41
2021-11-25 03:43:57 +00:00
Pedro Loureiro
c362142438 Perform validation of shared library attributes
Perform consistency checks as per http://go/updatable-shared-libraries

These include:
  * no attribute can specified can be less than T
  * max-device-sdk can't be less than min-device-sdk
  * min and max-device-sdk need to be at least the module's
  min_sdk_version
  * using on-bootclasspath-before implies that the module's
  min_sdk_version is at least T or the library has min-device-sdk of at
  least T

Test: m nothing

Bug: 191978330

Change-Id: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
Merged-In: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
(cherry picked from commit f9e584dd20)
2021-11-24 17:09:19 +00:00
Pedro Loureiro
9956e5e281 Add support for new permissions library tag attributes
We are expanding PackageManager's supported attributes and this change
enables the developer to define them in the .bp file.

Test: m nothing

Bug: 191978330

Change-Id: I01d579190fb585662086a7fc456f3b33cb89fb57
Merged-In: I01d579190fb585662086a7fc456f3b33cb89fb57
(cherry picked from commit 826863c8e0)
2021-11-24 17:09:18 +00:00
Martin Stjernholm
93f5a8d1a7 Don't pass ":=" in variable name to AndroidMkEntries.SetString. am: ae44fd8032 am: 7263046919 am: 471116c036 am: 3514941226
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1900777

Change-Id: I4f5bd0b59f06a2dee68fd6e7b25a34081a902e75
2021-11-24 03:39:52 +00:00
Martin Stjernholm
ae44fd8032 Don't pass ":=" in variable name to AndroidMkEntries.SetString.
Fixes typos in https://r.android.com/1897972.

Test: m SOONG_CONFIG_art_module_source_build=false nothing
Bug: 204136549
Change-Id: I768c21bc99bfb4978fcf7f4f3631eef866e76764
2021-11-23 23:17:33 +00:00
Sophie Zheng
a42e367be8 Merge "NDK API coverage" am: 1469ff6ece am: 0ea8eee571 am: b2e9e69499 am: 6e6b076f1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899591

Change-Id: I63ab3eceda65c2f6bab1edac83269c243ec9d59d
2021-11-23 18:50:17 +00:00
Sophie Zheng
1469ff6ece Merge "NDK API coverage" 2021-11-23 17:38:08 +00:00
Jooyung Han
09925634f5 Remove libsync from apex_available allowlist am: 9876c5eaab am: 6f323db66b am: 57440917f1 am: 7fb5afdd2a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899132

Change-Id: I3b0ae777ef2584d2fe7b8f07bd94b5da3cca9536
2021-11-23 04:51:12 +00:00
Jooyung Han
9876c5eaab Remove libsync from apex_available allowlist
As libsync is NDK/LLNDK, it doesn't need to be aded to allowlist as
apex_available.

Bug: n/a
Test: m
Change-Id: I16cfb258a24bde4def428f1e6277f5d3c95c228c
2021-11-23 11:06:16 +09:00
sophiez
3691097ba9 NDK API coverage
Fixed typo in dist path for backed by.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Ic67c0bd5644dec11829f0dc2535016fec788a067
2021-11-22 11:49:49 -08:00
Colin Cross
cf96429713 Merge "Move apex module installation into Soong" am: ab6db81276 am: a0c4b45669 am: e5046710c6 am: 4431bebf1f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1897972

Change-Id: Ib5501953f604920391965150fe0f67d1c6fa4502
2021-11-22 18:29:50 +00:00
Colin Cross
de6cbce98f Merge "Revert "Move apex module installation into Soong"" am: 500bba1b20 am: d4ce0c64f5 am: 85d3c93a85 am: 834649db81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1897971

Change-Id: I9551b9160616b509f7a3b609f3bf7f9530f13d94
2021-11-20 02:45:58 +00:00
Colin Cross
377f028841 Merge "Move apex module installation into Soong" am: 50f6f869a2 am: a3675380c6 am: 0cc52a39ba am: 0118e502de
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1896051

Change-Id: I312ee4233409590097b4461ded2cc6846fb15d03
2021-11-20 02:44:38 +00:00
Colin Cross
6340ea50d4 Move apex module installation into Soong
Move apex module installation rules into Soong by overriding
InstallBypassMake.

Soong installs don't support post install commands, so move the
symlinks into separate rules and add dependencies on them.

This relands If65d283abc86f18ad266da0bf16fe95971a0bf9c with fixes
to install files into $OUT/apex and I606286e971b55d9d1fc4dcd0fbd476962de5fa79
with a fix for reversed logic.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie65c53ebc7911efacdb8e11ba49059448f03c658
2021-11-19 13:37:36 -08:00