Commit graph

3456 commits

Author SHA1 Message Date
Spandan Das
0b28fa0b84 Override modules should always override source modules
Since overrides are implemented as variants of the source module, the
override module should not be replaced with prebuilts of the source
module even when the prebuilt is preferred.

Test: go test ./apex
Change-Id: I26e97f700276e7beaf6d1bd61b164f11d57a5e09
2024-05-29 00:06:32 +00:00
Dennis Shen
54082dd8fe Merge "Soong: remove obsolete proto lib from unit test" into main 2024-05-23 16:05:37 +00:00
Dennis Shen
6a7ffb3ec0 Soong: remove obsolete proto lib from unit test
Bug: b/321077378
Test: m and avd
Change-Id: Ib121da201e0be38d1acd82de1487f6cfba9e696c
2024-05-23 11:43:42 +00:00
Spandan Das
5f1f9405b5 Restrict validateApexClasspathFragments to active apex prebuilts
This is a followup to https://r.android.com/3073624 that moved
validation of bcp jars to the top-level prebuilt apex. It is possible
that there can be multiple prebuilt variants of a mainline module and
each prebuilt might have a skew in bcp jars. This CL limits the check to
only the selected apex prebuilt.

Test: go test ./apex
Bug: 328578801
Change-Id: If225a1af6004b6584b86ec442f99672f0d1f8314
2024-05-21 18:59:23 +00:00
Treehugger Robot
652824c8d6 Merge changes from topic "revert-3094658-revert-3088867-QEHDREAABY-IOPVAUIKWL" into main
* changes:
  Revert^2 "Refactor how jni_libs dependencies are added"
  Revert^2 "Add make java.dependencyTag installable or not"
  Revert "Revert "APK-in-APEX should set use_embedded_native_libs:..."
  Revert^2 "Install jni symlinks in Soong"
2024-05-20 23:00:05 +00:00
Jiyong Park
970c524ab5 Revert "Revert "APK-in-APEX should set use_embedded_native_libs:..."
Revert submission 3094658-revert-3088867-QEHDREAABY

Reason for revert: not a regression
Reverted changes: /q/submissionid:3094658-revert-3088867-QEHDREAABY

Change-Id: Ie1e4a196f181643a3e64e573b132d52d7455461b
2024-05-21 06:41:36 +09:00
Treehugger Robot
8298134503 Merge changes Ifbe123d1,Ie2e738a6 into main
* changes:
  Support min_sdk_version overrides in apexes
  Support min_sdk_version overrides in apps
2024-05-20 17:38:11 +00: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
Yu Shan
4978080b1d Merge changes from topic "revert-3088867-QEHDREAABY" into main
* changes:
  Revert "Install jni symlinks in Soong"
  Revert "APK-in-APEX should set use_embedded_native_libs: true"
  Revert "Add make java.dependencyTag installable or not"
  Revert "Refactor how jni_libs dependencies are added"
2024-05-17 22:55:51 +00:00
Spandan Das
d700486907 Merge "Disable monolithic hiddenapi flags generation for non java devices." into main 2024-05-17 21:11:31 +00:00
Yu Shan
d5e435d749 Revert "APK-in-APEX should set use_embedded_native_libs: true"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: I3064caef0cb55d1594951835a1173c667f58e607
2024-05-17 13:37:30 -07: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
Jiyong Park
4e8ab4e103 Merge changes I1bc9ceb8,I9b1c7809,I836171aa,I0930cb1e into main
* changes:
  Refactor how jni_libs dependencies are added
  Add make java.dependencyTag installable or not
  APK-in-APEX should set use_embedded_native_libs: true
  Install jni symlinks in Soong
2024-05-17 02:44:31 +00:00
Spandan Das
42e1fc8d1e Merge "Align boot jar exclusion with apex_contributions" into main 2024-05-16 23:57:13 +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
Jiyong Park
5f0943f33f APK-in-APEX should set use_embedded_native_libs: true
So far, we automatically have embedded JNI libs for APKs in APEX, even
if use_embedded_native_libs was not set or set to false.

With this change, such APKs should explicitly set the property.

This is in preparation for an upcoming change for using different
dependency tags to JNI deps depending on whether they are embedded (thus
no install is needed), or not (thus installation to the partition is
needed).

shouldEmbedJni function now doesn't make use of the ApexInfoProvider
which is not available during deps mutator.

Bug: N/A
Test: m
Change-Id: I836171aacba19dbfa0e09f16a773ae498c56d60b
2024-05-16 19:40:00 +09:00
Spandan Das
3d0d31a8c6 Align boot jar exclusion with apex_contributions
During trunk stable development, it is possible that a new boot jar is
added to the source apex, but not available in prebuilt apex yet.
Thefore we need to conditionally check the `contents` of the respective
bootclasspath_fragment modules. https://r.android.com/2822393 did this
using isActiveModule. This function relies on soong config namespaces to
"hide" the source bootclasspath_fragment module when
<module>.source_build is false.

Soong config namespaces for mainline source vs prebuilt selection is no
longer in use, so this CL replaces `isActiveModule`. The CL cleaves the
implementation
1. For source builds, the check will run in the context of the
   bootclasspath_fragment module. `disableSourceApexVariant` will be
used to skip the check if prebuilts are selected.
2. For prebuilt builds, the prebuilt bootclasspath_fragment module sets
   a provider, and the top-level apex will do the check.

(2) is necessary to handle the edge case of multiple versioned mainline
prebuilts and possible skew in apex boot jars across them. In case of
prebuilt builds, the unselected mainline prebuilts will have
HideFromMake called on them, so the check will only run on the apex that
is actually used during the build.

Bug: 328578801
Test: go test ./apex

Change-Id: I6eec603397eea926f3a481b79ca938245064d809
Merged-In: I6eec603397eea926f3a481b79ca938245064d809
2024-05-16 00:35:28 +00:00
Spandan Das
81fe4d1d74 Disable monolithic hiddenapi flags generation for non java devices.
platform-bootclasspath constructs the monotlithic hiddenapi flags by
looking at PRODUCT_BOOT_JARS which are not included in another
bootclasspath fragment. PRODUCT_BOOT_JARS is a product specific
property, and non java devices like minidroid have an empty value for
this. For such devices, the monolithic flag generation runs into an
error because there are no jars to run this on.

This CL disables the generation of monolithic specific hiddenapi flags
when there are no monolithic boot jars in the build.

Bug: 338363444
Test: lunch aosp_cf_x86_64_minidroid-trunk_staging-userdebug && mmma
frameworks/base

Change-Id: I093690786bcf85b2aa6f01d0c689fc2a35861b5c
2024-05-15 22:41:43 +00:00
Cole Faust
7c991b4e33 Qualify prebuilt_etc apex module name by relative paths
Currently, you can't have two prebuilt_etcs in one apex with the same
file name, because apexes emit make modules for all the files in the
apex, and the module name for the prebuilt_etc's make representation
is based on the base filename of the installed file. We can change it to
be qualified based on the full relative path of the outputfile so that
you don't hit the conflicts as much.

Fixes: 340207931
Test: Presubmits
Change-Id: I7836fd4661fcaafd91901eba7e0b89506946c3e2
2024-05-15 11:17:55 -07:00
Cole Faust
c005ba0fa2 Revert "Qualify prebuilt_etc apex module name by relative paths"
This reverts commit d94cccc523.

Reason for revert: Patchset 2 was wrong, doesn't actually fix the bug

Change-Id: Ie2d931ad3e2277ce1923284b13f50f62ac2f8917
2024-05-15 18:01:43 +00:00
Cole Faust
d94cccc523 Qualify prebuilt_etc apex module name by relative paths
Currently, you can't have two prebuilt_etcs in one apex with the same
file name, because apexes emit make modules for all the files in the
apex, and the module name for the prebuilt_etc's make representation
is based on the base filename of the installed file. We can change it to
be qualified based on the full relative path of the outputfile so that
you don't hit the conflicts as much.

Bug: 340207931
Test: Presubmits
Change-Id: I6708d89c755c31c17cce112fb08a810e51926c76
2024-05-14 14:42:22 -07:00
Justin Yun
40182b6ff3 Remove duplicated CollectDependencyAconfigFiles()
android.ModuleBase already calls aconfigUpdateAndroidBuildActions()
that is the same with CollectDependencyAconfigFiles(). Remove the
CollectDependencyAconfigFiles() to avoid duplication with
aconfigUpdateAndroidBuildActions().

To make the aconfig information available in
GenerateAndroidBuildActions() of all modules, call
aconfigUpdateAndroidBuildActions() before calling
GenerateAndroidBuildActions() of each module.

Also, we don't need SetAconfigFileMkEntries(), which is a duplicate
of aconfigUpdateAndroidMkData()

Bug: 335363964
Test: diff `adb shell printflags` before and after the change.
Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
2024-05-10 10:00:14 +09:00
Treehugger Robot
7eaf503cfd Merge "Revert^2 "Remove compilation actions from java sdk library"" into main 2024-05-08 22:28:05 +00:00
Jihoon Kang
a3a05460b4 Revert^2 "Remove compilation actions from java sdk library"
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-05-08 17:46:31 +00:00
Cole Faust
3f01580c04 Merge "Make the enabled property configurable" into main 2024-05-07 17:49:10 +00:00
Jihoon Kang
5284ad3b33 Merge "Revert "Remove compilation actions from java sdk library"" into main 2024-05-07 00:03:05 +00:00
Jihoon Kang
8f25d296b5 Revert "Remove compilation actions from java sdk library"
Revert submission 3070882-sdk_lib_remove_compilation

Reason for revert: Potential culprit for build breakage of barbet-ap2a-userdebug in git_main

Reverted changes: /q/submissionid:3070882-sdk_lib_remove_compilation

Change-Id: I5135760e13e0152480c68fe91a3c88564e9bc7cb
2024-05-06 22:40:22 +00:00
Treehugger Robot
f91daab1ab Merge "Remove compilation actions from java sdk library" into main 2024-05-06 21:06:54 +00:00
Jihoon Kang
d831af4267 Remove compilation actions from java sdk library
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.

Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I7534f9eaacf6d9f72fbf8d540b1e26af84106c20
2024-05-03 20:51:11 +00:00
Oriol Prieto Gascó
a874e94bab Merge "Make container mandatory in aconfig_declarations." into main 2024-05-03 14:09:48 +00:00
Cole Faust
a963b94cde Make the enabled property configurable
This allows using select statements with it.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02 15:41:24 -07:00
Kiyoung Kim
973cb6f555 Move LLNDK related logic to llndk_library
Currently VNDK contains some logic for LLNDK libraries as they are
treated in a similar way with VNDK. However, those logics should stay from
VNDK deprecation. To keep the logic, this change moves LLNDK related
logic into llndk_library.

Bug: 330100430
Test: Soong tests passed
Test: llndk.libraries.txt did not change from CF build
Change-Id: I1d02a3c2a398f1b1060b4f2bdd23af32310503bb
2024-04-30 13:05:19 +09:00
Ted Bauer
1e96f8c622 Switch to static deps
Bug: 328444881
Test: m
Change-Id: I53ad95ca281031ec98d5df66ada0ed69749da312
2024-04-26 13:46:09 +00:00
Yu Liu
315a53c5cb Make container mandatory in aconfig_declarations.
Bug: 330354107
Test: Unit test and CI.

Ignore-AOSP-First: It is easier to detect all the missing ones in internal
master.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e916a2c758d2a95037d1d366e7cd0e10d241d510)
Merged-In: I4ab4271c67a35d0fdcc0b57c27260e29fb7dea56
Change-Id: I4ab4271c67a35d0fdcc0b57c27260e29fb7dea56
2024-04-24 16:41:57 +00:00
Ted Bauer
f0f18591a5 Add aconfig storage API deps to codegened lib
Change-Id: I4991c9fccb0a0bab15457883cf20aacb3142c4cf
2024-04-23 18:25:26 +00:00
Colin Cross
7c035064db Convert apex mutator to a TransitionMutator
Replace the apex mutator with a TransitionMutator.  Requires moving the
base.apexInfo value into a provider so that it is still present for the
Mutate pass.

Test: go test ./...
Test: no change to out/soong/build-${TARGET_PRODUCT}.ninja
Change-Id: I1c898eaf30b4021f0f96f439cc0b3b3173710fc7
2024-04-18 15:08:43 -07:00
Treehugger Robot
1065ed8fbd Merge "java_sdk_library: Use WriteFileRule for writing permissions.xml" into main 2024-04-11 20:55:30 +00:00
Jihoon Kang
033ffb9533 Merge "Collect aconfig_declarations of the dependent java_aconfig_library modules" into main 2024-04-11 17:37:58 +00:00
Paul Duffin
1816cde8ce java_sdk_library: Use WriteFileRule for writing permissions.xml
Use the `WriteFileRule` to write the permissions file for shared
libraries instead of generating a custom bash rule.

Test: TH
Change-Id: I904cf0742bfec46ed45ec7801bb9bd3dc3047185
2024-04-10 13:21:28 +01:00
Jiyong Park
39011ef40c Merge "APEX can depend on non-APEX module and vice versa" into main 2024-04-08 22:28:26 +00:00
Treehugger Robot
ed2adb879f Merge "Remove Device VNDK version usage from Soong" into main 2024-04-08 19:24:36 +00:00
Jiyong Park
fc095e6796 APEX can depend on non-APEX module and vice versa
Previously, an APEX module (also called apexBundle inside of Soong) had
only one "apex" variant which has the same name as the module. This
prevented an APEX from depending on another module which is outside of
the APEX (ex: another APEX). Similarily, a module outside of an APEX
(ex: a shared lib or a test) couldn't depend on an APEX.

This CL fixes the issue by creating the "" variant as the alias of the
"<apex_name>" variant, and also by setting the "" variant as the default
dependency variant.

Bug: 321626681
Test: m
Change-Id: Ie3e57a96530c25e966cfd551676d819c442bb0d5
2024-04-05 14:39:23 +09:00
Treehugger Robot
fe66e13714 Merge "Deprecate Snapshot build" into main 2024-04-05 04:59:43 +00:00
Treehugger Robot
133a6d9e6f Merge "Return the header jar of the implementation library in SdkHeaderJars()" into main 2024-04-05 03:23:34 +00:00
Kiyoung Kim
4e765b1bfc Remove Device VNDK version usage from Soong
As of VNDK deprecation, Device VNDK version should no longer be used
from build. This change removes all references on Device VNDK version
and related logic with it.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ibc290f0b41e8321f80c75c69f810223989af68dc
2024-04-05 01:57:32 +00:00
Kiyoung Kim
37693d0a27 Deprecate Snapshot build
Existing snapshot code will no longer work from VNDK deprecation, but it
can give confusion to users if we keep code for the snapshot - and it
adds complexity on existing code while it is not in use. This change
removes all snapshot definition except host snapshot and its usage.

Bug: 330100430
Bug: 332986564
Test: AOSP CF build succeeded
Change-Id: Ieb6fa43d5e38315c662ce997bc305b744b367c24
2024-04-05 01:56:56 +00:00
Jihoon Kang
8479dea802 Return the header jar of the implementation library in SdkHeaderJars()
As part of the process to remove the compilation action in the top level
java sdk library, this change modifies SdkHeaderJars(...) (i.e. the
"magic") to return the header jar of the implementation library instead
of the header jar of the top level java sdk library when the
implementation jar is returned from the "magic".

This change also removes `SdkImplementationJars()` from the
SdkLibraryDependency interface, as it is not currently used anywhere
else.

Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: Icc00af4b1485dc2b1b0981a3e56758d0306dea69
2024-04-05 00:37:37 +00:00
Kiyoung Kim
6954bd2337 Merge "Remove PlatformVndkVersion property" into main 2024-04-03 00:48:04 +00:00
Jesse Melhuish
219ce55481 Merge "Allow Multilib in override_apex" into main 2024-04-01 14:01:59 +00:00
Kiyoung Kim
fa13ff194c Remove PlatformVndkVersion property
Platform VNDK version is no longer available based on VNDK deprecation.
Remove all code using Platform VNDK version.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: I7d0f7e23eff5d153346890f242a94b78bad6736b
2024-04-01 16:37:20 +09:00