Commit Graph

1430 Commits

Author SHA1 Message Date
Spandan Das
ff66518da2 Delete multitree api imports code
The mutltiree workflow has not been in use for a while. This CL cleans
up the code that was added to support multitree.

Details
- Delete cc_api_library, cc_api_headers, cc_api_variant module types.
  These module types contain build rules for prebuilt stub .so and .h
files
- Update the DepsMutator of cc.Module to not create a dependency on a
  sibling cc_api_* module if it exists. e.g. do not create a dependency
on libfoo.apiimports if libfoo is listed in `shared_libs`.
- Remove cc_api_library from the stub/impl selection logic for cc
  modules

Test: m nothing --no-skip-soong-tests
Test: presbumits
Change-Id: Ie194157fb3bbc630f384cdd9b694b0fba6786ded
2024-09-11 19:19:33 +00:00
Treehugger Robot
fae5ec8bbc Merge changes I505a7ad8,I92d88199 into main
* changes:
  Disable source apex variant using apex_available_name
  Skip `contents` validation of source bootclasspath fragments
2024-09-06 06:07:42 +00:00
Spandan Das
003452ff9c Disable source apex variant using apex_available_name
There are two versions of aosp extservices - one for Tplus and one for
Sminus. When prebuilts are active, the `contents` validation of both
variants of extservices bootclasspath fragments should be disabled to
account for BCP jar skew.

This CL adds ApexAvailableName to ApexInfo to achive that. If an
api_domain matching the ApexAvailableName has been selected in
`all_apex_contributions`, the source apex variants will be disabled.

Bug: 361771739

Test: lunch cf_x86_64_phone-next-userdebug
Test: m nothing with ag/28851886
Change-Id: I505a7ad8295c258e2eeef7f183669f7a75a1c88e
2024-09-06 05:10:41 +00:00
Colin Cross
ca3bf2be39 Merge "Move checkbuild targets of Soong modules into Soong" into main 2024-09-04 17:12:03 +00:00
Colin Cross
a6182ab2fa Move checkbuild targets of Soong modules into Soong
Pass the name of Soong's checkbuild target for each module to
Make so that it can depend on it from the main checkbuild rule.
This will give better control over which files get built, allowing
checkbuild to skip the jar combining step when transitive classpath
jars are enabled.  The per-module checkbuild targets are passed to
make instead of added directly as a dependency of checkbuild in order
to maintain the existing behavior of only building modules exposed
to make in checkbuild.

Also tweak the existing calls to CheckbuildFile and add
InstallFileWithoutCheckbuild to match the files that are
in the Make-based checkbuild.

Bug: 308016794
Test: m checkbuild
Change-Id: Ic5140819381d58f4d00f23a7a12447950c4cf268
2024-09-03 14:52:19 -07:00
Jooyung Han
a3fddf40ca Refactor around apex aconfig files (#2)
Aconfig files are treated like other files in APEX. This way, we can
dedup the code hanlding those files (copy commands, fs_config, etc).

Bug: n/a
Test: m nothing --no-skip-soong-tests
Change-Id: Ia9f2186e4e54e92ad90c7a9c00474cb0f7519a31
2024-09-03 13:22:21 +09:00
Jooyung Han
6186ef9004 Refactor around apex aconfig files
We can iterate over the collection of apex file.

Bug: n/a
Test: m nothing --no-skip-soong-tests
Change-Id: Ibe567d3b251c54d656793dc443eb68fb9137f42f
2024-09-03 11:14:19 +09:00
Treehugger Robot
9cbbafe300 Merge changes from topic "ctx_in_ideinfo" into main
* changes:
  Add ctx argument to IDEInfo()
  Add configurable property support to neverallow
2024-08-28 00:49:13 +00:00
Cole Faust
b36d31d870 Add ctx argument to IDEInfo()
The IDEInfo() methods read properties. To make those properties
configurable, we need a context to evaluate them with.

Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: I26d4b7084439b3006e50b02277298f74a929e1aa
2024-08-27 16:04:28 -07:00
Ashutosh Agarwal
46e4fad202 Add a property to rust_ffi targets to exclude them from APEXes.
This is a temporary measure until stubs are properly supported by rust_ffi targets.

Bug: 361441210
Bug: 362509506
Change-Id: Ieabd4e3abf442de660f39ec6c5776f5832b25e14
Test: manual
2024-08-27 17:13:12 +00:00
Spandan Das
18c2607bde Merge "Move installation rules of dexpreopt'd apex systemserver jars to soong" into main 2024-08-26 22:27:57 +00:00
Spandan Das
746161db0c Move installation rules of dexpreopt'd apex systemserver jars to soong
This will eventually allow us to build devices by skipping `katiBuild`
and moving straight to `katiPackaging`.

Implementation details
- Replace ctx.PackageFile with ctx.InstallFile. These makes these rules
  available to both make and soong packaging systems. This will be done
inside d.dexpreopt function
- Add InstallDepNeeded on the dependency tags in this chain
(apex --> sscp_fragment --> (java_library|java_sdk_library)). This is
necessary for the soong packaging system.
- Remove `LOCAL_SOONG_INSTALLED_MODULE=""`. A non-empty string ensures
  that kati honors the installation rules generated by soong.

Bug: 355509400
Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug (mainline source)
Test: lunch cf_x86_64_only_phone-ap3a-userdebug (mainline prebuilts)
(no diff in system_intermediates/file_list.txt in both cases)

Change-Id: I190a919e9480e7d9981a6b9b96a50d9c33ceea02
2024-08-26 20:58:10 +00:00
Cole Faust
ac92f3e3f4 Make native_shared_libs configurable
So that you can use selects with it.

This cl also creates a ResolvedApexNativeDependencies to represent
a merged and evaluated set of ApexNativeDependencies. Previously other
properties added their own "resolved" versions individually, but I
think it's better design for the property structs to remain unchanged,
so I created a new non-property struct to contain the resolved values.
Immutable property structs is one of the things we want to add for
performance (removing property struct copies).

Bug: 342006386
Test: Presubmits
Change-Id: Ibf222c4a7c01df7d5ccc5a85b2e3c9b3f9243b9a
2024-08-20 13:26:52 -07:00
Jooyung Han
9a419e28f5 apex: apex_available with prefix
We now support prefix form (com.foo.*) in apex_available list.

Bug: 360265761
Test: m --no-skip-soong-tests
Change-Id: I50ab884651dd6321950cfd4563b59ef3ed0f07fd
2024-08-20 10:50:04 +09:00
Kiyoung Kim
faf6af31cd Introduce vintf_fragment module type
Introduce a new vintf_fragment module type which handles vintf_fragment
files within Soong. This will help process to move vintf_fragment
handling logic from KATI to Soong. This change also introduces
vintf_fragment_modules property to mark dependency with vintf_fragment
modules.

Bug: 322089980
Test: m nothing --no-skip-soong-tests passed
Change-Id: I49607f42aeee3ded0ba7b078b903dc35f5d61637
2024-08-14 10:34:41 +09:00
Cole Faust
bf1d92ad20 Cleanup configurable getter usages
You don't have to call module.ConfigurableEvaluator(ctx) if ctx is
already a ModuleContext, you only need to do that for more restricted
contexts like SingletonContext.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I7612290d43dae7decfae283a341882d9016c98a3
2024-07-29 12:24:25 -07:00
Inseob Kim
d23e0d3244 Make more apex properties configurable
This allows using select statements with these.

* apps
* binaries
* prebuilts

Bug: 354824866
Test: m --no-skip-soong-tests
Change-Id: I8e28937d2fa6514b41bd189f56f9f584a60d2c80
2024-07-25 00:55:38 +00:00
Inseob Kim
b114234f6b Make some apex properties configurable
This allows using select statements with these.

* androidManifest
* canned_fs_config
* systemserverclasspath_fragments

Bug: 354824866
Test: m
Change-Id: I4c2182944ec14d99332f437c39a19ba0dc6b7731
2024-07-25 00:55:05 +00:00
Treehugger Robot
dd9b0c1be8 Merge "Remove allowlist for updatable modules with current min_sdk_version" into main 2024-07-19 17:04:57 +00:00
Colin Cross
ea1b3b78b8 Merge changes from topic "elide_empty_variants" into main
* changes:
  Convert sdk mutator to TransitionMutator
  Convert link mutator to TransitionMutator
  Convert version mutator to TransitionMutator
  Convert python_version mutator to TransitionMutator
  Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
2024-07-18 17:37:38 +00:00
Colin Cross
8a49a3dd76 Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
Replace rust.LibraryMutator and rust.LibstdMutator with
TransitionMutators.

Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: Ia24a582119d39889279d7b93bac9259685153619
2024-07-17 15:50:36 -07:00
Spandan Das
32c93a3f3c Remove allowlist for updatable modules with current min_sdk_version
All existing violations have been cleaned up.

Bug: 221087384
Test: presbumits
Change-Id: Iefe318d9372d4078f21b03e0d9003609cca069ab
2024-07-17 20:31:58 +00:00
Treehugger Robot
0adcc8c83d Merge "Min_sdk_version check for updatable apexes" into main 2024-07-16 19:09:03 +00:00
Colin Cross
e1a8555581 Add IsAddingDependency to IncomingTransitionContext
Add an IsAddingDependency method to IncomingTransitionContext that
returns true if IncomingTransition is called after the transition
has already won while adding a new dependency.  This will be used
as part of the transition mutators to support an apex use case where
incoming dependencies during the initial apex mutator need to be
rewritten onto the platform variant for modules that don't support
the apex, but a later call to OtherModuleDependencyVariantExists
must not rewrite the requested apex variation onto the platform
variant.

This should be used sparingly, all uses will have to be removed in
order to support creating variants on demand.

Bug: 319288033
Test: TestIsAddingDependency
Flag: EXEMPT refactor
Change-Id: Ib8e419d35ff8f7cbff9667c1cd40d05ccfacab8b
2024-07-11 16:59:34 -07:00
Colin Cross
088123934b Merge "Remove test_per_src" into main 2024-07-11 20:32:23 +00:00
Jooyung Han
b19a0dd90a Remove apex.use_vndk_as_stable
Since VNDK is gone now, the property has no meaning. Will remove the
property after removing all the references(there're no-op for now).

Bug: 350644693
Test: m
Change-Id: I85637ede5534a3b993ac12656e4aba8d945fec14
2024-07-02 16:47:31 +09:00
Spandan Das
ca1d63eac3 Min_sdk_version check for updatable apexes
Updatable apexes should not min_sdk_version to `current`, since
`current` can have different meanings based on when plaform finalization
happens.

Test: m nothing --no-skip-soong-tests
Bug: 221087384
Change-Id: I04aaa4a331027b7afbf6ccdb9cbf3ae670827c9f
2024-07-02 03:16:25 +00:00
Colin Cross
3a02c7ba1a Remove test_per_src
Remove test_per_src, it never worked well and is incompatible
with all of the test infrastructure.  Uses in the platform have
been removed, generally by replacing them with individual cc_test
modules.

Test: builds
Flag: TEST_ONLY
Change-Id: I257c035da35ca8358ae9423b46453878f54efeb1
2024-06-28 10:31:05 -07:00
Dmitrii Ishcheikin
aaec2d5e93 Merge "Add imgdiag ART APEX" into main 2024-06-26 16:54:13 +00:00
Jihoon Kang
79b0eef5a1 Merge "Move vendor and product variant generation logic from cc package to android package" into main 2024-06-21 18:16:31 +00:00
Jihoon Kang
47e918450f Move vendor and product variant generation logic from cc package to android package
Although image variation generation logic has moved out of cc package to
the android package, the vendor and product partition variants
generation logic is still specific to cc package. Therefore, in order to
create a product or vendor variant, they have to specified in
`ExtraImageVariants`. In order to avoid such confusing behaviors and
enforce modules to specify product and vendor installation rules, this
change moves the vendor and product variant generation logic to
android.ImageInterface.

Test: m nothing --no-skip-soong-tests && diff contents of out/soong/Android-{product}.mk
Change-Id: I9e14f3739d9dea94167ee6a91e92b2f942055aba
2024-06-21 07:45:09 +00:00
mrziwang
e7ec89e0a9 ExportableModule no longer implements OutputFileProducer
multitree.ExportableModule no longer implements
android.OutputFileProducer

In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

ApiSurface and apexBundle are included in this change.

Test: CI
Bug: 339477385
Change-Id: I9247bb2dfed270a879f8bc96c6aa06803fde0150
2024-06-20 16:19:48 +00:00
Treehugger Robot
c0cbb491d5 Merge "Use BaseApexName to generate permission file for sdk library" into main 2024-06-19 04:29:18 +00:00
Spandan Das
33bbeb243f Use BaseApexName to generate permission file for sdk library
Permissions of apex variants of shared java sdk libraries should use the
base apex name (com.android.foo) and not the override apex name
(com.mycompany.android.foo). The override apex name started being used
when separate variants were created for override apex transitive deps
(https://r.android.com/3083813)

Bug: 346486531
Test: m com.google.android.ipsec
Test: verified that
out/target/product/<product>/apex/com.google.android.ipsec/etc/permissions/android.net.ipsec.ike.xml
contains /apex/com.androiqd.ipsec/javalib/android.net.ipsec.ike.jar #
previously it contained com.google.android.ipsec

Test: https://android-build.corp.google.com/builds/abtd/run/L59900030004679761
Change-Id: I863170d78efa017bef5e4ece3b1471f74ba84b0c
2024-06-19 04:27:43 +00:00
Cole Faust
ecdb25e674 Merge "Make required a configurable property" into main 2024-06-18 18:05:41 +00:00
Cole Faust
43ddd08bd2 Make required a configurable property
So that users can use select statements with it.

Fixes: 347605145
Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: Ica0ca6d1725b000b3748c0293e5a9f9b38ed87f9
2024-06-17 12:32:40 -07:00
Treehugger Robot
0adcd9aefa Merge "Call PackageFile for dexpreopt files of APEX bundles." into main am: 9034af498e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3128073

Change-Id: I40cce87cc466de96df45e05c9a6cf7b073725ec8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-13 21:49:51 +00:00
Justin Yun
613bdc5b64 Call PackageFile for dexpreopt files of APEX bundles.
Soong generates AndroidMk modules and Make installs the required
dexpreopt files for APEX bundles. This dependency is not tracked by
the soong and missing from the soong filesystem.
Call PackageFile for the dexpreopt files of APEX bundles to install
the files in the soong-built system image.

Bug: 346439786
Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug \
      && m aosp_cf_system_x86_64
Change-Id: I6af4afe5b3183c89bf687ac779007b87e1d7e948
2024-06-13 12:37:04 +09:00
Zi Wang
05ae2e9d35 [conflict] Merge "PrebuildEtcModule no longer implements OutputFiles method" into main am: 3125b75d5d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3123797

Change-Id: I9acefd1def06cefc153514c766489b341fa86b2e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Ignore-AOSP-First: to resolve merge conflict
2024-06-11 18:18:14 +00:00
Kiyoung Kim
d605f683ef Merge "Remove VNDK related code from Soong" into aosp-main-future 2024-06-11 00:28:41 +00:00
mrziwang
e2346b87d9 PrebuildEtcModule no longer implements OutputFiles method
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

These module types are included in this change:
linker_config
llndk_libraries_txt
sanitizer_libraries_txt
java_sdk_library_xml
vndksp_libraries_txt
vndkcore_libraries_txt
vndkprivate_libraries_txt
vndkpublic_libraries_txt

Test: CI
Bug: 339477385
Change-Id: I35575bbad137df5ff8001db9a61ba5b3d13eaa6d
2024-06-10 15:17:07 -07:00
Zi Wang
f1dbeb309e Merge "Use OutputFilesProvider on bpf" into main am: 6c9fa02204
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3098157

Change-Id: I4a32747fc36aa90e19e5b8539100842e172aae69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-05 16:16:34 +00:00
Dmitrii Ishcheikin
f882107c18 Add imgdiag ART APEX
Bug: 333649424
Test: presubmit
Change-Id: I9e19b00d7cfb54cf36097f8a73457ea2d4889113
2024-06-05 15:20:48 +00:00
mrziwang
e6c8581fbe Use OutputFilesProvider on bpf
This changes makes bpf module type uses OutputFilesProvider,
instead of current OutputFileProducer for inter-module-
communication.

Test: CI
Bug: 339477385
Bug: 342406930
Change-Id: I85d1141e9f6583cc5427756107da99f56b0c7ea1
2024-06-04 22:09:13 -07:00
Kiyoung Kim
9f26fcf88c Remove VNDK related code from Soong
As VNDK definition is fully removed from Android.bp, VNDK related code
can be removed from Soong. This change removes VNDK related code except
VNDK prebuilt which is required to build former versions of VNDK APEX
with prebuilts.

Bug: 330100430
Test: AOSP CF build succeeded
Ignore-AOSP-First: Resolve Conflict
Change-Id: Id9c8993343221c8464c97296bde0ff40b14b9b0b
2024-06-05 01:22:58 +00:00
Kiyoung Kim
8f05c54b9d VNDK is fully deprecated from Soong
VNDK is fully deprecated, so KeepVndk variable will have fixed value.
This change removes KeepVndk config value, and updates any logic using
the value as VNDK is always deprecated.

Bug: 330100430
Test: Soong tests passed
Ignore-AOSP-First: Resolve merge conflict
Change-Id: I98b7590c059883e06bf3fb236d88966de64991d7
Merged-In: I98b7590c059883e06bf3fb236d88966de64991d7
2024-06-04 01:09:15 +00:00
Xin Li
8a31520ef8 Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550
Merged-In: I4a6dd1c5e48db7085ea41035def31f0844948a46
Change-Id: If8ad1d0d87495bbd685f5f9f03f5eb7ea78bf192
2024-05-24 08:25:18 -07:00
Spandan Das
50801e20a3 Support min_sdk_version overrides in apexes
The use case for this are go apexes which are only installed in T and
above, even though the base AOSP apexes might be installable on < T
devices.

If provided, the overridden min_sdk_version will be
1. Used as the `min_sdk_version` in the manifest file of the
   top-level override apex binary
2. Used to build the transitive closure of its dependency with that
   min_sdk_version, i.e. with a different apex variant.

(2) requires some special handling. At ToT, the outgoing transition
value is the base apex name (e.g. com.android.foo). Since
min_sdk_version of the overridding apex can be different than the
overridden apex, the base apex name is no longer sufficient. Instead,
transition to the name of the overriding apex com.mycompany.android.foo.
If deduping is possible, transitive deps will get deduped to
`apex_<min_sdk_version>` later.

Test: added a unit test
Test: in internal, modified min_sdk_version of com.google.android.go.art
locally, built BA and Go apexes, and used `aapt2 dump badging` to verify
that BA has minSdkVersion of 31 and Go has minSdkVersion of 33

Bug: 295311875

Change-Id: Ifbe123d1517fccbc0c058042b8a6eeb3609b6787
2024-05-20 16:24:52 +00:00
Ivan Lozano
e8fcd37775 Merge changes from topic "rust-made-to-order-staticlibs" into main
* changes:
  rust: made-to-order rust staticlibs
  rust: refactored transformSrctoCrate
2024-05-17 12:40:36 +00:00
Ivan Lozano
0a468a4f3b rust: made-to-order rust staticlibs
Whenever any two Rust static libraries are included
as static libraries anywhere in a CC dependency tree, we sometimes
get duplicate symbol errors. To avoid this, we no longer
directly link multiple rust static libs to CC modules.

Instead, we build rust_ffi_rlib modules and produce the actual
static library that gets linked against the CC module based on
that CC module's full list of Rust rlib dependencies.

This introduces a new static_rlibs property for cc modules to
define the rust_ffi_rlib dependencies, which are then used to
generate the module above.

This CL is intended to deprecate rust_ffi_static. It leaves
rust_ffi_static and rust_ffi static variants in place until
the remaining rust_ffi_static declarations and uses can be
removed. In the meantime, rust_ffi_static produces
rust_ffi_rlib variants as well to make the transition easier.

Bug: 254469782
Test: m # with no changes
Test: m libapexsupport # with static_rlibs
Test: m libunwindstack # with static_rlibs
Test: m netsimd # with static_rlibs, no duplicate symbols
Test: m blueprint_tests # New Soong tests

Change-Id: I47e27ac967ef0cad46d398ebf59d8275929ae28a
2024-05-16 13:00:43 -04:00