Commit Graph

950 Commits

Author SHA1 Message Date
Jooyung Han
1955d600d6 Merge changes Ia9f2186e,Ibe567d3b into main am: 0a9eb7f657 am: e1b039d184
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247637

Change-Id: I70cf56e14a9bc13b1c8499037f8ddca3e54b0dd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 01:40:10 +00: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
Jihoon Kang
a5a744226b Merge "Revert^4 "Implement detecting container violations."" into main am: 7344482ff3 am: 9e40f8f9b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248019

Change-Id: I77818bede2be74dc6755a55c5a8e69a1c6a7f64c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-30 20:31:34 +00:00
Jihoon Kang
85bc193805 Revert^4 "Implement detecting container violations."
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-29 17:55:00 +00:00
Priyanka Advani (xWF)
523efd1db1 Merge "Revert^3 "Implement detecting container violations."" into main am: 88a8daf8ca am: c2ba6683c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248525

Change-Id: I81f89cb4da10d34d2de5c48093bf43a76b81d769
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 23:38:16 +00:00
Priyanka Advani (xWF)
33b3a638a5 Revert^3 "Implement detecting container violations."
2a88491afc

Change-Id: Iba4527f391a093703978fe01177b56fec4604b28
2024-08-28 23:10:29 +00:00
Jihoon Kang
2ad26bc6ea Merge changes Ia693c4a5,I8e5620d2 into main am: c14be38f1a am: 4e373a7904
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247222

Change-Id: Ic901c1d2deef5f61e661cd07aa620b8ffdaf39df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 21:52:18 +00:00
Jihoon Kang
2a88491afc Revert^2 "Implement detecting container violations."
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-28 18:01:25 +00:00
Satish Yalla
fa0019bf1f Merge "Revert "Implement detecting container violations."" into main am: f2d6e5004f am: b2407feae1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3244001

Change-Id: Iddc3110928d6d237de002dc65e033e7940e2b11e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 06:00:22 +00:00
Satish Yalla
f2d6e5004f Merge "Revert "Implement detecting container violations."" into main 2024-08-28 05:48:21 +00:00
Satish Yalla
b2b1ef63e2 Revert "Implement detecting container violations."
This reverts commit bb678f82d6.

Reason for revert: Droidmonitor created revert due to b/362639013. Will be verifying through ABTD before submission.

Change-Id: I1dcb71672eeb44a17cf176d3731bcaf9aaf81edf
2024-08-28 05:10:31 +00:00
Treehugger Robot
3b407afefb Merge "Implement detecting container violations." into main am: 26f071db92 am: 30f3795688
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3155659

Change-Id: If66625fe313efbbf9b50ebaee77e9ab718db58e9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 04:51:30 +00:00
Treehugger Robot
26f071db92 Merge "Implement detecting container violations." into main 2024-08-28 04:39:12 +00:00
Spandan Das
8d3944aab2 Merge changes from topic "cc_prebuilt_stubs" into main am: a6f4b6b104 am: 87f001129a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3221926

Change-Id: Ic7a88d1113374f8934a570c1b8608080092c485f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 19:54:58 +00:00
Spandan Das
a6f4b6b104 Merge changes from topic "cc_prebuilt_stubs" into main
* changes:
  Skip `-Wl,--version-script` on libclang_rt.* stubs (temp hack)
  Special case the stubgen args for bionic libs
  Add stub generation support to cc_prebuilt_library
2024-08-27 19:37:08 +00:00
Jihoon Kang
bb678f82d6 Implement detecting container violations.
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-27 17:30:42 +00:00
Treehugger Robot
40c2548b66 Merge "apex: apex_available with prefix" into main am: d4daa43150 am: 7af3d43dfb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3223005

Change-Id: I5aecf775722fd2fdd209adb9d1e6a492d544032b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-20 21:46:49 +00: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
Treehugger Robot
61e7802b97 Merge "Clean up: remove com.android.gki.*" into main am: 75b14ee1a6 am: 48f28c9232
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3223004

Change-Id: I8073c82e183c1519885c9c9f64892426c9f3443b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 22:47:04 +00:00
Jooyung Han
40b7917fd0 Clean up: remove com.android.gki.*
It's abandoned.

Bug: n/a
Test: m nothing --no-skip-soong-tests
Change-Id: I220bea87329ee532d494cc4eaa4c6a8c1b0bff07
2024-08-16 16:02:42 +09:00
Spandan Das
357ffcc146 Add stub generation support to cc_prebuilt_library
The `stubs` property in `cc_prebuilt_library` currently does not support
generating stubs from an API symbol file. Reverse dependencies are
always linked against the .so file listed in `srcs`. This CL adds
support to generate the shared library from the .map.txt symbol file of
the prebuilt library.

Implementation details:
1. Add a compiler. This will convert the .map.txt file to a stub .c file.
  The build rules for this are common to the compiler of the source cc_*
moudule types. This has been refactored into a new function named
`compileModuleLibApiStubs`
2. Update the linker to link the aforementioned stub.c file into a .so
  file. Since this happens only for stub variants, it is conditionally
called only when p.buildStubs is true.
3. Call `addStubDependencyProviders`. This will populate the impl
   variant of the library with Stub information. cc#ChooseStubOrImpl
will use this information to resolve rdeps to the stub .so file if the
dependency crosses an api domain boundary.

(2) requires some special casing for now, since the module sdk at HEAD
does not contain symbol files, so the stub.c files will be empty. Once
the symbol files are added to module sdk, the special casing will be
removed.

Test: m nothing --no-skip-soong-tests
Bug: 275273834
Change-Id: I57f5b0a97fac4dfc8c24e07b06a330015add977d
2024-08-15 22:18:48 +00:00
Colin Cross
bb5c9f5d82 Merge changes If313580b,I68d50d68 into main am: 08b6061539 am: 6bdec0cbe6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214342

Change-Id: Ie9dd3fc7d9d901150257108b92d8ce4079796b44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-12 18:46:24 +00:00
Colin Cross
a66b4630f6 Add PrepareForTestWithBuildFlag
Add a helper function that creates a test fixture preparer that
sets a build flag, and use it everywhere that was setting build flags
manually.

Test: all soong tests
Flag: EXEMPT refactor
Change-Id: I68d50d68787a30d091f0827e8caa51f5c5a762ef
2024-08-09 16:47:45 -07:00
Treehugger Robot
f99ac31e34 Merge "Revert "Revert "Enable from-text stub generation in non-sdk java..."" into main am: 4f18cfdd7d am: 5d2439b3b1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3205865

Change-Id: I163753b63bc5b3b495d70ea46a15ebb5f58d2c68
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 19:25:01 +00:00
Treehugger Robot
4f18cfdd7d Merge "Revert "Revert "Enable from-text stub generation in non-sdk java..."" into main 2024-08-06 18:50:04 +00:00
Treehugger Robot
7bc808665e Merge "Hide unflagged mainline prebuilts with missing source." into main am: 9b10ca4711 am: fc413ce622
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3203370

Change-Id: I580da7d09016c230e9375667dcf3a7faa87dc7f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:36:09 +00:00
Jihoon Kang
377802211b Merge "Revert "Enable from-text stub generation in non-sdk java_sdk_library"" into main am: f6d9965cc5 am: ad5e953a7d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3207397

Change-Id: I411dc190da40073de7d794de9ad7ef8fd5da9ed3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:35:42 +00:00
Treehugger Robot
043401d91e Merge "Enable from-text stub generation in non-sdk java_sdk_library" into main am: 99417ba9ea am: 696cea31d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2983176

Change-Id: I298312e534e440f607bff40cc9ceae788edba9e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:33:22 +00:00
Jihoon Kang
b0f4c0239d Revert "Revert "Enable from-text stub generation in non-sdk java..."
Revert submission 3207397-revert-2982300-java_api_library_non_sdk-FIKZOSARQI

Reason for revert: Post submit build breakage culprit fixed

Reverted changes: /q/submissionid:3207397-revert-2982300-java_api_library_non_sdk-FIKZOSARQI

Change-Id: Ic79b7fd074f02febba94183cb1479874efe044b5
2024-08-06 00:15:25 +00:00
Treehugger Robot
9b10ca4711 Merge "Hide unflagged mainline prebuilts with missing source." into main 2024-08-05 23:10:53 +00:00
Jihoon Kang
f6d9965cc5 Merge "Revert "Enable from-text stub generation in non-sdk java_sdk_library"" into main 2024-08-05 20:51:31 +00:00
Liana Kazanova
a574cd28a8 Revert "Enable from-text stub generation in non-sdk java_sdk_library"
Revert submission 2982300-java_api_library_non_sdk

Reason for revert: DroidMonitor: Potential culprit for b/357648959 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:2982300-java_api_library_non_sdk

Change-Id: I5ef7afd9ec3e10ea99f82d02172843ad9b2cfda9
2024-08-05 19:45:03 +00:00
Spandan Das
85bd4625ed Hide unflagged mainline prebuilts with missing source.
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-08-05 18:25:37 +00:00
Treehugger Robot
99417ba9ea Merge "Enable from-text stub generation in non-sdk java_sdk_library" into main 2024-08-05 18:25:36 +00:00
Jooyung Han
77ef965f88 Merge "apex: respect PRODUCT_COMPRESSED_APEX for prebuilt APEXes" into main am: b42b703f53 am: de22d9608a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3201250

Change-Id: I7a27e264cffe85996836e0a3f0ccc5812ab99d53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-01 01:38:43 +00:00
Jooyung Han
26ec8484e4 apex: respect PRODUCT_COMPRESSED_APEX for prebuilt APEXes
If a prebuilt APEX is compressed, it's installed without decompression
even when PRODUCT_COMPRESSED_APEX is false.

This change decompresses the prebuilt/compressed APEX.

Bug: 356533488
Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=false m
Change-Id: Ifdde074e383837df92d172bc483bfca9a97cb6f8
2024-07-31 15:04:05 +09:00
Jihoon Kang
062eb663c5 Enable from-text stub generation in non-sdk java_sdk_library
This change allows from-text stubs to be generated for all
java_sdk_library modules, unlike how it is currently limited to the
modules that contribute to the api surfaces (i.e. the SDK).

This change accomplish this by modifying the dependency of the
from-text stubs generation, so that the sdk_library generated from-text
stubs generating java_api_library modules no longer depend on the full
api surface stubs, but generate the stubs in the module level, and
combined later to generate the full api surface stubs.

This change also removes the java_api_library modules defined in
core-libraries/Android.bp, which are passed to generate the system
modules. Given that the from-text vs from-source toggle is done within
the java_sdk_library stubs level, these modules no longer need to exist.

Implementation details:
- Allow sdk_version to be specified in java_api_library modules. For
  java_sdk_library-generated java_api_library modules, they inherit that
  of the sdk_library module. Some java_sdk_library modules that do not
  contribute to the api surface are allowed to set sdk_version to
  something other than "none" or "core".
- Implement java_api_library to implement `SdkContext`. This allows
  java_api_library to collect required deps from sdk_version (classpath,
  bootclasspath, system modules), and pass the collected jars when
  generating the stubs srcjar in metalava and compiling the stubs srcjar
  in javac.
- Remove hardcoded list of sdk_library modules that are allowed to
  genereate stubs from the api signature files, and allow from-text
  stubs generation by default. Modules that are not able to generate
  stubs from the api signature files are specified by setting the newly
  introduced `Build_from_text_stubs` property to `false`.

Test: ENABLE_HIDDENAPI_FLAGS=true m
Bug: 327507877
Change-Id: Ia35d2f3cf9fae48fc8c4bd99a84ae18d7c0e7bee
2024-07-30 22:35:06 +00:00
Treehugger Robot
45be135b5c Merge "Do not rename prebuilt apexes for product packaging" into main am: 9aa84c6110 am: 0b0a99f01f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3197217

Change-Id: I67dcce15611742c000fa9a1b1d205862a28e39af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-26 21:54:17 +00:00
Spandan Das
a8e2d6173d Do not rename prebuilt apexes for product packaging
https://r.android.com/2901309 added support for handling installation
rules for multiple prebuilts. One of the implementation details there
was to change LOCAL_MODULE name to the source apex name in the generated
.mk files.

This causes issues in partner builds where the google singed apex
com.google.android.foo gets renamed to com.android.foo in
out/soong/Android-$PRODUCT.mk. If the partner builds does not include
the aosp apex in its PRODUCT_PACAKGES, then the google signed apex gets
elided from packaging.

This CL undoes that change. After this CL, the name of the module as it
appears in Android.bp will match the LOCAL_MODULE name emitted for
product packaging.

Test: in build/soong, go test ./apex
Bug: 355682304
Change-Id: Icadbb75609174cff5326f52baf7d53e901f9f1c0
2024-07-26 19:24:27 +00:00
Treehugger Robot
70944ae559 Merge "Drop module sdk MakeUninstallable special case" into main am: 9a2f01b762 am: e58421b340
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3188499

Change-Id: If776629cec033090af07a732209eb5dd3464042e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-23 17:24:30 +00:00
Spandan Das
2f68f1903a Drop module sdk MakeUninstallable special case
Platform variants of module sdk libraries were marked as uninstallable
originally in https://r.android.com/1974259. This special case is no
longer necesssary - android.MutateApexTransition will call
MakeUninstallable on the platform variant on both the source and
prebuilt soong modules when the following conditions are met
- //apex_available:platform is not listed in apex_available (explicitly
  or via the default implicit)
- the soong module is included in an apex that exists in the tree
  (listed in native_shared_libs)

Since MakeUninstallable is set by apex specific mutators, the relevant
unit test has been moved to the apex package. The Android.bp of the test
has also been extended with an apex that includes the shared library.

Test: m nothing --no-skip-soong-tests
Test: no diff in out/soong/Android-$product.mk
Test: added prebuilt_libdexfile to art's apex_contributions locally, no
diff in out/soong/Android-$product.mk

Bug: 220898484
Change-Id: I43a324882d486451bb921028853508d7ec3d76bf
2024-07-22 23:13:20 +00:00
Treehugger Robot
53ad20c491 Merge "Min_sdk_version check for updatable apexes" into main am: 0adcc8c83d am: 03042b57a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3156080

Change-Id: Ic9c99a819610af549b95f9546df39ea657b052af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-16 19:45:38 +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
8cd1fa9d0a Merge "Remove test_per_src" into main am: 088123934b am: d66ec63bde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3142038

Change-Id: I0aab777c604498195d67bf8e70f338f3b373210c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-11 21:07:57 +00:00
Colin Cross
088123934b Merge "Remove test_per_src" into main 2024-07-11 20:32:23 +00:00
Jooyung Han
041fd84523 Remove apex.generate_hashtree
It's deprecated.

Ignore-AOSP-First: internal branches use this. Will be gone.
Fixes: 184914612
Test: m
Change-Id: I14316a9a288ffc2727bb7033ebded4f4d48b1e6c
2024-07-04 13:06:17 +09: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
Jihoon Kang
784c005241 Add unit test for sdk impl lib's lint report propagation to the apex
This change adds a unit test for https://r.android.com/3146677

Test: m nothing --no-skip-soong-tests
Bug: 339267677
Change-Id: I48e1c2681aaa153b32b209f05a93c501af5d1bac
2024-06-25 22:15:39 +00:00