summaryrefslogtreecommitdiff
path: root/android/container.go
AgeCommit message (Collapse)Author
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-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-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-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-01-23Convert container and sh_binary to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Ie2d9d91deebacd8fa0504e628b59ec254f839738
2025-01-08Convert install and checkContainerViolations to use ModuleProxy. Yu Liu
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I19ec2142415e88d7486ee58613065f8cdb6aca73
2025-01-02Remove framework-minus-apex_jarjar-sharded Makoto Onuki
This module was only for verifying the sharded version locally. Now that the sharding has been enabled on f-m-a for a while with no issues, we no longer need it. Fix: 383559945 Flag: EXEMPT The module in question isn't used. It was only for local testing. Test: Treehugger Change-Id: I68b743cb04a972884dad5b5e8f581f541a68ce73
2024-12-12Support jarjar sharding Makoto Onuki
- If the new option `jarjar_shards` is set, use this as the number of shards and enable sharding. - The plan is to use it on "big" jars such as framework-minus-apex, but for now, we only use it in a "test" target, `framework-minus-apex_jarjar-sharded`. - Also add `framework-minus-apex_jarjar-sharded` to the various hardcoded spacial cases. Test: m framework-minus-apex framework-minus-apex_jarjar-sharded and make sure the javac output jars have the same entries. $ diff \ <(jar tf $ANDROID_BUILD_TOP/out/soong/.intermediates/frameworks/base/framework-minus-apex/android_common/jarjar/framework.jar \ | sort) \ <(jar tf $ANDROID_BUILD_TOP/out/soong/.intermediates/frameworks/base/framework-minus-apex_jarjar-sharded/android_common/jarjar/framework-minus-apex_jarjar-sharded.jar \ | sort) (no output) Bug: 383559945 Flag: EXEMPT New options are not used on production jars Change-Id: I94c2ad978add25267f22b65c063e9148901b208b
2024-11-22Merge "replace aconfig_storage_reader_java to aconfig_storage_stub" into main Zhi Dou
2024-11-21replace aconfig_storage_reader_java to aconfig_storage_stub zhidou
This change replace aconfig_storage_reader_jave to aconfig_storage_stub. The former library is a normal java library, while the later is a stub library. Since we only need to provide the symbols here, the stub library is safer. Test: presubmit Change-Id: I1c098cf7ad4c0ec0d5f0b13089f04598b8f81fc3
2024-11-20Remove InApexModules Colin Cross
The only use of InApexModules was a container check that verified that apexes didn't depend on non-stubs modules from outside the apex. Switch it to InApexVariants for now, although that will also need to be removed. Bug: 372543712 Test: builds Change-Id: I822e982e3e8767dc251c8341de9f40373982c6ed
2024-09-27Remove blueprint.Module helper functions Colin Cross
Now that blueprint_go_binary modules are wrapped in a module type that implements android.Module Soong should never see a blueprint.Module. Remove the versions of the context methods that allow working with blueprint.Modules. Genrules still need VisitDirectDepsAllowDisabled, as they use a hack that adds dependencies on host tools after the prebuilts mutators have run, which means they may have a dependency on a disabled prebuilt and need to manually forward it to the corresponding source module. Test: all soong tests pass Flag: EXEMPT refactor Change-Id: I9147b450269749326e8fe75c5af310bd2d898d8c
2024-08-30Merge "Revert^4 "Implement detecting container violations."" into main Jihoon Kang
2024-08-29Merge "Add aconfig_storage_reader_java to the global container violation ↵ Treehugger Robot
allowlist" into main
2024-08-29Add aconfig_storage_reader_java to the global container violation allowlist Jihoon Kang
The module is implicitly added as a dependency for all java_aconfig_library modules, but does not generate the stubs. Test: CI Bug: 338660802 Change-Id: I6ef0f5f5f445e6f70debc3f79e3fd81ed2331366
2024-08-29Revert^4 "Implement detecting container violations." Jihoon Kang
This change introduces a method to detect violating inter-container dependencies between modules. The method is run in `ModuleBase.GenerateBuildActions`, after the container info provider is set. Given that the provider of the direct dependencies would have been set at this time, the method utilizes this information to determine the violations, which are introduced in https://r.android.com/3141104. Note that this enforcement does not turn all inter-container dependencies as errors. Instead, it will only turn dependencies that matches the pre-defined violations into errors. Even if the dependency matches the violation, an error will not be thrown if the dependency satisfies any of the exception functions (e.g. the dependent module is stubs, or the two modules belong to the same apexes). Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: Ib9ddc0761fa46f1309b1a1a4f759d9a4e04fd70e
2024-08-29Merge "Remove containersInfo, complianceMetadataInfo and aconfigFilePaths ↵ Yu Liu
from ModuleBase." into main
2024-08-28Revert^3 "Implement detecting container violations." Priyanka Advani (xWF)
2a88491afc72707c21a125b81f7dcd252d2fc5f1 Change-Id: Iba4527f391a093703978fe01177b56fec4604b28
2024-08-28Revert^2 "Implement detecting container violations." Jihoon Kang
This change introduces a method to detect violating inter-container dependencies between modules. The method is run in `ModuleBase.GenerateBuildActions`, after the container info provider is set. Given that the provider of the direct dependencies would have been set at this time, the method utilizes this information to determine the violations, which are introduced in https://r.android.com/3141104. Note that this enforcement does not turn all inter-container dependencies as errors. Instead, it will only turn dependencies that matches the pre-defined violations into errors. Even if the dependency matches the violation, an error will not be thrown if the dependency satisfies any of the exception functions (e.g. the dependent module is stubs, or the two modules belong to the same apexes). Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: Ia693c4a53369c757a3e96656a769405c759b111c
2024-08-28Revert "Implement detecting container violations." Satish Yalla
This reverts commit bb678f82d6bb5cd89bf282e88a879123d9763d61. Reason for revert: Droidmonitor created revert due to b/362639013. Will be verifying through ABTD before submission. Change-Id: I1dcb71672eeb44a17cf176d3731bcaf9aaf81edf
2024-08-28Remove containersInfo, complianceMetadataInfo and aconfigFilePaths from ↵ Yu Liu
ModuleBase. Bug: 358425833 Test: Manually verified all the generated ninja and mk files and CI. Change-Id: I896659491e75bb2eacca93d2e4a83ead50e218d2
2024-08-27Implement detecting container violations. Jihoon Kang
This change introduces a method to detect violating inter-container dependencies between modules. The method is run in `ModuleBase.GenerateBuildActions`, after the container info provider is set. Given that the provider of the direct dependencies would have been set at this time, the method utilizes this information to determine the violations, which are introduced in https://r.android.com/3141104. Note that this enforcement does not turn all inter-container dependencies as errors. Instead, it will only turn dependencies that matches the pre-defined violations into errors. Even if the dependency matches the violation, an error will not be thrown if the dependency satisfies any of the exception functions (e.g. the dependent module is stubs, or the two modules belong to the same apexes). Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: I36e9cd956c5a076a53635be0c6ff27f77725516e
2024-08-27Add jacocoagent to allowlisted dependencies Jihoon Kang
jacocoagent is implicitly added as a dependency in coverage builds, and is not installed on the device. Test: m nothing Bug: 338660802 Change-Id: Icf14ce5f9b0819a3c5fbe74cf1674719859ad5c6
2024-08-16Define unstable container Jihoon Kang
Unstable container marks modules that are static reverse dependencies of "framework-minus-apex". These modules contain unstable implementation details of the platform, and should not be accessed by the CTS tests. Test: m nothing Bug: 338660802 Change-Id: Ia0e1b3070f0f7b2c1b9c27306323e2428d9722ca
2024-08-16Define additional exception functions for container enforcement Jihoon Kang
These exception functions allow restriction to be loosened for some inter-container dependencies. Note that these functions are still no-op. Restriction enforcement will be done in the child change. Test: m nothing Bug: 338660802 Change-Id: I63c7c33e33f271d4c2a84cc6070eb4896e030ab4
2024-08-12Refactor containers Jihoon Kang
Implementation details: - Add documentations - Convert container determiniation logic to function pointers, in order to make addition/deletion of containers more scalable Test: m nothing Bug: 338660802 Change-Id: I4f7a9a027e00584bb895ce8559f621bae1e985f6
2024-07-15Collect container informations Jihoon Kang
This change introduces a method to collect the information of what containers (i.e. api domain, partition, or any custom defined boundaries of interest) the module belongs to. The method is called in `ModuleBase.GenerateBuildActions`. Each container objects defines the following: - name of the container - list of "restrictions", which are the containers that a module that belongs to this container is not allowed to depend on. Each "restrictions" also defines custom rules which allow bypassing the restricted dependency. Each rules are an enum that are mapped to a function, given that functions are not hashable and thus cannot be set as a value in a provider. Note that this change is a no-op, as the container information is only collected for modules that implement the "InstallableModule" interface, which is not implemented by any other module types in this change. This will be utilized in the follow-up changes. Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: I9d16dfec0dcf06da464aa49ee7b23f46f1da236a