summaryrefslogtreecommitdiff
path: root/apex/apex.go
AgeCommit message (Collapse)Author
2025-03-18Don't emit tests in AndroidMkForFiles Cole Faust
I'm moving the installation of test files to soong. Marking a make module as a test will make Make start expecting more soong-built test files. But the apex rules won't generate these files for their pseudo-modules representing files inside the apex. So instead, just make those modules not tests. Bug: 388850000 Test: Presubmits Change-Id: I9c7d3980beac8d7ad2d758ba99e8ec6895c25f06
2025-03-13Change CommonModuleInfoProvider to a pointer. Yu Liu
Bug: 358427516 Test: Manually verified genereated ninja and mk files, unit tests. Change-Id: I53a6dd718232735decbeb93febfd269dd9449e86
2025-03-07Convert WalkPayloadDeps to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: If0d132c2310eb958c066747f9c16251cc24fedd0
2025-03-07Rename CommonModuleInfoKey to be consistent with others. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I1ce8bc782666586633ded9cfaf1b9590e3c0efde
2025-03-06Create apkcerts.txt using Soong Spandan Das
This CL creates an apkcerts.txt of the apps installed on the device, and any apk-in-apex of installed apexes. Note that this behavior is unlike make. There is some ongoing discussion on whether the make behavior can be updated to only list the installed apps as well. To implement this, androidDevice will consult the following providers from the list of installed modules - AppInfoProvider (android_app, android_app_import, ...) - AppInfosProvider (for apk-in-apex) - RuntimeResourceOverlayInfoProvider (for checked-in and autogen rros) Test: With https://r.android.com/3529333, apkcerts.txt is identical for aosp_cf_x86_64_phone between make and soong Bug: 399788149 Change-Id: I10009ea8761a197dd2301acf9615079bd28af3f5
2025-03-03Merge "apex: disallow VINTF fragments in updatable APEX" into main Jooyung Han
2025-02-28Merge changes from topics "EqualModules", "tidyPhonySingleton" into main Yu Liu
* changes: Convert tidyPhonySingleton, jdepsGeneratorSingleton and genNoticeBuildRules to use ModuleProxy. Make EqualModules a free function.
2025-02-27apex: disallow VINTF fragments in updatable APEX Jooyung Han
Since libvintf doesn't support forward compatibility, updatable APEXes shouldn't have VINTF fragments. Bug: 399527905 Test: m nothing --no-skip-soong-tests Change-Id: Ie0f1b4599f27d9aa478aac689dd167e77b3733b8
2025-02-27Generate META/apexkeys.txt Spandan Das
This file contains information about public/private keys of _installed_ apexes Details - In GenerateAndroidBuildActions of apexBundle, prebuiltApex, apexSet, set a provider with the filepath of the apex's key information - In GenerateAndroidBuildActions of androidDevice, iterate over `allInstalledModules`. If a module has a provider with ApexKeyInfo, it will be concatenated to META/apexkeys.txt Test: verified that META/apexkeys.txt is identical between make and soong Bug: 388633394 Change-Id: I7ac40839c0dfb6a7efabad6a8ff51f30ed393b68 Change-Id: I97c8cf82186ab47ed3ff2a647bf592a96a53b5e4
2025-02-26Make EqualModules a free function. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7e00f09a15f2857f58bea70bcedc4798630a40bc
2025-02-25Convert ndkSingleton, apexDepsInfoSingleton, allTeamsSingleton, Yu Liu
apexPrebuiltInfo to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I77b05e8b54843bfa8b91376a6796c2b5c69be3c1
2025-02-23Merge "Remove apex.use_file_contexts_as_is" into main Jooyung Han
2025-02-19Change depVisitor to use providers instead of type-asserting to Yu Liu
interfaces directly, the next step is to change it to use ModuleProxy once IsDepInSameApex is ready. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I13a4e256a26dbf7f9b3b746d628ac8f68b4e598e
2025-02-13Support DepIsInSameApex using provider. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I8ec5e8a3a06d078602ebaa902cacb70987f1deda
2025-02-12Merge "Install VINTF fragment modules in the APEX" into main Treehugger Robot
2025-02-10Convert android.TransitionMutator to TransitionInfo Colin Cross
Use the ApexInfo instead of a string as the TransitionInfo for apex variations. This removes the need for apexInfoMutator, which is the last remaining top down mutator. This has a variety of ramifications. One is that it is no longer possible to add a dependency onto the apex variation of a module, as that would require constructing a matching ApexInfo. Instead, anything that wants to add a dependency on the apex variation has to depend on the apex instead, and get to the module by walking its transistive dependencies. Another ramification is that modules in apexes can no longer determine which apexes they are in (unless they set UniqueApexVariations so that each variation is in exactly one apex). This prevents some of the existing container violation checks from working after this CL, tracked in b/394955484. It also requires using unique variation names for the prebuilt and source dependencies of apexes, so the apex variations for dependencies of prebuilts now have a prebuilt_ prefix. Bug: 372543712 Bug: 394955484 Test: go test ./... Change-Id: I3d08aca1ac956ab0e343ec3f235a736cd93be0e1
2025-02-10Install VINTF fragment modules in the APEX Kiyoung Kim
Currently APEX ignores vintf_fragments modules within the APEX, and all VINTF fragments are installed with prebuilt_etc modules. This change installs vintf_fragment modules in the APEX, so any additional prebuilt_etc modules are not required as long as binaries define vintf_fragment_modules references. Bug: 363105686 Test: AOSP CF x86_64 build succeeded Change-Id: I33b58178cd51dc2c4bb9226fdd68e7990dccd6a2 Merged-In: I33b58178cd51dc2c4bb9226fdd68e7990dccd6a2
2025-02-07Convert apex transition tag to dependency on apex Colin Cross
When the apex mutator moves to using an info struct instead of a simple string it becomes difficult to add a dependency directly on the apex variation of a module, as that would require constructing a matching ApexInfo to locate it. Simplify adding the dependency by adding it on the apex instead, and then traversing from the apex to the desired module inside the apex. This causes a few changes in behaviors that require updating tests to match. When AlwaysUsePrebuiltSdks is set, the previous behavior was to use the fragment and its dependencies from the source module for the platform bootclasspath. Since the fragment is now found by traversing from the apex, and the prebuilt apex is preferred, the fragment from the prebuilt will now be found instead. prebuilt_bootclasspath lists fragments in apexes that it depends on. Previously it would depend on the apex variant of the fragment, which then allowed the fragment to be replaced by the variant from an override apex that set apex_name. Now it always depends on the original apex to find the fragment. Test: go test ./... Bug: 372543712 Change-Id: I1a92ff461d4706cf68a0b8b37e53dea412efb8bf
2025-02-07Add extra dependency from apex to bootclasspath fragments to modules Colin Cross
An extra dependency from apex modules to their bootclasspath fragments and from bootclasspath fragments to their contents is necessary, as the existing one with bcpfTag return false from ReplaceSourceWithPrebuilt to never rewrite the dependency to the prebuilt fragment, and we'll need a dependency to the prebuilt fragment in the next CL. Bug: 372543712 Test: all soong tests pass Change-Id: I87ff3afa0d5c90936664dd493654f1d64230b8a9
2025-02-07Move prebuilt mutators earlier Colin Cross
Move the prebuilt mutators from postdeps to predeps mutators. This ensures that the decisions on whether the source or prebuilt will be used can be made earlier, which simplifies the apex and dexpreopt code, allowing it to directly depend on the correct module. This requires some mutators that previously ran before the prebuilt mutator and now run after the prebuilt mutator be aware of prebuilts. In particular, the cc.linkageTransitionMutator and rust.libraryTransitionMutator now have to manually disable prebuilts when they don't produce a static or shared variant that the source module produces, and some mutators have to ignore PrebuiltDepTag dependencies when propagating transitions. The apexTransitionMutator also needs to temporarily use an interface on the dependency tag to correctly resolve some dependencies that exist before the apex variation is created onto the correct variation. This will shortly be replaced with depending on the apex itself instead, and then walking the dependencies of the apex to find the necessary module. Bug: 372543712 Test: go test ./... Change-Id: If125ea981be87673bae3bd0a7e3b2c16c337e8f7
2025-02-03Correctly compute externalDep for dependencies of override_apex modules Colin Cross
The externalDep computation in WalkPayloadDeps was comparing ctx.ModuleName() against InApexVariants, but override_apex modules create an extra variation of the base apex, so ctx.ModuleName() doesn't match the apex variation name. Use the override name instead of the module name for override apex variations. Bug: 372543712 Test: go test ./apex Change-Id: If7a92ca0034bb37f6b0fc7b194ea55c918469d08
2025-02-03Remove extraneous variation name from OverrideApex Colin Cross
Apexes use an empty variation name for themselves, and only set an extra variation string for dependencies. OverrideApex is setting the variation name for itself, which doesn't match apexes and is unnecessary. Test: go test ./apex Change-Id: I6e726c497ccf10f145cda149bd19849fd22dd20b
2025-02-03Move installation of dexpreopted system server classpath libraries into apex Colin Cross
System server jars in apexes currently use a heuristic to determine whether or not they are the "main" variant in order to create rules that copy their dexpreopt artifacts to the final installed location and their dex jars to a known location for other modules to reference. The heuristic depends on knowing all apexes that depend on the module, which will not be possible when the apex info mutator is rewritten to support future incremental analysis. Instead, export the dexpreopt artifacts and dex jars, and let the apex decide whether or not to install them. Bug: 372543712 Test: all soong tests pass Change-Id: I478bc2edceca4614e08e9a695b05d091e5437ba1
2025-01-17Allow libz to be statically linked from APEXes Jiyong Park
libz is in a special position in NDK. Read the comment around the code for more detail. Bug: 389067742 Test: add `static_libs: ["libz"]` to a random APEX Change-Id: Ib4241df7880fcad386dd4530fea0bbc4b3f1e1c5
2025-01-13Remove apex.use_file_contexts_as_is Jooyung Han
It was a workaround to build a vendor apex which needs to read apex_manifest and run on SDK 34, which doesn't have vendor_apex_metadata_file yet. Vendor_apex_metadata_file is available since SDK 35, we can remove the workaround. Bug: 388964457 Test: m --no-skip-soong-tests Change-Id: Iad91bee7c689c96322e342485301152739baa92a
2025-01-10Refactor cc/rust to prep for Rust stubs Ivan Lozano
This CL largely handles this refactoring in preparation for Rust stubs support. Rust modules need to be able to communicate stubs information to cc, and certain bits of cc needs to be exported so rust can reuse them. A new VersionedLinkableInterface is added to capture most of the stubs-related interface definitions. Bug: 203478530 Test: m blueprint_tests Change-Id: I380225402fa85a3c39e7b18deb657054b3a52fbe
2025-01-10Merge changes Ie3b6d1f8,Id465f293 into main Yu Liu
* changes: Convert CollectAllSharedDependencies to use ModuleProxy. Convert depsToPaths to use ModuleProxy for both cc and rust.
2025-01-08Convert depsToPaths to use ModuleProxy for both cc and rust. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Id465f293c3615fc803b34c990f19b4386ebece1c
2025-01-08[bt] Add the Google module in pixel image William Escande
Flag: EXEMPT adding Google module to build is not flagged Test: presubmit Test: m then flash device then check Bluetooth version & functionality Bug: 383863941 Change-Id: I7cd578a9afa253c44278574dd5c31b8a67eb5458 Merged-In: I7cd578a9afa253c44278574dd5c31b8a67eb5458 (cherry picked from commit 534b6ad4b4086271aa2d245c6568b6594947bae6)
2025-01-03Merge "Introduce a singleton module to collect apex certs" into main Treehugger Robot
2024-12-19Merge "Remove TestApexes from ApexInfo" into main Colin Cross
2024-12-18Introduce a singleton module to collect apex certs Spandan Das
`all_apex_certs` will provide two kinds of output files: 1. x509 certificate in pem format 2. x509 certificate in der format filenames of the certs are not part of `all_apex_certs` api. In fact, the der certs will be named with int indexes. This singleton module will be used by `CtsSecurityTestCases` (specifically `PackageSignatureTest`) to enforce that the apexes are signed with release keys. To implement this, `ctx.ReverseDepenendcy` will be used in deps mutator of apex. An alternative would have been to use `ctx.VisitAllDeps` in `GenerateAndroidBuildActions` of the singleton, but this would make it unusable in the cts test (circular dep). Make has a similar implementation that collects the certs of apexes and dists that file. This has been kept separate for now to prevent b/304914238 Bug: 329299639 Test: m nothing --no-skip-soong-tests Change-Id: I742d8ae1ccc344a78ae04263382750508b2aedec
2024-12-12Remove TestApexes from ApexInfo Colin Cross
TestApexes is used to enforce the "Stub libraries should have a single apex_available" check, but requires propagating information from multiple apexes in order to filter out the test apexes. Instead, all test apexes used by stub libraries will set apex_available_name to masquerade as their non-test counterpart for apex_available checks. Bug: 383592644 Test: TestStubLibrariesMultipleApexViolation Change-Id: I57dcf1e6fabbe70f40d702490b93fc7f28d6eba2
2024-12-11Split DepIsInSameApex into outgoing and incoming am: f7bbd2fe40 Colin Cross
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3393290 Change-Id: Ia514f6b2e0bdc19f55a702d5942e8f7c909b44a4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-11Split DepIsInSameApex into outgoing and incoming Colin Cross
Prepare for calling DepIsInSameApex from the apex transition mutator by splitting all the implementations in two, one that is called on the outgoing module and only takes the depTag, and one that is called on the incoming module and only takes the depTag. apexBundle.depVisitor was passing the child into android.IsDepInSameApex for both the parent and child paramters. The parent field was only used to find the type on which to call DepIsInSameApex, so this effectively used the child's implementation of DepIsInSameApex. That used to be necessary when the parent and child were of different module types, as the parent module type may not have been aware of the rules for the child module type, but is no longer necessary with split outgoing and incoming DepIsInSameApex. Bug: 372543712 Test: all soong tests pass Change-Id: If7c81ec3f7b1ea69d77e9ad7694e238820194e59
2024-12-11Merge "Convert checkApexAvailability to use ModuleProxy." into main am: ↵ Yu Liu
c4179b5f7f Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3400526 Change-Id: I1baae4c7e131522be7cc95440c948b58c16db6f6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-10Convert checkApexAvailability to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7582db8e22e94d0a9db7715a76bb6ed34c166a4e
2024-12-10Merge changes I0bf0c186,I859cd636,Ie438d7a7,I30f82aea into main am: d29a1a83c2 Colin Cross
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3393287 Change-Id: I866c8fbec06b9b66c02cbd13f8a33d35b0c5df03 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-09Convert WalkPayloadDeps from blueprint.Module to android.Module Colin Cross
All modules in Soong are now android.Module, there is no need to use blueprint.Module. Test: builds Change-Id: I859cd6360732e3d195a634736ec515d240323f29
2024-12-09Remove AlwaysRequireApexVariantTag Colin Cross
Nothing implements AlwaysRequireApexVariantTag, remove it. Bug: 372543712 Test: builds Change-Id: Ie438d7a79e171f398b36ce1938249eb3145fcc9b
2024-12-06Merge "Convert checkStaticLinkingToStubLibraries to use module proxy." into ↵ Yu Liu
main am: 495661b97b Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3356482 Change-Id: Iec67b50ae0fbc6c3e091b9abf8d571030efe68f8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-05Convert checkStaticLinkingToStubLibraries to use module proxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Id776727a431f2ce8fd4c7b352dc0bd282ac57f90
2024-12-04Merge changes from topic "verifyNativeImplementationLibs" into main am: ↵ Yu Liu
9585f8e849 Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3390959 Change-Id: I12facdeaa707fe78d9cea7e18371b0603cb4df15 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-03Merge "Change enforceAppUpdatability to use ModuleProxy." into main am: ↵ Yu Liu
7bc5be9e10 Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3390009 Change-Id: I34d7108b96767ba617f5fe964aff7683a307eb25 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-03Change verifyNativeImplementationLibs to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Ia149faa118dd5a089291c94caf279f3ef0a093f0
2024-12-03Change enforcePartitionTagOnApexSystemServerJar and Yu Liu
provideApexExportsInfo to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: If00ec9ce1a7676a98c34548e4344528dd0785692
2024-12-03Merge "Change checkJavaStableSdkVersion to use ModuleProxy." into main am: ↵ Yu Liu
820ab8b5f3 Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3390004 Change-Id: If33b7359335f214aa9825ade2ac40df0fa349719 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-03Change enforceAppUpdatability to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I9113916e2124bc22a3d492dbe092a60e8809ab99
2024-12-03Change checkJavaStableSdkVersion to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I221f4ea7479d512d49cfb40a8cb06bba62ec2c7a
2024-11-27Merge "Do not propagate transitive required deps of apexes" into main am: ↵ Spandan Das
f4fa5450f6 Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3375510 Change-Id: I7f678eb347bebfd8a4bc12b167329bc8bcf8d3e0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>