3675 Commits

Author SHA1 Message Date
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
Jooyung Han
a89a58ac1c Remove apex_available allowlist
Bug: 147364041
Test: m nothing --no-skip-soong-tests
Change-Id: I65ac605fe77a9e013a2c0b64adc36db414c77465
2024-08-29 13:00:33 +09: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
Treehugger Robot
ab740c544b Merge "dexpreopt rules for google mainline prebuilts with missing source" into main am: 529da9b897 am: cd08b3bfda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241767

Change-Id: Idbccd4c9d99c8a803a97a81c3ad29885aff30085
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 01:36:29 +00:00
Treehugger Robot
529da9b897 Merge "dexpreopt rules for google mainline prebuilts with missing source" into main 2024-08-28 01:25:52 +00:00
Treehugger Robot
3aca762ba7 Merge changes from topic "ctx_in_ideinfo" into main am: 9cbbafe300 am: e1028aa539
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3246818

Change-Id: Id12e0cbdeba1d100d7c755fbcf4336bc1f7c0554
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 01:01:20 +00: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
Spandan Das
8a2c56c516 dexpreopt rules for google mainline prebuilts with missing source
AddFarVariationDependencies runs into issues in partner workspaces which
do not contain the sources of google mainline prebuilts, since the
prebuilt would be renamed in a prior prebuilt_rename mutator. To account
for this rename, add `prebuilt_` prefix in
`addDependenciesOntoSelectedBootImageApexes` to ensure that the prebuilt
apex does not get elided

Test: m nothing --no-skip-soong-tests
Test: in v-aml-prebuilt dev,
aninja -t query out/soong/dexpreopt_arm64/dex_bootjars_input/okhttp.jar | head -n3
out/soong/dexpreopt_arm64/dex_bootjars_input/okhttp.jar:
  input: g.android.Cp
    out/soong/.intermediates/vendor/partner_modules/ArtPrebuilt/prebuilt_com.google.android.art_compressed.deapexer/android_common/deapexer/javalib/okhttp.jar
(uses the prebuilt deapexed boot jar, and no the source apex boot jar)

Bug: 362163831
Change-Id: Ie94a36911ab40ac09a470efe505fd00ef3a5bf9c
2024-08-27 22:01:11 +00:00
Spandan Das
4c2221e8f0 Merge "Contents validation of override_apex's bootclasspath fragments" into main am: 39d61f53ff am: 8bd23c11bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241777

Change-Id: I5c0904ecd2136cde891f6f3144c679f07d711e86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 20:47:57 +00:00
Spandan Das
39d61f53ff Merge "Contents validation of override_apex's bootclasspath fragments" into main 2024-08-27 20:32:01 +00:00
Treehugger Robot
dc9fe3495d Merge "Add a property to rust_ffi targets to exclude them from APEXes." into main am: a5762dd78b am: 8617c2d1bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3236101

Change-Id: I152db50a2663efbc644edeadc41873644eb591ce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 20:31:13 +00:00
Treehugger Robot
a5762dd78b Merge "Add a property to rust_ffi targets to exclude them from APEXes." into main 2024-08-27 20:13:19 +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
Spandan Das
ed7a030c6c Contents validation of override_apex's bootclasspath fragments
https://r.android.com/3083813 added support for overriding
min_sdk_version, and creating separate variants of transitive
dependencies of override apexes. This causes issues when there is a skew
between apex boot jars of source and prebuilt mainline modules. For
mediaprovider google apex, we now have _two_ source variants of
mediaprovider bcp fragment module.

This CL uses ApexInfo.BaseApexName to skip the check on both variants of
bootclasspath/systemserverclasspath fragments.

This CL also removes the prefix based check to determine if prebuilts
are active. If RELEASE_APEX_CONTRIBUTIONS for a specific mainline module
is set, it will be assumed that prebuilts for that mainline module are
active.

Test: go test ./apex ./java
Bug: 361771739

Change-Id: I01f7ef437df8f10b74ffa397ba461ff4f1f9bed6
2024-08-27 18:48:46 +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
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
2dc873402e Merge "Move installation rules of dexpreopt'd apex systemserver jars to soong" into main am: 18c2607bde am: 3f90d0bfe6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3237119

Change-Id: I3ee21598635a4c6628e47357ff06a54dceaeda23
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-26 22:45:33 +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
Yu Liu
ade30511e1 Merge "Remove installFilesDepSet, packagingSpecsDepSet and licenseInstallMap from ModuleBase." into main am: ad64c5f370 am: afb4e9440d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3236345

Change-Id: I8800b793a484b2cb086209e34ba75daf5d991f35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-26 19:11:21 +00:00
Yu Liu
bad1eef6d8 Remove installFilesDepSet, packagingSpecsDepSet and licenseInstallMap
from ModuleBase.

The old packagingSpecsDepSet field is kept temporarily to bypass an
auto-merge issue, and will be removed in next change.

Bug: 358425833
Test: CI
Change-Id: I28b4933459c33224f756cc306cabc8088f9be862
2024-08-26 17:45:38 +00:00
Yu Liu
c6335186a4 Revert "Remove installFilesDepSet, packagingSpecsDepSet and lice..."
Revert submission 28945194-Remove installFilesDepSet

Reason for revert: will resubmit from aosp

Reverted changes: /q/submissionid:28945194-Remove+installFilesDepSet

Change-Id: I2a04998774da71ad0415958d7e1633a0833293f9
2024-08-23 19:04:39 +00:00
Yu Liu
8e5db7d26c Remove installFilesDepSet, packagingSpecsDepSet and licenseInstallMap
from ModuleBase.

Bug: 358425833
Test: CI

Ignore-AOSP-First: a internal only project will be broken if submitting
AOSP first.

Change-Id: I2863265a01083d3c624c8a111be0531b519f1288
2024-08-22 20:54:50 +00:00
Treehugger Robot
b4445a0275 Merge "Remove apexFilesForAndroidMk from prebuilt apex module types" into main am: 5f42006902 am: da92d4238e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3233745

Change-Id: Ice2fe133fb6257d916a0f60b7615b5c10d6ee840
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-21 17:10:42 +00:00
Treehugger Robot
5f42006902 Merge "Remove apexFilesForAndroidMk from prebuilt apex module types" into main 2024-08-21 16:53:00 +00:00
Spandan Das
a18d42d324 Remove apexFilesForAndroidMk from prebuilt apex module types
This seems to be unused

Test: no diff in ninja file
Change-Id: Ib711294a4f30fe1db564e3b01d944e8813d0b4ac
2024-08-21 00:54:07 +00:00
Cole Faust
9a8df16ac3 Merge "Make native_shared_libs configurable" into main am: 5fdb54d439 am: c6c90e61a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3233522

Change-Id: I1c7d71b2b5d5e6000acbefd7dc2f2a187b83ed25
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-20 23:12:51 +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
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
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
Kiyoung Kim
e43049d38a Merge "Introduce vintf_fragment module type" into main am: dd00f2de3c am: a1d5004a0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3213372

Change-Id: I9cd4a450e7e56268bee2177f687f79271ccdcd14
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 00:59:21 +00:00
Kiyoung Kim
dd00f2de3c Merge "Introduce vintf_fragment module type" into main 2024-08-16 00:26:16 +00:00
Treehugger Robot
f1387a54a1 Merge "Improve docs for Deapexer modules" into main am: 334efc0fb1 am: 27811bb576
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3217132

Change-Id: I2d1973ca44f54b0cdd40f2f575e797f95c2187ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-15 22:55:15 +00: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
Treehugger Robot
334efc0fb1 Merge "Improve docs for Deapexer modules" into main 2024-08-15 22:13:04 +00:00
Treehugger Robot
3dd87f7a81 Merge "Support configurable prebuilt apex sources" into main am: 3306d84c07 am: ce1a11c339
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3219956

Change-Id: I0c98f74fac97834f64dcce782186ebf0650494bd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-15 16:21:01 +00:00
Treehugger Robot
3306d84c07 Merge "Support configurable prebuilt apex sources" into main 2024-08-15 15:43:52 +00:00
Cole Faust
642e720b5b Support configurable prebuilt apex sources
Bug: 342006386
Fixes: 359690321
Test: m nothing
Change-Id: I2e503932c7fdb3eea9cd2dfedd86029ff52cfbe1
2024-08-14 17:46:12 -07:00