Commit graph

7983 commits

Author SHA1 Message Date
Jiyong Park
b544a8b9ec Merge changes from topic "reland_embedded_jni" into main
* changes:
  Install transitive deps of jni libs, but not the jni libs themselves
  Add SkipToTransitiveDepsTag interface for dependency tags
  Revert "Revert "Collect transitve deps of jni libs only for bund..."
  Revert^2 "Always embed jni libs and store uncompressed"
2024-05-10 22:53:08 +00:00
Jiyong Park
1fb7c35129 Add SkipToTransitiveDepsTag interface for dependency tags
Consider this dependency graph:

A --> B --> C

And let's assume that B is built into A (e.g. static_libs), while B -->
C is a runtime dependency (e.g. required).

We want to install C (but not B of course) when A gets installed.
However, before this change, it was not supported because the dependency
A -> B was not tracked in computeInstallDeps. One had to explicitly add
a A -> C dependency.

This change fixes the problem by introducing the new interface
SkipToTransitiveDepsTag. computeInstallDeps uses it to decide whether to
take all install files and packaging specs or only those from transitive
dependencies. In the above example, if the dependency A --> B implements
the new interface and returns true, B's transitive dependencies (i.e. C)
are added into A's transitive dependencies. B's outputs are not added.

Bug: N/A
Test: go test ./... under soong/android
Change-Id: I3ca03a21633883f320ecb9e5bc82eb134519cd88
2024-05-10 14:03:04 +09: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
Cole Faust
dd056e087e Merge "Create EXTRA_INSTALL_ZIPS variable" into main 2024-05-10 00:11:16 +00:00
Treehugger Robot
ef14cae605 Merge "Rename release_variable to release_flag in selects" into main 2024-05-09 23:27:58 +00:00
Cole Faust
e19f741052 Rename release_variable to release_flag in selects
To be more consistent with the terminology used in the rest of the
release flag infrastructure.

Bug: 323382414
Test: Presubmits
Change-Id: I176ce164c00e95ef7653608298b0051da3298aa9
2024-05-09 15:14:04 -07:00
Treehugger Robot
1dbb9d91ce Merge "Add RELEASE_APEX_CONTRIBUTIONS_PRIMARY_LIBS build flag" into main 2024-05-09 22:11:58 +00:00
Colin Cross
efdbfe1ede Merge "Revert "Convert overrides to a TransitionMutator"" into main 2024-05-09 21:35:12 +00:00
Cole Faust
99bec75197 Create EXTRA_INSTALL_ZIPS variable
Make needs to know about the "extra" zip files that are extracted
to the staging directories so that it can track all the installed files
correctly.

Also add a utility tool for listing the contents of relevant zips.

Bug: 337869220
Test: m droid and checked the contents of file_list.txt when adding an android_app_set locally
Change-Id: Idc5dd785b03c05f7972c66620d4e6359892b3863
2024-05-09 14:20:11 -07:00
Colin Cross
d7b2a45d47 Revert "Convert overrides to a TransitionMutator"
This reverts commit 49be24b833.

Reason for revert: b/338643193
Bug: 319288033
Bug: 338643193

Change-Id: I7106e779e52ffc943bdcf7ee3b7c7b65fe34122e
2024-05-09 20:18:49 +00:00
Pedro Loureiro
57b1b6802f Add RELEASE_APEX_CONTRIBUTIONS_PRIMARY_LIBS build flag
Bug: 339132327

Test: m out/soong/prebuilt_info.json
Test: manually inspect that json file
Change-Id: Ib20164c82316fe02fe04a52461e344f1dfb03b90
2024-05-09 16:11:05 +00: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
Jooyung Han
197b56f58b Merge ".capex is a container" into main 2024-05-07 01:36:41 +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
Christopher Ferris
be83e748d4 Merge "Replace Malloc_not_svelte with Malloc_low_memory." into main 2024-05-06 19:45:05 +00:00
Jiyong Park
7c9ab4f5b1 Merge changes from topic "revert-3069323-revert-3066748-duplicate_entry_fs-CIBDJQYRHU-FVLDIVWUZV" into main
* changes:
  Revert^2 "Filesystem modules follow the installation semantic"
  Revert "Revert "Prevent multiple PackagingSpecs having same inst..."
2024-05-04 03:56:55 +00:00
Treehugger Robot
b92fc67f50 Merge "Correct the order of the SdkKinds" into main 2024-05-04 01:17:19 +00:00
Jihoon Kang
248cc0072c Correct the order of the SdkKinds
Currently, all sdkKind enums are ordered from the narrower api surface to
the wider api surface, with the exception of the toolchain api surface.
This change corrects the order of the toolchain api surface so that the
enum entries are sorted in the correct order.

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Iad4205c9ce1a83be2f7d80647366fba78e9805ca
2024-05-04 00:06:59 +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
Colin Cross
5694d3f290 Merge "Convert overrides to a TransitionMutator" into main 2024-05-03 17:54:51 +00:00
Treehugger Robot
baaa1b1eeb Merge "Use no_full_install: true instead of installable: false" into main 2024-05-03 15:15:23 +00:00
Inseob Kim
364740b4a4 Merge "Merge logtags from cc modules too" into main 2024-05-03 05:10:22 +00:00
Jooyung Han
4191da7292 .capex is a container
.capex should be handled as a container when generating NOTICE.

Bug: n/a
Test: Presubmits
Change-Id: Ief4b0a8d18d52ff6510521e0a2b1f4588e259a75
2024-05-03 11:41:11 +09:00
Colin Cross
814e80038b Merge changes from topic "replace_dependencies" into main
* changes:
  Only update DebugMutator and DebugVariation for non-empty transition variations
  Update docs for ReplaceDependencies[If]
  Raise test timeout when running soong tests with race detector
2024-05-02 22:50:28 +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
Colin Cross
49be24b833 Convert overrides to a TransitionMutator
Replace the performOverrideMutator with a TransitionMutator.

Bug: 319288033
Flag: NONE
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: I358f260f1bcd894d7803036ce77ba666c0429355
2024-05-02 15:31:58 -07:00
Colin Cross
888046f053 Only update DebugMutator and DebugVariation for non-empty transition variations
Non-transition mutators that don't create a variant for a given module
cause no change to DebugMutator and DebugVariation.  TransitionMutators
don't have a concept of skipping a module, so Mutate is called on
every module.  This causes extra entries in DebugMutator and DebugVariation,
which will confuse error message around missing variations, and require
updating variant strings in some tests.

Skip updating DebugMutator and DebugVariation for empty transition
mutator variations.  This isn't entirely correct, but transition mutators
don't currently have a concept of an unaffected module.

Bug: 319288033
Test: all soong tests pass
Flag: NONE
Change-Id: Ia4e659b1e90ffe4320074c9b49528d00fa302c6a
2024-05-02 14:39:40 -07:00
Colin Cross
86771326fe Update docs for ReplaceDependencies[If]
Update docs for ReplaceDependencies[If] to match changes in blueprint.

Bug: 319288033
Flag: NONE
Test: all soong tests pass
Change-Id: I7c79d3ac8dd80946760eb89b6577dc9965cb1541
2024-05-02 14:39:40 -07:00
Aditya Kumar
c9b4d4c584 Merge "IsEnvTrue and IsEnvFalse should take True and False as valid values respectively." into main 2024-05-02 18:14:59 +00:00
Treehugger Robot
512b52f759 Merge "Add a new property trim_extension for gensrcs" into main 2024-05-02 01:43:26 +00:00
Cole Faust
bf18d23827 Merge "Add tests for error when assigning select to nonconfigurable property" into main 2024-05-01 20:56:57 +00:00
AdityaK
1938410342 IsEnvTrue and IsEnvFalse should take True and False as valid values respectively.
Change-Id: Ibca5800c0846a45e3811db76fb5ad46b8a7eb1c1
2024-05-01 13:51:25 -07:00
Treehugger Robot
83ede7c225 Merge "Add RELEASE_APEX_CONTRIBUTIONS_MODULE_METADATA build flag" into main 2024-05-01 18:06:00 +00:00
Jiyong Park
3f627e661a Use no_full_install: true instead of installable: false
So far, we have used `instalable: false` to avoid collision with the
other modules that are installed to the same path. A typical example was
<foo> and <foo>.microdroid. The latter is a modified version of the
former for the inclusion of the microdroid image. They however both have
the same instalation path (ex: system/bin) and stem (ex: foo) so that we
can reference them using the same path regardless of whether we are in
Android or microdroid.

However, the use of `installable: false` for the purpose is actually
incorrect, because `installable: false` also means, obviously, "this
module shouldn't be installed". The only reason this incorrect way has
worked is simply because packaging modules (ex: android_filesystem)
didn't respect the property when gathering the modules.

As packaging modules are now fixed to respect `installable: false`, we
need a correct way of avoiding the collision. `no_full_install: true` is
it.

If a module has this property set to true, it is never installed to the
full instal path like out/target/product/<partition>/... It can be
installed only via packaging modules.

Bug: 338160898
Test: m
Change-Id: Iee9be674951d0bf3d5e26432fcbae9afebb6007b
2024-05-01 22:43:45 +09:00
Jiyong Park
16ef7ac14e Revert "Revert "Prevent multiple PackagingSpecs having same inst..."
Revert submission 3069323-revert-3066748-duplicate_entry_fs-CIBDJQYRHU

Reason for revert: relanding with forward fix

Reverted changes: /q/submissionid:3069323-revert-3066748-duplicate_entry_fs-CIBDJQYRHU

Change-Id: Ica5a126446ca2dc07a40e4ff9866389b5d164eab
2024-05-01 12:36:10 +00:00
Adam Wright
0141b4acad Merge changes from topic "revert-3066748-duplicate_entry_fs-CIBDJQYRHU" into main
* changes:
  Revert "Prevent multiple PackagingSpecs having same installation..."
  Revert "Filesystem modules follow the installation semantic"
2024-05-01 09:59:21 +00:00
Jiyong Park
3d65d9cb90 Revert "Prevent multiple PackagingSpecs having same installation..."
Revert submission 3066748-duplicate_entry_fs

Reason for revert: b/338159248

Reverted changes: /q/submissionid:3066748-duplicate_entry_fs

Change-Id: I89906e160f62f1bf84eb65a1b99940f139626786
2024-05-01 05:25:41 +00:00
Treehugger Robot
543d4f3b7d Merge changes from topic "duplicate_entry_fs" into main
* changes:
  Filesystem modules follow the installation semantic
  Prevent multiple PackagingSpecs having same installation path
2024-05-01 02:43:23 +00:00
Cole Faust
60f6bb2cd1 Add tests for error when assigning select to nonconfigurable property
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I2403aa846238e5c0ea11d7a1b74d3915b3c7b739
2024-04-30 13:58:55 -07:00
Treehugger Robot
2f5d35347b Merge "Move coverage builds prebuilt special case to make" into main 2024-04-30 20:04:44 +00:00
Jiyong Park
a51c4ce10e Prevent multiple PackagingSpecs having same installation path
This fixes a bug that different PackagingSpecs having the same
installation path were silently allowed. Previously, a PackagingSpec
that comes the first for the given installation path won, effectively
eclipsing other PackagingSpecs destined for the same installation path.

Bug: 335506668
Test: go test ./...
Change-Id: Ia36f656e8364f95c4be78fff6e9dc16966307526
2024-04-30 18:50:06 +00:00
Spandan Das
dab69e1001 Add RELEASE_APEX_CONTRIBUTIONS_MODULE_METADATA build flag
This can be used to select a specific prebuilt ModuleMetaData prebuilt

Test: go build ./android
Bug: 338003071
Change-Id: Ia96ba102107161021c78ad3f87a938f8a788e932
2024-04-30 18:14:49 +00:00
Jiyong Park
4152b192e0 Distinguish the intent of PackagingSpec
A PackagingSpec actually means either of two: an installation of a file
(i.e. putting the file on a filesystem image), or a simple gathering.
However, so far, the two different intents was not visible in
PackagingSpecs returns from TransitivePackagingSpecs().

With this change, the two different intents are recorded in
PackagingSpec. A PackagingSpec has a boolean field which records the
value of the SkipInstall() of the module where the PackagingSpec was
created from.

This could be used by a module like android_system_image which wants to
follow the "installation" semantic. For example, the module type doesn't
want to include a stub variant of a shared lib.

This change doesn't make use of the new field, yet.

Bug: 335506668
Test: go test ./...
Change-Id: If0106642a11ba804630df79b4c5ebd608a77a6b1
2024-04-30 22:35:20 +09:00
yangbill
6d032dd911 Add a new property trim_extension for gensrcs
In order to provide a more flexible ability for gensrcs's output, due to
current output_extension property will only allow to replace the string
after the last "." of input, in order to handle input with multiple dot
in file name, provide a way to trim the suffix of input string.

Bug: 335536003
Test: cd build/soong/genrule ; go test -run TestGenSrcs
Test: cd build/soong/genrule ; go test -run TestGenSrcsWithTrimExtAndOutpuExtension
Test: cd build/soong/genrule ; go test -run TestGenSrcsWithTrimExtButNoOutpuExtension
Test: cd build/soong/genrule ; go test -run TestGenSrcsWithOutpuExtension
Test: cd build/soong/android ; go test -run TestPathsForModuleSrc

Change-Id: I033bbe1d225f207f0f6bdc140df308884f214b51
2024-04-30 05:06:56 +00:00
Treehugger Robot
29067ccade Merge changes from topics "fix_selects_appending", "refactor_selects" into main
* changes:
  Update accesses to ConfigurableCondition
  Add test for configurable defaults applied to multiple modules
2024-04-30 01:15:42 +00:00
Spandan Das
36c329ce77 Move coverage builds prebuilt special case to make
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-29 22:04:02 +00:00