summaryrefslogtreecommitdiff
path: root/android/apex_contributions.go
AgeCommit message (Collapse)Author
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
2024-10-30Make all_apex_contributions a regular module Cole Faust
It was not using any of the capabilities of a singleton module, and I think the fact that it's a singleton module is causing issues for the base configuration change. This is also the last singleton module in the tree, we might be able to remove them after. Bug: 361816274 Bug: 370379708 Test: m nothing --no-skip-soong-tests Change-Id: I6193d77837f2e55f7fb6bc41135c8f82fd506c73
2024-08-05Hide unflagged mainline prebuilts with missing source. Spandan Das
Partner worksapces contain two versions of mainline prebuilts - BigAndroid and Go. These two prebuilts export dexpreopt'd system server artifacts to be installed in system image. Since the install paths are same, we run into duplicate installation rules issue unless one of them is hidden. This hiding was previously done by creating a dependendency between source aosp apex to BA and Go google prebuilts. However, this implementaion had the unfortunate side effect on the packaging name of the Google mainline prebuilts - the name becomes the aosp apex name. Instead of creating the dependency to aosp apex, this CL hides all mainline apex_set(s) if it has not been flagged using RELEASE_APEX_CONTRIBUTIONS_*. Since there are some non mainline apex prebuilts, apex_name will be used to determine whether the prebuilt is a mainline module. Test: m nothing --no-skip-soong-tests Test: In partner workspaces, downloaded the CLs in b/355682304#comment7 Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt verified that aosp apexes are not installed, but mainline prebuilts are installed Test: unset RELEASE_APEX_CONTRIBUTIONS_ADSERVICES to build from source Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt verified that aosp adservices is installed, and adservices prebuilt is **not* installed. Bug: 355682304 Change-Id: Idacb65313553bdea5c0593976694de478034229e
2024-05-30Handle missing apex_contributions Spandan Das
Some minimal branches have v/g_s/build/release (where apex_contibutions have been set to mainline prebuilts), but not v/g/b (where the apex_contributions for prebuilts have been defined). These minimal branches are unsuitable for building a product that consume mainline prebuilts, but they would still like to do aosp product builds. aosp products should not use the mainline prebuilts anyways, but this has been implemented as - always create the dependency edge to the selected apex contributions - do not visit the dependency edge subsequently if IgnoreApexContributions is set set to true To support aosp product builds in minimal branches, this CL updates the implementation to skip creating the dependency edge when IgnoreApexContributions is set to true Test: go test ./android Change-Id: Iaa0971760e64f9b7a03542f179231ce2268b6616
2024-05-08Merge "Revert^2 "Remove compilation actions from java sdk library"" into main Treehugger Robot
2024-05-08Revert^2 "Remove compilation actions from java sdk library" Jihoon Kang
This change modifies the build actions of java_sdk_library module type so that it does not perform any compilation actions (i.e. does not create the top level java_sdk_library jar file). Instead, it delegates the build actions the top level jar file was performing to the dynamically created ".impl"-suffixed java library module. The build actions that are delegated to the impl library module include hiddenapi processing, dexing, and dexpreopt. This change relands https://r.android.com/3035972. Implementation changes from the original change: - "all_apex_contributions" is added as a dependecy to the implementation library modules where the parent sdk_library module has a prebuilt equivalent. This allows the source apex variant to be hidden from make when the prebuilt is active. Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing Test: m nothing --no-skip-soong-tests Bug: 332785297 Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257
2024-04-29Move coverage builds prebuilt special case to make Spandan Das
Having this in make has the following advantages - allows this to be used in other places in make that are sensitive to prebuilt selection, e.g. apex boot jars that are present in source but not in prebuilt apexes - collocates the various prebuilt special edge cases Test: presubmits Test: in internal, lunch cf_x86_64_phone-next-userdebug Test: EMMA_INSTRUMENT_FRAMEWORK=true get_build_var PRODUCT_BUILD_IGNORE_APEX_CONTRIBUTION_CONTENTS true Bug: 308188056 Change-Id: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde Merged-In: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde
2024-04-03Convert BuildIgnoreApexContritbutions variable to a boolean Spandan Das
(This relands aosp/3007754. The previous sdk build failures have been resolved now) The ignore list is burdensome to maintain once we start adding the module sdk contents to apex_contributions. Convert the variable to a boolean. When set to true, all contents in `apex_contributions` will be ignored Bug: 308187268 Test: m nothing on aosp,google and google_fullmte devices Merged-In: Ibdd1e0d0d4f08f4f5251b9c4baa1aaf42e7df34f (cherry picked from commit f3df7305d653471c70d131177e773b4723247e3a) Change-Id: I9d57d899c6a9a321e2eb3579c954641f2cb04709
2024-03-22Revert "Convert BuildIgnoreApexContritbutions variable to a boolean" Android Culprit Assistant
This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/53721efb-c49e-4ce8-b96c-fd03598b4202). Change-Id: I197b03b650bc6c22ff3c5eb9605522fd9650e98f
2024-03-21Convert BuildIgnoreApexContritbutions variable to a boolean Spandan Das
The ignore list is burdensome to maintain once we start adding the module sdk contents to apex_contributions. Convert the variable to a boolean. When set to true, all contents in `apex_contributions` will be ignored Bug: 308187268 Test: m nothing on aosp,google and google_fullmte devices Ignore-AOSP-first: CL topic does a cleanup of an internal only denylist Change-Id: Ibdd1e0d0d4f08f4f5251b9c4baa1aaf42e7df34f Merged-In: Ibdd1e0d0d4f08f4f5251b9c4baa1aaf42e7df34f (cherry picked from commit f3df7305d653471c70d131177e773b4723247e3a)
2024-03-12Merge "Add defaults support for apex_contributions module type" into main Treehugger Robot
2024-03-06Add defaults support for apex_contributions module type Spandan Das
Bug: 326246905 Test: go build ./android Change-Id: I8be21594465d81c99c216b0fcbf9996aed46c209
2024-02-26Ignore prebuilt apex_contributions in coverage builds Spandan Das
This CL unsets the prebuilt contents of a selected apex_contribution in coverage builds. The effect of this will be that mainline modules will be built from source with the following in coverage builds 1. Instrumentation turned on 2. RELEASE_ACONFIG_VALUE_SETS for that release config Test: Added a unit test Test: lunch cf_x86_64_phone-next-userdebug && EMMA_INSTRUMENT=true m nothing (with ag/26298763) Bug: 325666427 Change-Id: Ic4e1f0612072377261602842dfd303c064095035
2024-02-17Revert "Revert "Create a product variable for skipping apex cont..." Spandan Das
Revert submission 2966055-revert-2964509-skip-apex-contributions-EOKWOFHENC Reason for revert: The root cause CL has been reverted https://googleplex-android-review.git.corp.google.com/c/platform/vendor/google/build/+/26268799 Reverted changes: /q/submissionid:2966055-revert-2964509-skip-apex-contributions-EOKWOFHENC Change-Id: I93e8f60124a09b4fba4675ac7f128ab553102bf7
2024-02-16Revert "Create a product variable for skipping apex contribution..." Jihoon Kang
Revert submission 2964509-skip-apex-contributions Reason for revert: 325666427 Reverted changes: /q/submissionid:2964509-skip-apex-contributions Change-Id: I510e81c8e06803dc014c9f04c3e357065aa19ce5
2024-02-15Create a product variable for skipping apex contribution contents Spandan Das
This denylist will be used to ignore the prebuilt google apexes listed in apex_contributions of vendor/google/build when building aosp products in next. Test: go build ./android Bug: 308187268 Change-Id: Ib2c018a2aeda5578cf3f1a6a56253bf84850ba5f Merged-In: Ib2c018a2aeda5578cf3f1a6a56253bf84850ba5f
2024-01-11Handle installation rules for co-existing prebuilts Spandan Das
Every module belonging to a single mainline module family will be hidden from make, except the one which has been flagged using apex_contributions Details - Introduce a new `source_apex_name` property to prebuilt_apex and override_apex. This property will be used to identify the source equivalent of a prebuilt soong apex module. - Create an N-ary tree from source to prebuilt(s). The tree wil be rooted at the source module. - In a subsequent mutator, visit every node in the tree(s). Query apex_contributions and store the handle of the node which is "active" (if any) - In the same mutator, do another pass over the tree. Invoke `HideFromMake` on every node which is not "active". The two-pass approach is needed PrebuiltSelectionInfoProvider does not know about the inter source-prebuilt dependency, this dependency can only be known by doing a graph walk of the N-ary tree. Some tangential implementation details - Each prebuilt apex has an internal deapxer module that is responsible for generating the deapex ninja rules. The name of this internal module uses the BaseModuleName (without the prebuilt_ prefix). Since we can have multiple prebuilt soong modules in trunk stable, change this to follow the name of the prebuilt module in order to avoid name collisions. Update existing unit tests accordingly Bug: 316179314 Test: go test ./apex -run TestInstallationRulesForMultipleApexPrebuilts Test: m nothing --no-skip-soong-tests Test: presubmits Change-Id: I58aa99d5e6a9859954614e6db9a8e9e2e581642d
2023-12-19Use the correct prof file when multiple prebuilt apexes exist Spandan Das
Generating boot image requires a .prof file provided by the ART apex. When building with prebuilts, this comes via the prebuilt_bootclasspath_fragment module, which acts as a shim for prebuilt_apex/apex_set. If we have multiple prebuilt apexes in the tree, this shim becomes 1:many. This CL prepares dex_bootjars to select the right .prof file when multiple prebuilts exist. Implementation details - Update deps mutator of dex_bootjars to create a dep on all_apex_contributions. The latter contains information about which apex is selected in a specific release configuration. dex_bootjars will create a dependency on the selected apex in a postdeps phase mutator. - All apex module types (apex, prebuilt_apex and apex_set) will set a provider that contains info about the location of the .prof file on host - dex_bootjars will access the provider of the selected apex to get the location of the .prof file This CL does not drop the old mechanism to get the .prof file (i.e. by creating a dep on {prebuilt_}bootclasspath_fragment). Once all mainline modules have been flagged using apex_contributions, the old mechanism will be dropped Bug: 308790457 Test: Added a unit test that checks that the right .prof is selected when multiple prebuilts exists Change-Id: I40fdb21416c46bed32f6ff187ce5153711ec2c69
2023-12-14Convert SetProvider to generic providers API Colin Cross
Convert all of the callers of SetProvider to use the type-safe android.SetProvider API. Bug: 316410648 Test: builds Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
2023-12-14Convert NewProvider/NewMutatorProvider to generic providers API Colin Cross
Convert all of the callers to NewProvider and NewMutatorProvider to use a generic type parameter instead of an example object. Bug: 316410648 Test: builds Change-Id: Ic9cdafc87336e26730d3fd596df05de0e7267542
2023-12-08Remove infrastructure to run bp2build Colin Cross
Bug: 315353489 Test: m blueprint_tests Change-Id: Idcf6377d389b94c39e4e6ff4b8efa8a9f9e78b17
2023-11-17Skip error check if allow missing deps is true Spandan Das
Fixes: 311711411 Test: will use go/abtd Change-Id: I6df6c679e3f122bbca317d16f89cca2ffc982794
2023-11-08Create a singleton all_apex_contributions module type Spandan Das
This will be a container for the the apex_contributions selected using build flags. This module will be used to query the state of selected apex contributions instead of a global that can be mutated by anyone. It will set a provider containing metadata for source vs prebuilts selection. To reduce the overhead of a new mutator, this will be done in the existing `prebuilt_select` mutator. It will validate that there are no dups (`foo` and `prebuilt_foo` cannot be both selected) Bug: 308174923 Test: go test ./android Change-Id: Ie42999a71f35d70e0e977f5ab07ce451608d9f35
2023-11-03Create an apex_contributions module type Spandan Das
This module type does not any build actions, but provides metadata about the contributions of the mainline module to other mainline modules/ platform. One immediate use case for this metadata is source vs prebuilts selection Each mainline module can have more than 1 metadata modules. Static build flags will be used to select the right one in trunk.bzl, next.bzl, ... Bug: 308174923 Test: go build ./android Change-Id: I5ead0c38fe64b78de08db1736d97a8ab7374d6d9