Commit graph

3450 commits

Author SHA1 Message Date
Colin Cross
74656ccf35 Merge "Don't write license data to Android-${TARGET_PRODUCT}.mk" into main 2023-11-28 22:51:32 +00:00
Yu Liu
eae7b36699 Add container property to aconfig_declarations.
Bug: 311155208
Test: Unit test
Change-Id: I7b187138856d0144203961e82b6dad5e2f8eed9d
2023-11-28 12:37:02 -08:00
Inseob Kim
6a4bb378df Merge "Allow apex to use generated file_contexts" into main 2023-11-22 07:45:53 +00:00
Colin Cross
a16bd6b714 Don't write license data to Android-${TARGET_PRODUCT}.mk
All the necessary license data is already propagated through the license
metadata file, and the entries in Android-${TARGET_PRODUCT}.mk are not
used.  Remove them, which should both reduce the size and parsing cost
of the Android-${TARGET_PRODUCT}.mk file and also removes a variable
that changes when dependencies are added or removed, which will
eventually allow running kati less often.

Bug: 309006256
Test: No change to out/Android-aosp_cf_x86_64_phone.ninja
Change-Id: Idfeb6fd10d77497ca274f8e74fe8e994ce1cafe6
2023-11-21 15:27:44 -08:00
Colin Cross
d442a0e882 Add DataPath.ToRelativeInstallPath
Add a method to DataPath that converts it to the relative install path
in preparation for adding additional complexity to DataPath.

Bug: 311428265
Test: builds
Change-Id: I65b06238aafda2db72c6a253744a3087976451cd
2023-11-17 19:06:50 -08:00
Colin Cross
09ad3a6505 Change deps of ctx.Install* from Paths to InstallPaths
Installed files should only depend on other installed files, change
the deps arguments of the ctx.Install* methods from Paths to
InstallPaths.

Bug: 311428265
Test: builds
Change-Id: I1ebef60a943bdbe907744cc43aa985371ac56d32
Merged-In: I1ebef60a943bdbe907744cc43aa985371ac56d32
2023-11-17 19:06:43 -08:00
Inseob Kim
28d06d2eac Allow apex to use generated file_contexts
To support trunk stable, file_contexts files should be processed before
creating APEX images. That means that file_contexts may be under out/.
This change relaxes the path check so we can use Soong-generated
file_contexts, not only the real source file_contexts. Of course the
restriction that modules should be under system/sepolicy is still
enforced.

Bug: 306563735
Test: build with generated file_contexts; see virt apex
Change-Id: I3aa368b338141d4826fc8622e1c8d2838bfd8484
2023-11-17 18:06:45 +09:00
Colin Cross
d7812415c3 Merge "Stop collecting path entry for module_bp_java_deps.json from each module type" into main 2023-11-15 21:01:38 +00:00
Colin Cross
a644c263dd Stop collecting path entry for module_bp_java_deps.json from each module type
The jdepsGeneratorSingleton can get the module path directly, it doesn't
need to be collected by each module type that implements IDEInfo.  Fixes
module types (like android_library) that didn't reach the code that
collected the path.

Bug: 309835196
Test: out/soong/module_bp_java_deps.json contains path for ExtServices.core
Change-Id: If8cb81b4f708e0367f156ade164bee253bf53492
2023-11-15 11:40:48 -08:00
Jooyung Han
fed9cce4b6 Use vendor_file for vendor apex root
It was 'vendor_apex_metadata_file', but root directories can be simply
labelled as 'vendor_file' so that linker can resolve paths in vendor
apexes.

Bug: 310528686
Test: m blueprint_tests
Change-Id: I689b23efccb7be61980e791e185fcef28a76d9bc
2023-11-14 13:52:51 +09:00
Spandan Das
39e21ee0dd Remove redundant baseline apex_available entries
These soong modules list the relevant apex_available values explicitly
in Android.bp files

Test: m nothing
Bug: 281077552
Change-Id: I7ec8e0f9d7ab7cbfb881d59d3e5d2bb8a2975ff8
2023-11-13 21:36:15 +00:00
Spandan Das
bf6f44167f Remove empty baseline apex_available maps
And com.android.appsearch since the lone entry in the map specifies
com.android.appsearch in its Android.bp file explicitly

Bug: 281077552
Test: m nothing
Change-Id: I0b7e37f0b6ace21d37c8b0077bacf83b49318744
2023-11-13 21:06:16 +00:00
Jiakai Zhang
04445d5443 Merge "Use the correct mainline BCP jars for app dexpreopt." into main 2023-11-08 10:56:58 +00:00
Jooyung Han
55a7306aeb Add check for unwanted_transitive_deps
apex.unwanted_transitive_deps can break the APEX when any of listed deps
is actually needed. To avoid that, a new validation is added to see if
"unwanted" deps are actually not used by any ELF files in the APEX.

The new validation runs only for non-test apexes with
unwanted_transitive_deps set because test apexes can be broken
intentionally.

Bug: 295593640
Test: m com.android.virt
Change-Id: I29a3f7ef76b59594a08cfacca4811f16bf7172cc
2023-11-07 13:09:56 +09:00
Jiakai Zhang
c6879f3ddd Use the correct mainline BCP jars for app dexpreopt.
Before this change, the build system had special logic to find mainline
BCP jars and copy them to a special location for app dexpreopt. This
logic doesn't work on `next`. In fact, we don't need this logic anymore.
Since we are now generating the mainline boot image extension, we can
reference the inputs of the mainline boot image extension, which are
exactly the mainline BCP jars needed for app dexpreopt.

Bug: 309302263
Test: atest art_standalone_dexpreopt_tests (on next)
Test: m --no-skip-soong-tests nothing

Change-Id: I055018ffbc5d7e5678f305e65a7f1c7e73bf3b99
2023-11-06 18:44:52 +00:00
Jooyung Han
912a6f3501 Enable dup check for test apexes
Bug: 263308515
Test: m test_broken_com.android.art
Change-Id: I54aaba9424973f4d54c5a17f640cd79ac5dd28ec
2023-11-02 18:31:37 +09:00
Jooyung Han
a8bd72aec2 Add apex.unwanted_transitive_deps property
It can be used as a workaround when the current build system adds more
than necessary to APEX.

Bug: 263308515
Bug: 295593640
Test: m blueprint_tests
Change-Id: Ib59c4ac59e6128b3d112b97876e9e2d1e6ec4211
2023-11-02 18:31:37 +09:00
Jooyung Han
78a658b81f Merge changes from topic "fix-apexkeys" into main
* changes:
  Rewrite how to generate apexkeys.txt
  Refactor around apexKeysText singleton
2023-11-01 05:13:06 +00:00
Jooyung Han
286957df99 Rewrite how to generate apexkeys.txt
Instead of listing all apexes in the source tree, now each apex emits
its own fragment for apexkeys.txt, which is pointed by
LOCAL_APEX_KEYS_FILE. Makefile collects apexkeys.txt from installed apex
files. This is to avoid listing unrelated apexes (not installed,
testdata, unexported namespaces, etc.)

Bug: 304914238
Test: m apexkeys.txt
Test: m blueprint-tests
Change-Id: Iefbe6e486cb418955584ad1a282455307e90be95
2023-10-30 16:48:36 +09:00
Jooyung Han
2cf35e7bfd Refactor around apexKeysText singleton
apexkeys.txt should list the installed apexes. But for now it lists all
apexes in the source tree. To fix this, each apex(or prebuilt/apexset)
will generate its own apexkey info and they'll be merged into a single
text only for installed apexes.

This change is a preparation before the upcoming change. We'll reuse the
apexKeyEntry stuff from the current implementation.

Bug: 304914238
Test: m blueprint_tests
Change-Id: If9d5d992e5e2b0120e017265d2590b1c55152f52
2023-10-30 11:17:16 +09:00
Justin Yun
d578412cf1 Stop using VNDK from product partition
Product modules install required vndk modules in /product/lib[64].
But still the product modules can link to the llndk from system
partition using the list in /system/etc/llndk.libraries.txt.
To install /system/etc/llndk.libraries.txt file, use
llndk_libraries_txt singleton without versioned name.

Until VNDK is fully removed, the vndk apex must install the versioned
llndk.libraries.<ver>.txt file to the vndk apex.
Use llndk_libraries_txt_for_apex singleton for this purpose.

Test: lunch cf_x86_64_phone-next-userdebug; m
Test: atest GtsVndkDependencyTestCases
Bug: 299867815
Bug: 302255959
Change-Id: I058616081fe31597a9b76b772b69927807436896
2023-10-25 14:36:04 +09:00
Jihoon Kang
cc9e2186e2 Fix build configuration dependant Soong test
This change fixes a Soong test that is dependent on the build
configuration (from-source stub build vs from-text stub build) by
setting the test configuration to build from source stub and add
an additional test case configured with build from text stub so
that the expected behaviors of both from-source and from-text
stub builds can be tested.

Bug: 275570206
Test: m nothing && m nothing --build-from-text-stub
Change-Id: I483be27ad3eebbf6af050e80265859919fc28fd8
2023-10-20 09:24:50 +00:00
Justin Yun
ce12ea8f95 Merge "Generate product variants by default" into main 2023-10-04 06:29:31 +00:00
Colin Cross
004bd3f526 Revert "Split Rust crate builds into compile and link phases."
This reverts commit e7c71c344d.
The intermediates created by the separated rust compile steps are very
large, on the order of 60GB.  This is more than CI can support for now,
revert the split into compile and link phases.  This comes at the expense
of incremental build time, especially when modifying C/C++ sources that
are dependencies of rust modules.

Bug: 293349612
Test: builds
Change-Id: I81169e7d0727330c8de5e7688dcdc87fe7b8d3b5
2023-10-02 22:15:55 -07:00
Justin Yun
af1fde43f9 Generate product variants by default
PRODUCT_PRODUCT_VNDK_VERSION is set to 'current' by default. Now, we
can generate product variants without checking the
PRODUCT_PRODUCT_VNDK_VERSION build variable. Remove reading the
PRODUCT_PRODUCT_VNDK_VERSION variable from soong and generate product
variants by default.

Bug: 302255959
Test: m
Change-Id: I9a9b2076f4367c5ce9a393bbb206f8dee3884bd8
2023-09-27 16:36:40 +09:00
Colin Cross
40c7bae1df Merge changes from topics "revert-2629131-sandbox-rust-inputs-JRFPQTIPEY", "revert-2758566-WBNIADIEXA" into main
* changes:
  Revert^3 "add rust_toolchain_rustc_prebuilt module type"
  Revert^3 "add crate_root property to rust modules"
  Revert^3 "allow Ninja variables in RuleBuilder API"
  Revert "conditionally escape rule builder command"
  Revert "support sandboxed rust rules"
  Revert "fix failing rust_aconfig_library test"
  Revert "rustSetToolchainSource to use linux-x86 srcs"
  Revert "remove rust deps on clang prebuilts"
2023-09-23 05:19:13 +00:00
Wen-yi Chu
41326c1f41 Revert "support sandboxed rust rules"
Revert submission 2629131-sandbox-rust-inputs

Reason for revert: Fail on android build.

Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs

Change-Id: Ifd9aa46e80a12d8f4ffa0a2daa74b96727cbb7e6
2023-09-22 22:05:54 +00:00
Jooyung Han
90934ac906 Use assemble_vintf output for vintf fragments in APEX
With aosp/2681229, assemble_vintf modifies the input, instead of
checking. APEX should use the output of assemble_vintf instead of
running it as validation.

Bug: 299034304
Test: m
Change-Id: I9446908e1df85b4f3f89d29ebe9cace3982d7757
2023-09-22 15:47:15 +09:00
Sam Delmerico
52d1cc334b Merge changes from topics "revert-2746976-revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT-KMAGKVIXAT", "sandbox-rust-inputs" into main
* changes:
  support sandboxed rust rules
  conditionally escape rule builder command
  Revert^2 "allow Ninja variables in RuleBuilder API"
  Revert^2 "add crate_root property to rust modules"
  Revert^2 "add rust_toolchain_rustc_prebuilt module type"
2023-09-20 18:48:21 +00:00
Christopher Parsons
c331812a59 Merge "Have ConvertWBp2build use Bp2buildMutatorContext" into main 2023-09-20 17:56:24 +00:00
Chris Parsons
637458d326 Have ConvertWBp2build use Bp2buildMutatorContext
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.

Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
2023-09-20 14:49:35 +00:00
Liz Kammer
9e2a5a7d6d Don't panic for unhandled product vars
Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing

Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
2023-09-19 15:58:22 -04:00
Sam Delmerico
a588d153c8 support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.

Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
2023-09-15 22:46:56 +00:00
Jooyung Han
e615441832 apex: validate vintf fragments in vendor APEX
In Make, vintf fragments are checked with assemble_vintf. Since vendor
APEXes can have vintf fragments, perform the same check with vintf
fragments in APEX.

Bug: 299034304
Test: m test.bad2.com.android.hardware.wifi
  (should fail if its module type is `apex`)
Change-Id: I2f9ed50066b9b499b3562bfa51214c1e375d5747
2023-09-08 21:36:00 +09:00
Jooyung Han
4bc102672a apex: invoke conv_linker_config validate as validation
`conv_linker_config validate` command is used to validate the linker
configuration embedded in APEX to detect common mistakes.

For example, when used in APEX, linker configuration can't set
provideLibs/requireLibs. For APEX, there are
provideSharedLibs/requireSharedLibs in APEX manifest for that purpose.

One might make mistake by setting provideLibs in linker config.
Now, when these unsupported properties are set, there'll be build-time
error like:

 // set provideLibs key in com.android.art's linker config.
 $ m com.android.art
   ...image.apex/etc/linker.config.pb: provideLibs is set. Use provideSharedLibs in apex_manifest

Bug: 264341796
Test: m com.android.art (see above)
Change-Id: Ibaf7322616ad333569e6d721680f3d72243402a2
2023-09-08 15:40:12 +09:00
Kiyoung Kim
86b9b13607 Merge "Temporarily link Vendor APEX with vendor libbinder when VNDK deprecated" into main 2023-09-08 04:21:17 +00:00
Treehugger Robot
8763530dff Merge "android_app APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE" into main 2023-09-07 16:55:45 +00:00
Kiyoung Kim
cbe2ba04b7 Temporarily link Vendor APEX with vendor libbinder when VNDK deprecated
As VNDK is in deprecation, any Vendor APEX which used use_vndk_as_stable
should copy former-VNDK libraries into its own APEX. However, libbinder
is not allowed to create APEX variant, so it should use libbinder_ndk
instead. This change is to temporalily allow Vendor APEX modules link
with libbinder in /vendor/lib, while any Vendor APEX modules using
libbinder transit into libbinder_ndk.

Bug: 296491928
Test: Cheetah build and boot succeeded
Change-Id: I40beb255bab658b75685e78f48e14520058616d6
2023-09-07 16:18:27 +09:00
Sam Delmerico
0e0d96efa7 android_app APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE
Currently the product variable that is controlled by
APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE only overrides apexes, but it
doesn't apply to android_apps. This commit allows android_apps which set
updatable: true in their Android.bp to have their min_sdk_version be
overriden by this product variable.

Bug: 295311875
Test: go test
Change-Id: If3cb82a17cae4553b577dd1a4637ee13c3c95302
2023-09-05 21:38:16 +00:00
Jiakai Zhang
9c60c17fb3 Support adding a library as both a JNI library and a regular library.
Bug: 299087066
Test: m nothing
Change-Id: I6cafe23395b7306727a071ccefe3b189c56e928b
2023-09-05 15:20:53 +01:00
Jooyung Han
138ee09e28 Merge changes from topic "deprecate-zip-apex" into main
* changes:
  apex: Remove host support
  apex: Remove apexPackagingMutator
  apex: Remove 'zip' apex support
2023-08-23 23:48:43 +00:00
Jooyung Han
8d4a1f03b0 apex: Remove host support
Since we no longer support "zip" APEX, we don't need "host" support.

For example, we don't need go/python binary support.

Bug: 279835185
Test: m
Change-Id: I6e8d2b205e42662f31866dc9ac7507524effd144
2023-08-23 14:01:21 +09:00
Jooyung Han
a0503a51a0 apex: Remove apexPackagingMutator
Bug: 279835185
Test: m
Change-Id: I2f5293a5a86d2ea66c1107659abc2e746fe2775e
2023-08-23 14:01:17 +09:00
Jooyung Han
06a8a1c384 apex: Remove 'zip' apex support
zip apex is no longer supported.

Bug: 279835185
Test: m
Change-Id: I651b0dc4e0efe766f61e97b1e5dd263e0ab74102
2023-08-23 14:01:13 +09:00
Cole Faust
d22afe96d7 Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS
We want to make FULL_SYSTEMIMAGE_DEPS more accurate so that we can
remove the need for `m installclean`.

Currently, the compat symlinks are installed by adding them as
dependencies of other installed files. Doing this doesn't end up
propagaing the compat symlinks all the way to FULL_SYSTEMIMAGE_DEPS.

Add them to LOCAL_SOONG_INSTALL_SYMLINKS, which will cause them to
be propagated to FULL_SYSTEMIMAGE_DEPS.

Bug: 205632228
Test: Full build with a change to delete files not in FULL_SYSTEMIMAGE_DEPS from the staging dir
Change-Id: Idc7fc0a0dbf7c8ac3f0628c16413cd1df69a7821
2023-08-22 11:59:07 -07:00
Chun-Yi Lee
516a188206 Merge "Revert "Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS"" into main 2023-08-22 02:11:23 +00:00
Chun-Yi Lee
0a693c5b5c Revert "Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS"
Revert submission 2718295-colefaust_track_apex_compat_symlinks

Reason for revert: To validate if this change is causing the build breakage.

Reverted changes: /q/submissionid:2718295-colefaust_track_apex_compat_symlinks

Change-Id: I1896530219cf984efdf9ca7f4b14d8784367f242
2023-08-22 01:18:45 +00:00
Cole Faust
f36d157ce7 Merge "Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS" into main 2023-08-21 21:54:37 +00:00
Cole Faust
b23d574655 Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS
We want to make FULL_SYSTEMIMAGE_DEPS more accurate so that we can
remove the need for `m installclean`.

Currently, the compat symlinks are installed by adding them as
dependencies of other installed files. Doing this doesn't end up
propagaing the compat symlinks all the way to FULL_SYSTEMIMAGE_DEPS.

Add them to LOCAL_SOONG_INSTALL_SYMLINKS, which will cause them to
be propagated to FULL_SYSTEMIMAGE_DEPS.

Bug: 205632228
Test: Full build with a change to delete files not in FULL_SYSTEMIMAGE_DEPS from the staging dir
Change-Id: I0600ccf8d863d5e29e044c82293ece730fc98d43
2023-08-18 16:05:44 -07:00
Alex Buynytskyy
655ad9a236 Merge "Ignore some prebuilt vndk libs for trunk-stable next" into main 2023-08-18 17:51:23 +00:00
Justin Yun
f14beafb7c Ignore some prebuilt vndk libs for trunk-stable next
Source tree may include prebuilt vndk snapshot libs that are newer
than or equal to the PLATFORM_VNDK_VERSION.
Ignore those prebuilt vndk snapshot libs.

Bug: 296488609
Test: lunch cf_x86_64_phone-next-userdebug; m nothing
Change-Id: I3adaf3b7636f53884f08540959d2ec2fddfb6921
2023-08-18 18:01:08 +09:00
Kiyoung Kim
a2d6deedab Relocate llndk.libraries.txt into system
llndk.libraries.txt file is currently located within the VNDK APEX.
However, this file is still required even if VNDK APEX is deprecated.
This change removes llndk.libraries.txt from VNDK APEX, so it can be
installed within the system image.

Bug: 290160925
Test: aosp_cf build succeeded with llndk.libraries.txt in the system
image

Change-Id: I09a0a43babaa58ff16fc04ea71ab41ab68b54b70
2023-08-16 10:03:16 +09:00
Vinh Tran
4eeb2a9514 Remove dylibs prop from rust module types
For device build, rust defaults to dylib linkage for rustlibs deps. `dylibs` prop was provided for flexibility.

By removing it, we're enforcing users to either use the default linkage (dylibs for device and rlibs for host) or rlibs prop explicitly. This means no dylibs for host modules. This makes sense because host modules always uses rlib linkage against libstd. The flexibility with dylibs prop opened room for linkage collisions because the dependencies don't link against libstd the same way.

Test: go test
Change-Id: I2fc221daa8a9bb42bdcf6d9823c723a4ddabe7b5
2023-08-14 14:03:28 -04:00
Jooyung Han
4ed512b3c7 apex: respect relative_install_path of rust modules
Bug: 295453836
Test: m
Change-Id: I0637d13f6f87fead3cf53a093d9ce84dea681a08
2023-08-11 16:32:58 +09:00
Treehugger Robot
abe5e13b9f Merge "add override_apex to version_variant test" into main 2023-07-31 20:36:07 +00:00
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