Commit graph

3445 commits

Author SHA1 Message Date
Kiyoung Kim
f97a42e5f2 Merge "APEXes contain VNDK libraries when VNDK is deprecated" into main 2023-07-27 01:24:53 +00:00
Kiyoung Kim
8269cee6e2 APEXes contain VNDK libraries when VNDK is deprecated
Currently vendor APEX can link to VNDK when 'use_vndk_as_stable'
property is set as true. However, when VNDK is deprecated, all former
VNDK libraries should be included in the vendor APEX despite of property
value. This change ignores use_vndk_as_stable when VNDK is set as
deprecated.

Bug: 290318998
Test: aosp_cf_x86_64_phone with WITH_VNDK=false build checked that
Vendor APEX contains all required VNDK libraries within the APEX

Change-Id: I648277d734274e7852b3effc24e7780e55089f75
2023-07-26 13:23:35 +09:00
Elliott Hughes
575451d111 Merge "Remove a bunch of stuff from the libc allowlist." into main 2023-07-25 18:45:08 +00:00
Sam Delmerico
419f9a3802 add override_apex to version_variant test
Bug: 285138555
Test: go test ./apex
Change-Id: I973156325cc396eb6d32be3d08ea6154b722d925
2023-07-21 12:00:13 -04:00
Elliott Hughes
c9642681bd Remove a bunch of stuff from the libc allowlist.
bionic/libc/Android.bp explicitly declares this now.

Test: treehugger
Change-Id: I88b54c45842bdf34449cdbbcaa9cb3c2774b8b6c
2023-07-20 21:10:31 +00:00
Ivan Lozano
87987fd058 Merge "rust: Add vendor and recovery dylib support." into main 2023-07-18 13:08:08 +00:00
Ivan Lozano
add122a828 rust: Add vendor and recovery dylib support.
Adds dylib support for vendor and recovery images.

This changes the default linkage for vendor and recovery images to
dylib, which matches the platform default linkage. This also means that
by default, dylib-std variants are used for rlib dependencies.

Bug: 204303985
Test: Soong tests.
Test: m dist vendor-snapshot
Test: RECOVERY_SNAPSHOT_VERSION=current m dist recovery-snapshot
Change-Id: If84074b8615a70c45e7e162abeb853dc8c34d49a
2023-07-14 12:43:09 -04:00
Jiakai Zhang
556bdf8e96 Add a Make variable to determine ART boot image jars for testing.
Bug: 290583827
Test: m nothing
Change-Id: I6eb0c83dd14682905ebaf3af55171856300eb2e3
2023-07-14 12:13:30 +01:00
Jiakai Zhang
cb13b5d1bd Refactor dexpreopt for boot jars to make it flexible to config changes.
In the past, dexpreopt for boot jars was very inflexible, and it was
incredibly hard to make a change that is as simple as adding a jar to a
boot image. Boot image generation was handled by
"platform_bootclasspath" and "bootclasspath_fragment" separately. This
caused not only code duplication but also the inflexiblity as such a
design did not fit today's use cases, where a boot image may take jars
from multiple mainline modules and the platform, and a mainline module
can contribute to multiple boot images. The design casued a huge
maintenance burden as any change to the boot image cost multi-week
efforts.

In recent years, efforts have been made to improve this a bit by a bit.
This change is another step towards making dexpreopt reasonable.

After this change, all boot images are generated by "dex_bootjars",
which is in build/soong and is therefore available on both the full
source tree and the thin manifest (master-art). The change decouples
profile generation/extraction from boot image generation. Profiles for
mainline modules are still handled by "bootclasspath_fragment"
because they need to be packed into APEXes when building mainline
modules and extracted from APEXes whem building the system image from
prebuilt modules. Boot images are not handled by
"bootclasspath_fragment" anymore.

Bug: 290583827
Test: m (all existing tests are still passing)
Test: Manually checked that the boot images are exactly the same as
  before.
Change-Id: Ib5a5f401bee334ffcab5c26618e0c8888b84575a
2023-07-14 12:13:28 +01:00
Jiakai Zhang
3444e561dc Change the profile path on host.
This is to decouple profile generation from image configs. A boot image
profile is either for a mainline module or for the platform, which is
orthogonal to boot images.

Bug: 290583827
Test: m nothing
Change-Id: I0918f2fa945a2af1839f1a08ecede331c64d0317
2023-07-11 17:59:24 +01:00
Jiakai Zhang
f7f782c4f1 Remove Modules() from BootclasspathFragmentApexContentInfo.
The Modules() method was for the ART boot image in the ART APEX. It's no
longer needed because we don't install the ART boot image in the ART
APEX anymore.

Bug: 290583827
Test: m nothing
Change-Id: I674a5fa1ed18908413a64129df5947c7d26e638e
2023-07-11 15:29:17 +01:00
Jiakai Zhang
b69e89559f Fix some tests for dexpreopt and remove unnecessary tests.
This CL is to prepare for the changes in http://r.android.com/2652081.
See the description of that CL for the reasons.

Some tests were set up in a fragile way and were easy to be broken when
the implementation changes. This CL is a pure test change that fixes
them.

This CL also removes TestNoUpdatableJarsInBootImage. That test checks
what should go to the ART boot image and what should go to the
platform one, which does not apply today because boot images are not
associated with mainline modules anymore: a boot image may take jars
from multiple mainline modules and the platform, and a mainline module
can contribute to multiple boot images. In practice, we have ART jars in
the platform boot image, and we are going to add core-icu4j and
consrypt to the ART boot image, which is now for testing only.

Bug: 290583827
Test: m nothing
Change-Id: I22c45cbf6f853b030b68edb51197854e9c53a02e
2023-07-11 15:29:12 +01:00
Jooyung Han
eec1b3fe26 Remove "flattened" apexes
Now soong doesn't build "flattened" apexes.

Bug: 279835185
Test: m nothing (soong tests)
Test: m && launch_cvd (cuttlefish)
Change-Id: Id3c540ece1a15cecacc185da9aa17285edd2f493
2023-06-21 14:29:26 +09:00
Jooyung Han
eeeda8a94c Remove PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES
We will deprecate flattened apexes. In this change, GSI-specific make
variable (PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES) is removed. The
variable was used to install both image/flattened apexes in the GSI, so
that it works on ro.apex.updatable devices and not-updatable devices.

Now, GSI will have only image APEXes in it.

Bug: 278826656
Test: lunch gsi_arm64-userdebug && m # no flattened apexes
Change-Id: Ie5fe505b9f2a6a1687252513788fd3e16bc147c5
2023-06-20 14:31:39 +09:00
Jooyung Han
6c762092ee Remove --blkid_path argument
deapexer doesn't need it.

Bug: 279858383
Test: presubmit
Test: m MODULE_BUILD_FROM_SOURCE=false droid
Change-Id: Ie8311c74682f366cf6aeebb669500d01675cd0bf
2023-06-14 15:23:03 +09:00
Jooyung Han
4137756d2d Merge "vendor apex: label apex_manifest as vendor_apex_metadata_file" 2023-06-07 23:59:59 +00:00
Sam Delmerico
1ef69c75fb Merge "update docs for apex_available_name" 2023-06-06 21:16:06 +00:00
Sam Delmerico
c3df113402 update docs for apex_available_name
Bug: 285138555
Change-Id: Ib987ac7a4995e69cbdbfc77adbf8d2b835e15cc2
2023-06-06 12:14:23 -04:00
Sam Delmerico
743b4c5a9b add variant_version to bp2build apex converter
Bug: 285138555
Test: b build //build/bazel/examples/... --config=android
Test: b test //build/bazel/tests/... --config=android
Change-Id: I7350930d48ccd13e96bdb4f994f47071a0dde70f
2023-06-06 12:09:28 -04:00
Sam Delmerico
e91698af9f add apex_available_name to bp2build apex converter
Bug: 285138555
Test: b build //build/bazel/examples/... --config=android
Test: b test //build/bazel/tests/... --config=android
Change-Id: I11372cbc01b89d530a35f90375ca6fa87834edd2
2023-06-06 12:08:56 -04:00
Sam Delmerico
6d65a0fc3d add variant_version property to apexBundle
This property allows modifying the variant version that is put into the
APEX manifest.

Bug: 285138555
Change-Id: I42b8c0ddad8822a0a329e99ec4ec62f8c3546ee9
2023-06-06 11:14:40 -04:00
Sam Delmerico
ca81653730 add apex_available_name property to apexBundle
This property allows developers to create multiple modules that provide
the same APEX implemenation with some differences. For example, an APEX
that targets the current SDK can be developed alongside an APEX that
targets a pre-S SDK. Common dependencies of these APEX modules can both
use the value of the apex_available_name property in their
apex_available lists and be packaged in either APEX module.

Bug: 285138555
Change-Id: Ia2cb027e2f19bd6d3d1c02e3d3742a0122a43c97
2023-06-06 11:14:36 -04:00
Jooyung Han
be95390729 vendor apex: label apex_manifest as vendor_apex_metadata_file
Since vendor APEXes are installed in vendor partition, there shouldn't
be system_file according to Treble. Instead, we can force-label / and
/apex_manifest.pb as vendor_apex_metadata_file so that apexd (and other
system components) can still read them.

Bug: 285075529
Test: m nothing (soong test)
Change-Id: Idb36b8c4c68b29e2235dbda38ee323d4b781e1d5
2023-06-02 22:11:16 +00:00
Sam Delmerico
b1daccdc97 ensure that privapp_allowlist is installed before android_app
AndroidMk assumes that the app is the last file installed, and it uses
this assumption to populate the LOCAL_SOONG_INSTALLED_MODULE entry. This
CL moves the privapp_allowlist installation to before the app
installation to respect this assumption.

Bug: 242509786
Test: go test
Test: OUT_DIR=out.ref m nothing &&
  cp aosp/2562351 && OUT_DIR=out.change m nothing &&
  GOWORK=$PWD/build/bazel/mkcompare/go.work \
  go run android/bazel/mkcompare/cmd -json \
  <(sed -e "s/out\.ref/out/g" out.ref/soong/Android-aosp_cheetah.mk) \
  <(sed -e "s/out\.change/out/g" out.change/soong/Android-aosp_cheetah.mk)
  && verify manually that the only diffs are related to the removal of
  the prebuilt_etc module.
Change-Id: I95ec27070f575e79fb976de68493a219717ed89a
2023-05-25 18:54:06 +00:00
Sam Delmerico
15809f8101 don't require package_name for non-override android_apps
For a non-override android_app, we can assume that the privapp_allowlist
already contains the correct package_name, and so we don't need to
overwrite it in this case.

Bug: 242509786
Test: go test
Merged-In: I0f137e34cae3478dc8b9178d138121ff1d936f07
Change-Id: I0f137e34cae3478dc8b9178d138121ff1d936f07
2023-05-24 11:09:31 -04:00
LaMont Jones
0c10e4dcc0 Parallelize singleton execution
Bug: 281536768
Test: manual, presubmits
Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
2023-05-19 20:31:32 +00:00
Spandan Das
34e0b94815 Merge "Remove CellBroadcast apps from baseline apex available map" 2023-05-18 02:13:39 +00:00
Treehugger Robot
9514d5bb60 Merge "apex: drop metadata gathering for multitree." 2023-05-17 20:14:45 +00:00
Treehugger Robot
7754be760a Merge "Update apex test to verify behavior" 2023-05-16 22:05:40 +00:00
LaMont Jones
d20214f6fb apex: drop metadata gathering for multitree.
This was only partially implemented, and is not needed.

Test: presubmits
Change-Id: Ia6534c62051cd484d46333fbbf8a0fa8ce8288e7
2023-05-16 17:44:29 +00:00
Liz Kammer
5f108fa895 Update apex test to verify behavior
Verify logic for transitive shared vs static deps to
ensure in Bazel that these are handled similarly.

Test: go test soong tests
Change-Id: I015935fa4d7eb1ac40666d47a8de8e48150a043e
2023-05-16 16:57:18 +00:00
Nicolas Geoffray
036ff9a5c1 Add support for missing public / private key files for apexes.
Test: art/tools/buildbot-build.sh on a manifest that doesn't contain all
dependencies.

Change-Id: I8274bc0b616907032b51bc1b68c54888e7e58571
2023-05-16 10:20:39 +01:00
Jiakai Zhang
4abf2f4540 Merge changes from topic "boot-image-b280776428"
* changes:
  Dexpreopt ART jars and framework jars together.
  Unify installDirOnHost and installDirOnDevice.
  Remove the ability to install boot images by bootclasspath_fragments.
  Prepare tests for dexpreopt changes.
2023-05-12 10:48:44 +00:00
Treehugger Robot
f8fbff1671 Merge "Drop redundant libraries from baseline apexAvailable map" 2023-05-12 06:04:23 +00:00
Jingwen Chen
77e003c59a Merge "Revert "Make min_sdk overridable in override_apex"" 2023-05-12 04:57:27 +00:00
Jiakai Zhang
c08c162b5a Dexpreopt ART jars and framework jars together.
Bug: 280776428
Test: atest art_standalone_dexpreopt_tests
Test: -
  1. m
  2. Check .invocation file (http://gpaste/6498044089466880)
  3. Check files in $ANDROID_PRODUCT_OUT/system/framework/x86_64
Test: -
  1. m dist
  2. Check files in out/dist/boot.zip
Test: -
  1. art/tools/buildbot-build.sh --host
  2. m test-art-host-gtest
  3. art/test/testrunner/testrunner.py --host
Test: m build-art-target-golem
Change-Id: I89490252e56a05edab03fdddc6539fa4d7f79756
2023-05-11 19:04:17 +01:00
Jiakai Zhang
b47caccbc0 Remove the ability to install boot images by bootclasspath_fragments.
We don't need this anymore because we are going to compile ART jars and
framework jars together.

Bug: 280776428
Test: m
Change-Id: I070157530449a1bb5779e25984c367df3dde7b36
2023-05-11 18:25:18 +01:00
Jiakai Zhang
b95998be73 Prepare tests for dexpreopt changes.
After this change, there is a clear separation between tests that are
related to dexpreopt and tests that are not. The former uses
PrepareForTestWithDexpreopt, while the latter uses
PrepareForTestWithJavaDefaultModules. The benefit is that the latter
will no longer affected by any dexpreopt changes.

Bug: 280776428
Test: m nothing
Change-Id: Ib957765b9287d51c082e0a33cee17a6bb56daeef
2023-05-11 18:24:44 +01:00
Liz Kammer
bd58e74692 Revert "Make min_sdk overridable in override_apex"
This reverts commit 133c55b48a.

Reason for revert: change was untested and not working

Change-Id: I06d6e3c439ba541ae85dc148f91b184b9731b92d
2023-05-11 15:58:13 +00:00
Spandan Das
494fca1328 Merge changes from topic "stub-impl-per-api-domain"
* changes:
  Special case platform variant of bootstrap libs
  Select stub/impl per apex variant
  For test apexes, base_apex_name is the api domain
  Broaden the granularity of config_setting from apex_name to api_domain
  Print default val if all vals in axis match default val
2023-05-11 00:13:44 +00:00
Jiakai Zhang
bc698cd28a Revert^2 "Generate boot image profiles even if dexpreopt is disabled."
Revert submission 2580631-revert-2574032-XXTWCJDTDQ

Reason for revert: Fixed build breakages

Reverted changes: /q/submissionid:2580631-revert-2574032-XXTWCJDTDQ

Bug: 280440941
Test: lunch aosp_cf_riscv64_minidroid-userdebug && m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true dist
Test: Disable dex2oat on host (to simulate macOS) and build
Change-Id: I5f7f746ca1d4da660fe0c40115e6c71750dfdccc
2023-05-08 21:28:13 +01:00
Spandan Das
a43ae1366e For test apexes, base_apex_name is the api domain
apex_test do not "override" the source apexes that they test. However,
similar to override_apexes, test apexes have the same path
(/apex/<apex_name>) on device. Instead of creating another property,
reuse the existing base_apex_name property. The use case for this will
be for creating selection statements for stub/impl selection.

Test: go test ./bp2build
Change-Id: I4b7548e0e0fc920e407e1c5e5c00e87efc6e70c9
2023-05-08 19:04:32 +00:00
Jooyung Han
e3f0281b88 Mark LLNDK prebuilts as LLNDK
so that Vendor APEXes don't embed the LLNDK prebuilts (which are just
stubs of LLNDK libraries).

Bug: 280697209
Test: m nothing (soong test)
Change-Id: I9e6c123e73fa0ab56d8494a01652ee32a9b6a6cd
2023-05-08 17:05:20 +09:00
Treehugger Robot
dd69e0f225 Merge "Drop androidx libraries from baselineApexAvailable" 2023-05-06 00:43:08 +00:00
Spandan Das
072f7bc5f2 Remove CellBroadcast apps from baseline apex available map
Since these apps explicitly set com.android.cellbroadcast in their
Android.bp files, they do not need to be present in the baseline
apex_available map.

Test: m nothing
Bug: 281077552
Change-Id: Ibea86bfbc7e460e27c5e780b611674e66e9cf727
2023-05-05 22:52:36 +00:00
Spandan Das
4de7b49cd7 Drop redundant libraries from baseline apexAvailable map
These libraries now set the correct apex_available in their Android.bp
files. Therefore, they do not a separate entry in the baseline
apexAvailable map.

Test: m nothing #passes
Bug: 281077552
Change-Id: Icf6b97c3bcc4bda96eefa14ba6d4bf10614bc378
2023-05-05 22:52:33 +00:00
Spandan Das
8d72714736 Drop androidx libraries from baselineApexAvailable
These are not needed in this map since the Android.bp files for these
modules are created by pom2bp script
which explicitly set apex_available as ['//apex_available:apex',
'//apex_available:platform'].

Bug: 281077552
Test: m nothing
Change-Id: I53bb9a104b1e7a2535fe568e27431b1a48a885e3
2023-05-05 20:51:46 +00:00
Qiao Yang
7081aaf874 Merge changes from topic "revert-2574032-XXTWCJDTDQ"
* changes:
  Revert "Generate boot image profiles even if dexpreopt is disabled."
  Revert "Generate app profiles even if dexpreopt is disabled."
2023-05-05 16:43:45 +00:00
Qiao Yang
8d8c660710 Revert "Generate boot image profiles even if dexpreopt is disabled."
Revert submission 2574032

Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279>

Reverted changes: /q/submissionid:2574032

Change-Id: I8e99f8231639198b149ea8d822ee7f9a5b391a89
BUG: <280902279>
2023-05-05 15:03:24 +00:00
Jiakai Zhang
dbfcf85c53 Merge changes I4e721b47,I1bf05ade
* changes:
  Generate app profiles even if dexpreopt is disabled.
  Generate boot image profiles even if dexpreopt is disabled.
2023-05-04 22:13:08 +00:00
Colin Cross
c8ffd27c9f Merge "Install sdk variants in unbundled builds and package uninstallable variants" 2023-05-04 18:15:33 +00:00
Sam Delmerico
717840fdfc Merge changes from topic "privapp_allowlist_prop"
* changes:
  add privapp_allowlist property to android_app
  Add script for modifying privapp permission allowlists
2023-05-04 13:57:17 +00:00
Andrei Onea
580636bdd2 add privapp_allowlist property to android_app
This change allows override_android_app to use the same
privapp_allowlist as the non-override module so that they will always
remain in sync.

Test: go test ./java -v -run TestPrivappAllowlist
Test: go test ./apex -v -run TestApexWithApps
Test: m com.android.permission com.google.android.permission and verify
  manually that apex_payload.img contains correct privapp_allowlist
Test: m com.android.permission before and after change &&
  `diffoscope apex_payload_reference.img apex_payload_with_change.img`
  && verify that there are no semantic changes
Bug: 242509786
Change-Id: Ifdcb28af40763aed7a4aac9a7f681153554bc256
2023-05-03 15:03:34 +00:00
Liz Kammer
46cd7d3be7 Merge "Correct allowlisting for override modules" 2023-05-03 14:58:31 +00:00
Jiakai Zhang
b95f8345c8 Generate boot image profiles even if dexpreopt is disabled.
Bug: 280440941
Test: -
  1. Patch ag/22302622 to disable dexpreopt.
  2. See boot image profiles still generated.
Change-Id: I1bf05ade53fa83f3dba46f28a8f9246ba1fdf664
2023-05-03 15:25:18 +01:00
Colin Cross
bd3a16b5e7 Install sdk variants in unbundled builds and package uninstallable variants
This effectively undoes both If6c3ee82d588e2742c85cef7244c090c93f38b8e
and I682e4f1f477f3024f7719dfaa67006ef335e0640.  SDK variants are now
installed again, which will fix unbundled builds of cc_test modules.
The platform variants used by com.android.virt are now packagable
even though they are not installable.

Fix the original problem in b/194403710 by adding a flag to platform
variants of modules in apexes that are not platform available, and
using that to prevent install and packaging dependencies.  That
allows the HideFromMake flag to go back to being used for preventing
install dependencies but not packaging dependencies.

Test: TestPackagingWithSkipInstallDeps
Test: TestFileSystemShouldInstallCoreVariantIfTargetBuildAppsIsSet
Test: TestFileSystemShouldSkipApexLibraries
Bug: 194403710
Bug: 268582372
Fixes: 274443025
Change-Id: If5418df3ddbb940bd631caebdf38daa81e71f40e
2023-05-02 15:37:26 +00:00
Liz Kammer
20f0f780df Correct allowlisting for override modules
Prevoiusly, we were partially correcting for override modules in
bp2build/mixed builds in some but not all places. Now we always check
for override modules and ensure that Bazel_module properties are
propagated properly for override modules.

Bug: 279609939
Test: go test soong tests
Change-Id: I5445aa71f4c8013315415a2ca9ab9c6b3be6bce0
2023-05-02 09:27:55 -04:00
Jeongik Cha
30208863b4 Merge "Get rid of DeviceName() from path related to dexpreopt" 2023-05-02 05:07:03 +00:00
Spandan Das
e018bc858b Merge "Enforce stub libraries should have a single apex_available" 2023-05-01 23:43:01 +00:00
Spandan Das
934d5047ef Merge changes from topic "bp2build-ignore-test-apex-tags"
* changes:
  Ignore test apexes from bp2build generated tags
  Ignore test apexes from bp2build generated tags
2023-05-01 16:05:38 +00:00
Jeongik Cha
4753b39cca Get rid of DeviceName() from path related to dexpreopt
As-is, dexpreopt config and bootjar is in the dir including
DeviceName(). It causes unnecessary dexpreopt invocation when target is
changed repeatly. To avoid it, rename dir to common name.

Bug: 278833696
Test: m
Change-Id: I2818d9ae09e6c22ca6989cc8efdb70b470ec502c
2023-04-28 11:50:18 +09:00
Spandan Das
20fce2d340 Enforce stub libraries should have a single apex_available
If a library contributes to an API surface, it will have only a single
copy on device. Therefore, we should disallow installation to muliple
apexes/platform.

There are some exceptions to this rule today, and they have been relaxed
using allowlists.

Bug: 277651159
Test: go test ./apex
Change-Id: Ice3023ecd28412a2610d8b98628cb727b58c5c3b
2023-04-27 23:24:55 +00:00
Treehugger Robot
da2f5ec78f Merge "Add allowed-deps tests" 2023-04-27 06:09:35 +00:00
Spandan Das
f57a966b66 Ignore test apexes from bp2build generated tags
The core problem I am trying to solve is making sure that stub
libraries in Bazel have a single apex available. In Soong, this will be
enforced using some graph walk which is not easy to port to Bazel.

However, we might need to revisit this when we build the enforcement
mechanism in Bazel. We likely need a `test_for` on the top level
apex_test Bazel rule so that the test apex is _allowed_ to link against impl
of the library it is trying to test.

(This CL retricts this to cc_library, I can expand this to other modules
if this is the right approach.)

Bug: 277651159
Change-Id: Iaeec22c5626df79a33785c766ed29102b1da403e
2023-04-27 01:43:00 +00:00
Jooyung Han
40a35ee5f9 Merge "Run apex_sepolicy_test for supported fs_type" 2023-04-27 01:03:29 +00:00
Jooyung Han
4495f84f68 Add allowed-deps tests
These tests capture
- track updatable apexes
- do not track apex-only modules
- track transitive deps
- track external deps (with mark)

Bug: 274041915
Test: m nothing
Change-Id: I629015f5aa4a1a7627d0ba6d92fd42bb99c96287
2023-04-27 09:56:04 +09:00
Jooyung Han
b7cdbba71e Run apex_sepolicy_test for supported fs_type
For now ext4 is the only supported fs_type.

Bug: 279689445
Test: m apex.apexd_test_erosf
Test: m apex.apexd_test_f2fs
Change-Id: Idd1b2e61e25110da6d3805b082195e6ec031f573
2023-04-26 14:42:50 +09:00
Jooyung Han
418364213a Revert "apex: skip symbol files when replaced with prebuilt"
This reverts commit 9551384f65.

5bedfee448 is a better solution for the
same problem.

Bug: 279247159
Test: m checkbuild (presubmit)
Change-Id: Ifd3117a4450b5275c09258d1ce896adb41a75158
2023-04-25 15:58:50 +09:00
Jooyung Han
912c4ab16f override_apex can be replaced with apex_set
Bug: 279247159
Test: m nothing
Change-Id: Ic4f8b2b1ee936afe2bf26de7d6cae19d93ecc831
2023-04-25 15:57:38 +09:00
Treehugger Robot
a4c93e3bfc Merge "Add TestApexes to ApexInfo" 2023-04-24 07:03:34 +00:00
Inseob Kim
d0d420d3b1 Merge "Remove deps from Soong intermediate to symbols" 2023-04-22 03:51:10 +00:00
Inseob Kim
5bedfee448 Remove deps from Soong intermediate to symbols
These should be handled by Makefile dependency (LOCAL_REQUIRED_MODULES).

Bug: 278832320
Test: build and see symbol files
Change-Id: I80ad9d8e7e8384e2ae3537cc681bc1d1b327d04c
2023-04-21 11:30:35 +09:00
Liz Kammer
e5eb5786e2 Merge "Don't add apex_set deps in nondeterministic order" 2023-04-20 19:51:21 +00:00
Liz Kammer
2dc7244af9 Don't add apex_set deps in nondeterministic order
Test: unit tests
Change-Id: I97a9708cb6e5a4f3aef55697b6127f61e4d17720
2023-04-20 11:30:19 -04:00
Spandan Das
e8173a83cb Add TestApexes to ApexInfo
If any of apexes in apex_available is an apex_test, then that name will
be propagated down from that apex to each apex variant. This metadata
will be used to enforce that stub libraries cannot have more than one
apex_available.

This logic is necessary so that bp2build can select the correct
stub/impl.

(To avoid replicating this complexity in Bazel, we should consider
dropping the test apexes in Bazel BUILD files, next CL)

Bug: 277651159
Test: go build ./apex
Change-Id: I63617c1dc2a2d5c9cd7758c416fec7b4db1f10a7
2023-04-17 19:26:07 +00:00
Jooyung Han
9551384f65 apex: skip symbol files when replaced with prebuilt
Apexer rule with symbol files causes "no build rule" error when the apex
is replaced with prebuilt.

Bug: 251299786
Test: m checkbuild (presubmit)
Change-Id: I7390f72c321beaeb49fcee4e02a219c07f184664
2023-04-17 15:25:17 +09:00
Florian Mayer
7de9aa1a7b Merge "Add handling for libc_hwasan to Soong" 2023-04-14 23:27:57 +00:00
Treehugger Robot
3d1b6964ec Merge "Update min_sdk_version used in testNoUpdatableJarsInBootImage" 2023-04-13 23:25:45 +00:00
Treehugger Robot
f5cd477841 Merge "Split Rust crate builds into compile and link phases." 2023-04-13 22:45:02 +00:00
Peter Collingbourne
e7c71c344d Split Rust crate builds into compile and link phases.
Teach rustc to generate object files instead of a linked executable
for binary and shared library crates. This lets us skip the lengthy
Rust compilation phase when only the C++ dependencies of these crates
have changed.

This works using a Python script that replaces the linker invoked by
rustc and converts the linker command line into a rspfile that can be
used during the link phase. The script makes certain assumptions about
how rustc invokes the linker, but since we control the version of Rust
we use, we can update the script if those assumptions ever break. I've
asked the Rust developers about adding an official way to do this so
hopefully we won't need to rely on this hack in the future.

The rustc rule for Kythe has been altered to pass linker=true, somewhat
consistent with the main rustc rule, which now doesn't invoke the actual
linker either. `m xref_rust` still succeeds, but hopefully we can find
someone who knows more about the rest of the Kythe pipeline who can let
us know whether it should still work. Otherwise, let's use this CL as
an opportunity to find out whether the rest of the pipeline is happy
with linker=true, since otherwise we will find it hard to maintain the
Kythe rule in the future.

Change-Id: Ifb9c8689c1bd78c0afcf6fdfd111140d20377536
2023-04-12 15:51:41 -07:00
Jooyung Han
33a25c1a0d Merge "Run apex_sepolicy_tests" 2023-04-10 02:36:35 +00:00
Spandan Das
38c39aff61 Merge "Update min_sdk_version used in TestSymlinksFromApexToSystem" 2023-04-07 21:06:56 +00:00
Spandan Das
cc9d9422cb Update min_sdk_version used in testNoUpdatableJarsInBootImage
Updatable apexes should set a min_sdk_version that is not current. This
enforcement does not exist today, but will soon be added to the build
system. In preparation for that, cleanup the min_sdk_version property
used in this unit test.

Test: go test ./apex
Bug: 221087384
Change-Id: I8a163595f85cb0f8dabccc3321ef210215675714
2023-04-07 16:13:22 +00:00
Spandan Das
1a92db5b88 Update min_sdk_version used in TestSymlinksFromApexToSystem
Updatable apexes should set a min_sdk_version that is not current. This
enforcement does not exist today, but will soon be added to the build
system. In preparation for that, cleanup the min_sdk_version property
used in this unit test.

Test: go test ./apex
Bug: 221087384

Change-Id: Idabc4c6f20e134b38ed0ae3ce68f6b7d54d7a13c
2023-04-07 16:13:22 +00:00
Jooyung Han
01f5d6553a Run apex_sepolicy_tests
.. as a validation for apex.

apex_sepolicy_tests checks the contents of the apex against
precompilec_sepolicy. This is to avoid common mistakes in file_contexts.
For example, etc/vintf directory should be read-able by servicemanager.

Bug: 267269895
Test: m com.google.cf.wifi (with wrong file_contexts entry)
Change-Id: Ic363345df43e5b2108b07de787f5f6817bbe6af4
2023-04-07 10:11:27 +09:00
Florian Mayer
95cd6db590 Add handling for libc_hwasan to Soong
libc_hwasan is a new library in the runtime apex that lives in
bionic/hwasan/libc.so and is symlinked to /system/lib64/hwasan/libc.so.
This is chosen by the linker if an app or binary requires HWASan
support.

Bug: 276930343
Change-Id: If331744ad84241ad99a41805ea3110d37cf9b0af
2023-04-06 15:55:50 -07:00
Cole Faust
b0bfa07919 Make outputApexFile relative to module dir in mixed builds
Otherwise when other modules use the apex as data (for example, in
tests) they get the full path from the root of the workspace to the
apex.

Fixes: 276416485
Test: atest timezone_data_e2e_tests:com.android.tests.apex.TimezoneDataHostTest#testStageActivateUninstallApexPackage -- --abi x86_64 then tree out/host/linux-x86/testcases/timezone_data_e2e_tests
Change-Id: Id740856794770df2edc55dfff5f6f938fc31d0c5
2023-04-03 14:28:36 -07:00
Jingwen Chen
a8623da12e bp2build apex: convert canned_fs_config property.
Bug: 275280970
Test: bp2build unit test
Change-Id: Ic6867a640a5079cd206419ddd378d2357093dae6
2023-03-29 04:20:08 +00:00
Jingwen Chen
0cefc0cbc4 Merge "Add tests for custom canned_fs_config." 2023-03-29 02:53:23 +00:00
Liz Kammer
f2571c4136 Merge "Propagate testonly for override_apex bp2build" 2023-03-28 20:57:45 +00:00
Liz Kammer
1a1c9df4e7 Propagate testonly for override_apex bp2build
Test: go test bp2build tests
Change-Id: I42c61687223c658237b3e4b0a0d6dd339946a6aa
2023-03-28 11:39:50 -04:00
Jingwen Chen
dea7a649ac Add tests for custom canned_fs_config.
There are no tests to verify the generated action for the canned fs
config entries, so add some.

Also update the prop's docstring to reflect the actual logic.

Bug: 275209284
Fixes: 275280970
Test: soong tests

Change-Id: I37f2a8640bf4c307068a77db7a635c9bbeb9f38f
2023-03-28 11:32:37 +00:00
Maciej Żenczykowski
480a562661 Merge "Revert "Sort canned fs_config lines to facilitate comparison with Bazel-built APEXes"" 2023-03-27 18:51:45 +00:00
Maciej Żenczykowski
67e2f79eb3 Revert "Sort canned fs_config lines to facilitate comparison with Bazel-built APEXes"
This reverts commit d6322939f7.

Reason for revert: breaks custom canned_fs_config

Bug: 275209284
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I70756af42cbfbc8a1e80894f1bdaa9f4c5cba9e8
2023-03-27 07:04:16 +00:00
Spandan Das
ddfab60014 Merge "Update min_sdk_version from SdkSpec to ApiLevel" 2023-03-23 16:33:36 +00:00
Jingwen Chen
78d15f2b74 Merge "Mixed builds is supported for all apex module types, not just "apex"." 2023-03-23 07:06:45 +00:00
Jingwen Chen
bad4182ddc Mixed builds is supported for all apex module types, not just "apex".
This includes apex_test and apex_vndk. Rely on mixed builds module
allowlist to filter further.

Test: presubmits
Test: m test_com.android.adbd; showcommands test_com.android.adbd | tail -n1 | grep bazel-out
Change-Id: Id73db0917ad4a6dd9c0646d5186753ed940e735f
2023-03-23 03:04:00 +00:00
Treehugger Robot
4476209bde Merge "apex.use_vndk_as_stable can't be used with min_sdk_version" 2023-03-23 02:42:54 +00:00
Spandan Das
8c9ae7ed67 Update min_sdk_version from SdkSpec to ApiLevel
This relands aosp/2457063. The original change broke T and U since those
branches still contain soong modules of type (kind+level). Those soong
modules have been cleaned up now

Test: Used go/abtd to test T and U branches with this change

Bug: 208456999
Change-Id: I0ef7933c055f88cb512a02108f1173e51156ef1c
2023-03-22 20:15:45 +00:00
Jooyung Han
02873da767 apex.use_vndk_as_stable can't be used with min_sdk_version
For vendor apexes, use_vndk_as_stable: true means the apex is tied with
the current VNDK version while min_sdk_version: N means the apex should
work with N+ VNDK versions. Setting both properties together doesn't
make sense.

Bug: 274396342
Test: m nothing (soong tests)
Change-Id: I00dcac43f95ce6a90b3f3273ae4611a300ea5028
2023-03-22 17:53:12 +09:00
Pranav Gupta
957cd6bcbc Merge "Add skip-sdk-check to extract_apks" 2023-03-21 19:16:39 +00:00
Pranav Gupta
51645ff23e Add skip-sdk-check to extract_apks
Add skip-sdk-check to skip checking the SDK version when extracting an
APK/APEX from an App Set Bundle. This can be used when the platform SDK
version is not defined and the APEXs/APKs use SHA based SDK versions.
This check should not be set to true for non Beta dessert releases

Bug: 274518686
Test: # Add SHA targeting modules to platform
m SOONG_SKIP_APPSET_SDK_CHECK=true  #Build Passes
m SOONG_SKIP_APPSET_SDK_CHECK=false #Build Fails
m #No config supplied, build fails

Change-Id: I1919437d3410f09c991e1de39031bd88e1f8246a
2023-03-21 08:13:25 -07:00
Spandan Das
cd05792d06 Merge changes from topic "revert-2457063-EKFSKANQWZ"
* changes:
  Revert "Create two sentinel api levels"
  Revert "Create EffectiveVersion* functions for ApiLevel"
  Revert "Prework for migrating min_sdk_version from (kind+level) ..."
  Revert "Always include host variants in the sdk snapshot"
  Revert "Update min_sdk_version from SdkSpec to ApiLevel"
2023-03-21 01:56:16 +00:00
Spandan Das
b74d1e1d91 Revert "Update min_sdk_version from SdkSpec to ApiLevel"
Revert submission 2457063

Reason for revert: Broken udc-dev

Reverted changes: /q/submissionid:2457063

Change-Id: Id6349fc1318877044af713c914a0afd437d3d2d5
2023-03-21 01:36:47 +00:00
Jooyung Han
0a687b888d Merge "Vendor apexes can be "updatable: true"" 2023-03-21 00:59:08 +00:00
Spandan Das
e773739787 Update min_sdk_version from SdkSpec to ApiLevel
min_sdk_version signifies device version and does not need an sdkKind to
describe it fully. Update the type and cleanup existing usages. As a
side benefit, we also get better error handling since users can no
longer enter something like `public_30` as a valid min_sdk_version in bp
files

Will do a similar cleanup for targetSdkVersion and maxSdkVersion in a
followup CL

Test: m nothing
Test: no change in ninja files (this should be a no-op)
Bug: 208456999

Change-Id: Ie6ae7e267d093c5e4787e82685daaca1021d202e
2023-03-20 16:51:32 +00:00
Jooyung Han
dfc864c802 Vendor apexes can be "updatable: true"
Vendor APEXes can be updatable unless it sets "use_vndk_as_stable:true".
When "updatable:true", it should meet the "updatable" requirements like
"should set min_sdk_version".

Bug: 274396342
Bug: 274041915
Test: m nothing (soong tests)
Change-Id: I746d8941c21e883c1eba3e1f1e5a414a67db071a
2023-03-20 18:29:31 +09:00
Jingwen Chen
bb37c196a3 Merge "Populate apexBundle#filesInfo using bazel info." 2023-03-17 06:42:04 +00:00
Jingwen Chen
2d37b641c5 Populate apexBundle#filesInfo using bazel info.
This CL adds a few things:

1) Populate the filesInfo struct with cquery'd information from an
apex's ApexMkInfo provider. This filesInfo is then used in
apex/androidmk.go to generate Make modules (soong_cc_rust_prebuilt.mk),
which are then used in packaging to generate zip files of symbols in $PRODUCT_OUT.
2) Make a list of dicts of primitives JSON-encodable.
3) Tests.

Bug: 271423316
Bug: 271423062
Test: presubmits
Change-Id: Iaa34f51044de310510e580d9cf1fe60bbef801c1
2023-03-16 18:09:27 +00:00
Prashanth Swaminathan
0344c024fd Enable VNDK when version matches platform VNDK
When evaluating whether to build the VNDK for the multi-target
configurations, we construct the API level based on the VNDK
version. When the VNDK version is 'current', we replace the
version name with the platform SDK version e.g. 'UpsideDownCake'.

For architectures that currently have a MinApiArch of FutureApiLevel
(i.e. 'current'), comparing 'UpsideDownCake' with 'current' will
assume 'current' is at a higher API level and skip building the
VNDK.

Before perofrming the API level comparison, we check that the VNDK
version does not match the platform VNDK version. If true, it is
necessary to disable the VNDK when it does not meet the minimum API
level for the architecture. If false, we skip this check and allow
the VNDK to be enabled, as this implies we are targeting the 'current'
VNDK version and should include the target platform VNDK.

Test: m (soong test) & boot
Change-Id: Iacc33d2858fef670ddfdff5bbde9d32b084979c9
2023-03-15 23:28:45 -07:00
Cole Faust
912bc8862e Use product variables from the overridden apex
override_apex's bp2build converter had a bug where it was looking at
the product variables for the override_apex module itself instead of
for the base module it is overriding.

Fixes: 271424349
Test: go test
Change-Id: If1e2653d3751fa908faf0ab97dfa2e943ebe98ec
2023-03-08 12:29:50 -08:00
Wei Li
598f92d704 Export Soong module type to LOCAL_SOONG_MODULE_TYPE to Make for SBOM generation.
Bug: 266726655
Test: CI

Change-Id: If5b1a77930a591b6061ca2749c9c5ad29b4491fb
2023-03-06 22:51:03 +00:00
Kiyoung Kim
8972e4d6bb Merge "Implement API surface import with APEX stub" 2023-03-06 00:40:13 +00:00
LaMont Jones
aa3408a506 Merge "Add multitree apex metadata" 2023-03-02 22:48:18 +00:00
Jooyung Han
7861e65b48 Merge "Add apex.use_file_contexts_as_is property" 2023-03-02 09:14:35 +00:00
LaMont Jones
11d2d09a5e Add multitree apex metadata
Provide a list of the installable apexes in the tree, so that the
multi-tree orchestrator can generate rules for packaging.

Bug: b/266729952
Test: unit tests pass
Change-Id: If2b2585a7d14aed0618ddbacd116bc5728109d87
2023-03-02 00:21:26 +00:00
Treehugger Robot
8c41eca698 Merge "Remove OWNERS access for non-build team people to core build system" 2023-03-01 19:45:38 +00:00
Joe Onorato
442b6fc701 Remove OWNERS access for non-build team people to core build system
Test: treehugger
Change-Id: I0c318ddd7d78110327bbd849ed9aa3973c86de5d
2023-02-28 19:29:47 -08:00
Cole Faust
18994c73f1 Replace SortedStringKeys with SortedKeys
Now that we have generics.

Bug: 193460475
Test: presubmits
Change-Id: I1594fd8feb505175d5c09c03ef397e5ffd5b09cb
2023-02-28 16:51:32 -08:00
Cole Faust
20eed826fd Merge "Disable strict_updatability_linting" 2023-02-28 23:53:51 +00:00
Cole Faust
1021ccda6b Disable strict_updatability_linting
strict_updatability_linting currently only makes it so
that NewApi can't be added to the lint baseline.
However, since we're updating NewApi to work on a lot
more apis than before, we need to baseline many issues
across the android tree. Temporarily disable
strict_updatability_linting so that we can add these
baselines.

Bug: 193460475
Test: Presubmits
Change-Id: I8d92df95a46e9b903f0cc0e3be56f17722c50430
2023-02-28 11:31:15 -08:00
Spandan Das
c8054ec6ac Merge "Update usages of min_sdk_version that relies on (kind+level)" 2023-02-28 16:44:53 +00:00
Jooyung Han
af73095979 Add apex.use_file_contexts_as_is property
When set true, use file_contexts file as is and do not force-label / and
/apex_manifest.pb

Bug: 268439003
Test: m (soong tests)
Change-Id: I252eef9569deeac87bb71a3425a8eb07bab3c634
2023-02-28 14:13:38 +09:00
Spandan Das
7fa982c0ec Update usages of min_sdk_version that relies on (kind+level)
The type of min_sdk_version is being migrated from
android.SdkSpec(kind+level) to android.ApiLevel(level). This affects
`ShouldSupportSdkVersion` for java modules. This function skips the
check for modules compiling against `core`, and that requires access to
SdkVersion and not MinSdkVersion after the migration.

Skip the check explicitly using SdkVersion.

Test: go test ./java
Test: No change in ninja file
Bug: 208456999
Change-Id: I14eca4f8e8c5d7477ded00c4fe54097323fab4a2
2023-02-27 20:03:25 +00:00
Kiyoung Kim
76b06f3973 Implement API surface import with APEX stub
Implement APEX stub of API surface so any stub can be replaced with API
surface when APEX stub interface is required.

Unlike other stub interface, APEX stub can be decided if it should be
used after APEX postdeps mutator analyzes which modules should be
included in which APEX. To cover this, APEX stub is being added to the
dependency if the dependency should not be covered with LLNDK or NDK
stub, and APEX stub exists. From depsToPaths, if dependency to both
original module and API library exists, then it choose one of the
dependency and ignore the other.

To cover this logic, a new property is added to the api_surface :
apex_libs. This is introduced as it is difficult to
gather all api library with apex stub before DepsMutator.

Bug: 264963986
Test: cf_x86_64_phone_vendor build succeeded
Change-Id: I9f0b1f70968e32eba94d3e0d7bb1f4bb29ff2438
2023-02-27 12:57:30 +09:00
Anton Hansson
2ae1bbb599 Merge "Make rros not overridable" 2023-02-24 16:34:24 +00:00
Anton Hansson
44b3e7565a Merge "Revert "Support overriding APEX java contents"" 2023-02-24 14:56:10 +00:00
Anton Hansson
72e7ffe6ad Make rros not overridable
There are no current users of overriding rros, so it's dead code.
Additionally, there is some evidence of accidental misuse, so remove it
for now as we don't want arbitrary properties of AOSP modules to be
overridable in the general case.

Bug: 270542561
Bug: 269568074
Test: presubmit
Change-Id: I030abd644358baefc0d1543649c8a2a81a7491d0
2023-02-24 11:17:05 +00:00
Anton Hansson
e7545858bd Revert "Support overriding APEX java contents"
This reverts commit be90172f0a.

Reason for revert: not used, and not desired

Bug: 270542561
Test: presubmit
Change-Id: I415440dbae965f3c07c6f3ccf6ab4bc9ec57fbf6
2023-02-24 11:13:00 +00:00
Joe Onorato
8bb9a4a194 Revert "Add an Override_apex_available property for APEX"
This reverts commit dd2c76e772.

Reason for revert: This was submitted without build system team +2 with no rationale for why it's needed.

Change-Id: I86b9849122ec2b7a382d4f39bbbc0ea1ff70c4bc
2023-02-22 17:17:31 +00:00
Yiming Jing
dd2c76e772 Add an Override_apex_available property for APEX
This property allows an APEX bundle to ignore the apex_available rules
defined in its dependencies, effectively allowing it to use any APEX
as its dependency.

Bug: 269660351
Test: m
Change-Id: Ib2797e04438ad908ac10b256dce07a7819e836b3
2023-02-20 20:04:14 -08:00
Jiyong Park
ce2436302a Fix symlinks from APEX to partitions
Previously, the symlink optimization for APEXes assumed that the target
of the symlinks are in the system partition. The assumption however
doesn't hold always because the file that was added to the APEX might be
with system_ext_specific: true or vendor: true.

Bug: 265598720
Test: m nothing
Change-Id: Ieb9a6769320c0ec697a88c0cae977e7d65288362
2023-02-17 18:22:25 +09:00
Treehugger Robot
c004bf3b7e Merge changes I55a5a295,I9c09451d,I05177388
* changes:
  Use the profiles in the APEX to dexpreopt system server jars.
  Add tests for the ignored "profile_guided: true" property.
  Output dex_preopt to SDK snapshot.
2023-02-16 14:46:19 +00:00
Jiakai Zhang
81e468171f Use the profiles in the APEX to dexpreopt system server jars.
After this change, if "profile_guided: true" is set, profile-guided
compilation will be enabled for the jar and the ".prof" file next to
the jar in the APEX ("javalib/<name>.jar.prof") will be used as the
profile when dexpreopting for the prebuilt APEX.

Bug: 241823638
Test: m nothing
Test: -
  1. (on internal master) Patch aosp/2426453.
  2. Build the APEX bundle and the module SDK of com.android.wifi
  3. (on tm-dev) Patch this CL and aosp/2141972.
  4. Copy the APEX bundle and the module SDK built on step 2 to the
     source tree
  5. Disable hiddenapi check
  6. lunch cf_x86_64_phone-userdebug && m MODULE_BUILD_FROM_SOURCE=false com.google.android.wifi
  7. cat out/soong/.intermediates/prebuilts/module_sdk/Wifi/current/prebuilt_service-wifi/android_common_com.android.wifi/dexpreopt/oat/x86_64/javalib.invocation
  8. See the profile being used.
Change-Id: I55a5a295e9c5d6f0564afb139c5fb7da91ab8cae
2023-02-15 22:47:24 +00:00
Jiakai Zhang
1f4542c85b Add tests for the ignored "profile_guided: true" property.
This is tricky and is worth some tests.

Bug: 241823638
Test: m nothing
Change-Id: I9c09451d075dca7563eb42c63812375cfd974fbf
2023-02-15 22:47:24 +00:00
Treehugger Robot
da92c3ecba Merge "Improve documentation around go/allowed-deps-error" 2023-02-14 15:00:31 +00:00
Jiakai Zhang
871109e91d Merge "Properly check the deapexed files in tests." 2023-02-10 15:18:37 +00:00
Jiakai Zhang
ebf48bf1e2 Properly check the deapexed files in tests.
The tests in bootclasspath_fragment_test setup the environment to have
two APEXes: a source one and a prebuilt one. Before this change, the
tests for prebuilt incorrectly check the contents in the source one.
This change introduces a new function that properly checks files
deapexed from the prebuilt one.

Bug: 241823638
Test: m nothing
Change-Id: I1865c20b198d50e7ebc8ebfb9f7c71394a225ab7
2023-02-10 23:13:41 +08:00
Jingwen Chen
2d7f6fdfa6 Check that apex#filesInfo is not nil in mixed bazel/soong mode.
filesInfo should not be used for an apex that's converted to Bazel,
since all information should come from the Bazel starlark provider.
filesInfo is populated when there's a full Android.bp module graph of
the apex deps.

Test: presubmits
Change-Id: I4b9c596ca7841f4ea76e21f929039282113b6752
2023-02-10 08:07:41 +00:00
Cole Faust
aafdf54f70 Merge "Export apex_available_baseline to soong_injection" 2023-02-09 18:39:27 +00:00
Jooyung Han
9b293af098 Merge "Revert "Revert "Remove apex.apex_name""" 2023-02-09 08:46:12 +00:00
Cole Faust
9e384e2e6b Export apex_available_baseline to soong_injection
So that it can be used in the bazel implementation.

Bug: 268006095
Test: m nothing, check that it's in out/soong/soong_injection
Change-Id: I1520dd874076dee7fa083648d0790b060d658e5a
2023-02-08 17:43:09 -08:00
Jooyung Han
63dff468d0 Revert "Revert "Remove apex.apex_name""
This reverts commit d1209a89c7.

Reason for revert: apex_name was still in use in the internal/intermediate branch. Fixed(removed apex_name) in the internal branch.

Change-Id: I10b8e0cfdb01dcdb6b623bddf9c04f4dac71fc90
2023-02-09 00:11:27 +00:00
Sam Delmerico
e413f4046f Merge "mixed build targets need transitive tidy files" 2023-02-08 20:11:30 +00:00
Jiakai Zhang
3317ce725d Install system server jar profiles into the APEX.
After this change, if profile-guided compilation is enabled for an APEX
system server jar, the profile will be installed next to the jar with
the ".prof" suffix, ("javalib/<name>.jar.prof"). This file will later be
used by odrefresh and dexpreopt from prebuilt APEX.

Bug: 241823638
Test: m nothing
Test: -
  1. Patch ag/20581649 PS2.
  2. banchan com.android.btservices x86_64 && m
  3. Check that "javalib/service-bluetooth.jar.prof" exists in the APEX.
Change-Id: Ibcfc6257dade92bd40a6d4b7368148717d0863b9
2023-02-08 19:25:37 +08:00
Marco Loaiza
d1209a89c7 Revert "Remove apex.apex_name"
This reverts commit df26332d50.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_tm-qpr-dev-plus-aosp&target=aosp_sunfish-userdebug&lkgb=9578804&lkbb=9579062&fkbb=9578931, bug b/268301897

Change-Id: I819a416286cda63a6fa8d3d6b4343c86638b4dc9
BUG: 268301897
2023-02-08 10:14:01 +00:00
Jooyung Han
df26332d50 Remove apex.apex_name
apex_name was used to install symbol files under /apex/<apex name>,
which caused duplicate rules when there's two apexes with the same
apex_name. (e.g. override_apex or multi-install apexes)

Since symbol files can be looked up via ELF Build-Id, we don't have to
install symbol files with the actual "apex name", but instead we can
install them with soong module name.

Bug: 267581665
Test: m (soong test)
Change-Id: I1cbe5c86d287f180c7deef93ba85ea5552680011
2023-02-08 09:24:06 +09:00
Sam Delmerico
4ed95e263f mixed build targets need transitive tidy files
Previously in mixed builds, only the tidy files for the boundary module
were built, whereas all of its transitive dependencies' tidy files were
not being built. Instead we should export the list of transitive tidy
files for a module so that we can run clang-tidy for the boundary module
as well as its dependencies.

Bug: 195029134
Test: WITH_TIDY=1 DISABLE_ARTIFACT_PATH_REQUIREMENTS=true mss tidy-packages-modules-NeuralNetworks --bazel-mode-dev
Change-Id: I463646d2ae1fc4aa075a54c264e1c34571c3fd5c
2023-02-07 16:50:30 -05:00
Pedro Loureiro
87c88176fe Improve documentation around go/allowed-deps-error
Bug: 264349293
Change-Id: I64e95938e53fb26c104e0daece4939f97744a344
2023-02-07 17:08:38 +00:00
Jooyung Han
88b057efaa Remove apex.multi_install_skip_symbol_files
This has been a workaround to avoid duplicate build rules for
multi-install apexes. The reason for duplicate errors was that apex_name
was used to install symbol files.

We don't need to rely on apex_name for symbol files, hence no need for
the workaround.

Note that symbol files for apexes are still available via the paths
based on "soong module name".

Bug: 267581665
Test: cuttlefish (which uses multi-apex) build & run
Change-Id: Icaca667e139ef2aca32339a75b54b12a00449c2d
2023-02-07 14:13:24 +09:00
Jooyung Han
2cd2f9ad89 VNDK APEX doesn't use "apex_name" property
VNDK APEX has been using "apex_name" property to set "name" field in
apex_manifest. But setting apex_name had a side-effect of emitting
duplicate rules for symbol files for VNDK APEX and its override_apex.
(Please see the removed comments for more details about error)

Not using "apex_name" fixes the duplicate errors.

There're a few more vendor apexes with the same issue, which I will
handle in follow-ups.

Bug: 267581665
Test: m (soong test) && boot
Change-Id: I00f617cef8af4d21880d4e8b9c0b9ab9322ba15c
2023-02-07 13:58:19 +09:00
Jiyong Park
1bb18bb2ac Merge "Symbol files for Rust binaries in APEXes are exported" 2023-02-07 02:55:02 +00:00
Jooyung Han
dc6f9c74c6 apexer: remove --do_not_check_keyname
Since fe4ff29b4d47fa8ae242fb7e084215d3afada4b5 (in system/apex), apexer
doesn't check keyname (--key vs --manifest.name). So, passing
--do_not_check_keyname doesn't make any sense.

This is a preparation to remove (or deprecate) "apex_name" property from
"apex" module.

Bug: 267581665
Test: m
Change-Id: I3737d1e36d305375a523a23a6bbeb2d23586e578
2023-02-06 17:33:25 +09:00
Jiyong Park
c7a4688b9d Symbol files for Rust binaries in APEXes are exported
Bug: 228083190
Test: build and check symbols/apex/com.android.virt/bin/crosvm exists.
Change-Id: Id8b401723791d13dfc68c8e6972e73f875292924
2023-02-02 11:33:39 +09:00
Dennis Shen
d4f5d932a1 Add soong unit test for trimmed apex build
BUG: b/259381334
TEST: m nothing
Change-Id: I49e5d31a6f5c4f9a72a6a4b3b2ab7114b996adbc
2023-02-01 20:23:46 +00:00
zhidou
133c55b48a Make min_sdk overridable in override_apex
It makes sense to make min_sdk overridable because the override_apex is
a variant of the original apex, and this variant might be
created/introduced in the newer Android release compared with the base
apex. Despite the fact that the source of the variant apex is the same
as the original one, the variant may not support the older version, like
Go modules, trimmed modules. If we consider the variant as a "new"
module, then it makes sense to have a new min_sdk to make it only
available for the newer Android released version only.

Bug: 266945903
Test: Build locally, and check if the override works
Change-Id: I7f4c7169e15b7e57f44a4abafe012151dbc226a0
2023-01-31 19:34:55 +00:00
Jingwen Chen
fb708e99f7 Delete apexBundle#prebuiltFileToDelete.
Nothing is reading this field. Delete it.

Test: presubmits
Change-Id: I47d15b7c4e2aca4b251059305c27c2a9b5f05b1f
2023-01-30 12:07:19 +00:00
Colin Cross
ec41b5c2e2 Merge "Disable VNDK apexes for unsupported API levels" 2023-01-27 19:49:48 +00:00
Colin Cross
bb137a3956 Disable VNDK apexes for unsupported API levels
Disable VNDK apexes when their version is below the minimum
supported API level for the primary architecture.

Test: TestVndkApexCurrent
Change-Id: Ie72a5beb9da432660d3fec5c520402224326f961
2023-01-27 19:49:38 +00:00
Colin Cross
a13de4dea4 Merge "Don't install system image copies of libraries in unbundled apex builds" 2023-01-27 19:27:54 +00:00
Diwas Sharma
fe4587161b Merge "Revert "Don't add flattened files apex as dependencies of an image apex"" 2023-01-27 17:55:13 +00:00
Treehugger Robot
6e7441edde Merge "Read ApexMkInfo for modules to be installed." 2023-01-27 15:45:08 +00:00
Dennis Shen
0c79be54b6 Merge "Support trimmed variant build in soong" 2023-01-27 13:11:50 +00:00
Jingwen Chen
29743c8423 Read ApexMkInfo for modules to be installed.
This piggybacks onto the ApexInfo cquery handler, so we're issuing a
single bazel query call that reads two providers in the starlark expr.

Also rename requiredDeps to makeModulesToInstall to differentiate it from
APEX's required/provided libs in the apex manifest.

Test: unit test
Test: mkdiff
Fixes: 263123189
Change-Id: Ib7e43f1586f29864eee8627dba3631bfaff27afa
2023-01-27 04:02:45 +00:00
Diwas Sharma
bb9202e688 Revert "Don't add flattened files apex as dependencies of an image apex"
This reverts commit eb8cd3122a.

Reason for revert: mainline module jacoco jar do not contain JAVA_LIBRARIES needed for coverage, see: b/266679012

Change-Id: If756f7aaf40c6bcfed170c59c494bcc426620039
2023-01-27 00:40:21 +00:00
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
Cole Faust
8733a89cf8 Merge "Refactor python rules" 2023-01-26 19:03:25 +00: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
Vinh Tran
ba46e76622 Merge "Delete __ANDROID_APEX_MIN_SDK_VERSION__ from Soong" 2023-01-25 19:09:27 +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
Vinh Tran
f9754735f2 Delete __ANDROID_APEX_MIN_SDK_VERSION__ from Soong
Currently, Bazel sets __ANDROID_APEX_MIN_SDK_VERSION__ based on the cc library's min_sdk_version while Soong does based on apex's min_sdk_version. This causes a diff in the clang commands.

Digging further, we realized __ANDROID_APEX_MIN_SDK_VERSION__ isn't used anywhere so we might just delete it altogether instead of fixing it.

Bug: 265134933
Test: presubmit
Change-Id: I08e89dc8f6ef86669248ea5c47de6603e9d2ffbb
2023-01-20 00:14:48 -05:00
Cole Faust
eb8cd3122a Don't add flattened files apex as dependencies of an image apex
The image apex does not need all the files that make up a flattened
apex.

Bug: 254205429
Test: go tests
Change-Id: I7c574c5b30b55ab6d1b3981ee26d168c2f2427c4
2023-01-19 18:36:11 -08:00
Sasha Smundak
d6322939f7 Sort canned fs_config lines to facilitate comparison with Bazel-built APEXes
Bug: 237037156
Test: mixed builds regression testing
Change-Id: Ifc9a7b4231c947fe85e77c56ffeb30a2d53df6c4
2023-01-11 22:01:01 -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
Cole Faust
a734749148 Use WriteFileRule instead of custom echo commands
These instances could use WriteFileRule instead of
making their own shell code to write a file.

Test: Presubmits
Change-Id: I9c809b2164a68b4ce1c22fbbd0d7497240110b39
2023-01-03 14:42:23 -08:00
Jooyung Han
1724d58a91 apex_vndk doen't need stub variants
This was revealed by the new check added in
Ib3c6efd16bdf13b59f79be66d4f9dba49100f6cc.

This was okay since the old implementation relied on the fact that impl
variant comes before stub variants.

To make the new check happy and keep the intention explicit, stub
variants are not added to VNDK apex.

Bug: 191770320
Test: m (apex_test)
Change-Id: I455f2c9b6bc471c579379286c0198f36d325adf6
2022-12-21 10:17:44 +09: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
Treehugger Robot
16d87f33a2 Merge "Streamline AndroidMk generation" 2022-12-13 19:39:20 +00:00
Sasha Smundak
dcb6129269 Streamline AndroidMk generation
Add AndroidMkEmitAssignList to emit a line to assign the items from
the given list of string arrays.

Test: treehugger
Change-Id: Id5acbef38ea4e91349bd2461f226db352d4b8123
2022-12-12 18:06:49 -08:00
Paul Duffin
76fdd67f9f Allow building against prerelease prebuilt APEXes
Generally, when building system images from prebuilt APEXes the APEXes
should be released versions and the build ensures that is the case when
extracting .apex files from prebuilt .apks files. However, it is useful
to test building against prebuilt APEXes before finalization to flush
out any issues early on. Previously, the build would fail in that case.
This change adds support for using the SOONG_ALLOW_PRERELEASE_APEXES
environment variable to allow prerelease APEXes to be suppported.

Bug: 259958590
Test: m MODULE_BUILD_FROM_SOURCE=false droid
      # Above fails because it could not find non-prelease APEXes in the
      # prebuilt .apks files.
      m SOONG_ALLOW_PRERELEASE_APEXES=true MODULE_BUILD_FROM_SOURCE=false droid
      # Above works.
Change-Id: I20b8e5db0b9fd2a21434be25652195fae929bd3f
2022-12-12 18:00:47 +00:00
Paul Duffin
4f2282c2d8 Make apex_set support ":<apex>" syntax to access the apex file
The apex and prebuilt_apex module types make the output APEX available
using ":<apex>" syntax, e.g. for use as a data file in a test. This
change adds compatible behavior to apex_set to ensure consistent
behavior when building against prebuilts.

Bug: 259958590
Test: m MODULE_BUILD_FROM_SOURCE=false nothing
Change-Id: Ic6f105976cfdd6af4920cc1e11ab0b4ff72e6a6f
2022-12-12 17:44:33 +00:00
Paul Duffin
e17c31611a Fix deapexer usage in prebuilt_apex/apex_set
A previous change to the deapexer script to check that blkid_path and
fsckerofs_path were set broke the scripts/unpack-prebuilt-apex.sh
scripts use of deapexer. This change fixes it by passing the paths
through to the script which then passes it on to deapexer.

Bug: 255963179
Bug: 240288941
Bug: 259958590
Test: m MODULE_BUILD_FROM_SOURCE=false droid
Change-Id: Ief7f36219b7fe1cf7104c08163e10d8e39f181d0
2022-12-12 17:40:26 +00: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
Treehugger Robot
612a0e28e5 Merge "Add option to override defaultManifestVersion" am: 720e0ce5e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2323675

Change-Id: I254fb1d934928aa069139eaf4377e84630d34bfa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 12:43:00 +00:00
Sahana Rao
16ebdfdf0f Add option to override defaultManifestVersion
Add an option to override defaultManifestVersion using environment
variable. The environment variable will be used to override the apex
version locally when developing a desert release feature in
mainline-prod branch. Overriding the apex version in mainline-prod
branch allows us to install apex built in mainline-prod branch to device
running code from git_master which has a higher apex version than
mainline-prod branch.

Bug: b/233608815
Bug: b/196860838
Test: presubmit
Test: go test -v ./build/soong/apex/
Change-Id: I8ac2aae2b6b29da7f09db6edb893e0a0f0691e51
2022-12-06 07:15:44 +00:00
Treehugger Robot
1ed3a7a0f7 Merge changes Ia4016240,Iba586155 am: a36589c4ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2309617

Change-Id: I14b21791d36601bc832c382391b003a1e9b4cd71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 11:18:24 +00:00
Treehugger Robot
a36589c4ca Merge changes Ia4016240,Iba586155
* changes:
  Allow choosing which soong_build invocations to run in the debugger
  Show module type in a module section of the Android-TARGET.mk
2022-12-02 10:36:07 +00:00
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
Sasha Smundak
5c4729df93 Show module type in a module section of the Android-TARGET.mk
The first line of each section will be
```
include $(CLEAR_VARS)  # <module type>
...
```

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

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

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

Test: presubmits
Fixes: 218841706
Change-Id: I19b3637da9aa47573b252d74f62b601fbdc3784d
2022-12-01 06:25:25 +00:00
Anton Hansson
912316068b Ignore native bridge archs for apex selection am: 805e0a53ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2318630

Change-Id: I0d655c0efb51396423aae1836d32d104ac25393f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 17:12:52 +00:00
Anton Hansson
805e0a53ef Ignore native bridge archs for apex selection
This leads to an arm64 apex being used on a device that is mixed
x86_64 with nativebridge=arm64. A device like that doesn't appear
to work with arm64 binaries. For example, the boringssl-self-check
binary crashes on boot.

Bug: 260115309
Test: unit test
Test: boot emulator with this combination
Change-Id: Ic4a91974290a05b1799f755fcf52ef226d68f4c2
2022-11-29 12:56:37 +00:00
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
Prerana Patil
61ae375077 Merge "Revert "Don't add flattened files apex as dependencies of an image apex"" am: 62253d193b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2295898

Change-Id: Ib5464e80ca8375778957e0bf59fb5068011c9ba6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 20:53:05 +00:00
Prerana Patil
62253d193b Merge "Revert "Don't add flattened files apex as dependencies of an image apex"" 2022-11-09 20:29:03 +00:00
Prerana Patil
b1896c88d5 Revert "Don't add flattened files apex as dependencies of an image apex"
This reverts commit b81814a7b4.

Reason for revert: breaking build 9271471

Change-Id: I1876f45b79779d7e8ec46a78bf71bf7fec09e62b
2022-11-09 18:14:34 +00:00
Liz Kammer
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
Treehugger Robot
f0adbcd03d Merge "Don't add flattened files apex as dependencies of an image apex" am: 926d00c2ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2285522

Change-Id: Icb3b05caa4ff658e93ac30039e9375b4f9934c8b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 05:38:53 +00:00
Treehugger Robot
926d00c2ad Merge "Don't add flattened files apex as dependencies of an image apex" 2022-11-09 05:00:29 +00:00
Wei Li
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
Treehugger Robot
5aa7aca857 Merge "Remove unnecessary TestMain()" am: 9fa8a2e220
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288158

Change-Id: Ia8a4d2e0da4e5a542dc8cb7e242642da68d68032
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-05 01:15:56 +00:00
Treehugger Robot
9fa8a2e220 Merge "Remove unnecessary TestMain()" 2022-11-05 00:30:04 +00:00
Liz Kammer
fdb6321d23 Remove unnecessary TestMain()
Test: go test Soong tests
Change-Id: I2a8710361b1a32d71417b6c7bbc19e87fa8b36ae
2022-11-04 16:24:29 -04:00
Cole Faust
b81814a7b4 Don't add flattened files apex as dependencies of an image apex
The image apex does not need all the files that make up a flattened
apex.

Bug: 254205429
Test: go tests
Change-Id: Iff05f2d01f11397bc9e9bf31868112575268969b
2022-11-04 11:05:49 -07:00
Colin Cross
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
Colin Cross
cb29876dcb Merge "HACK: use arm64 apex prebuilts for riscv64" am: cc7a5dcf44
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2281571

Change-Id: I73464238cb8b4beeb60402096c789adea361ab0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-01 23:05:10 +00:00
Colin Cross
abacbe8436 HACK: use arm64 apex prebuilts for riscv64
There are no riscv64 apex prebuilts, which breaks the build when
provenance_metadata singelton tries to run a tool on all the input
apexes that don't exist.  Hack it to provide the arm64 apex for now
if no riscv64 apex is specified, which will allow the build to pass.

Test: lunch aosp_riscv64-userdebug && m droid
Change-Id: Ic39936539803615ea4b7f817daf7b59ab7c40e7e
2022-11-01 19:13:17 +00:00
Wei Li
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
Jiyong Park
4cdaf63554 Merge "Install appSet using InstallFileWithExtraFilesZip" am: 61807339b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2261552

Change-Id: I7cdd0872a78489bdfe464469eb01aa6d85de8b60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-21 00:29:09 +00:00
Jiyong Park
61807339b8 Merge "Install appSet using InstallFileWithExtraFilesZip" 2022-10-21 00:17:52 +00: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
Jiyong Park
f648d53154 Install appSet using InstallFileWithExtraFilesZip
This fixes a bug that only the primary output of an appSet is installed
when the appSet is part of a flattened APEX.

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

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

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

Change-Id: Icbc4dd002f856a3f751badec781ad132c423ac9b
2022-10-19 18:22:37 +09:00
Vinh Tran
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
21c71a35bd Merge "Move checking of minApiForArch for apex into cc" 2022-10-13 20:15:30 +00:00
Treehugger Robot
9e192c1bfe Merge "Add riscv64 support for apex prebuilt" am: edc294aff2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2252453

Change-Id: Iac1b28b848431ea8e38e7e468138449ca17bcf4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 20:21:56 +00:00
Chen Guoyin
401f298e50 Add riscv64 support for apex prebuilt
This add support for src field in bp file.

Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: I9393696951db375d53436f9d5a9841b6a072cea3
2022-10-13 00:00:11 +08:00