Commit Graph

8692 Commits

Author SHA1 Message Date
Priyanka Advani (xWF)
c420be6e76 Merge "Revert "Allow modules to override --error-when-new UnflaggedApi"" into main am: 2075155076
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247908

Change-Id: I697bdf0d2391b838d7a59a6db409b7baa7196871
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-29 19:07:07 +00:00
Priyanka Advani (xWF)
2075155076 Merge "Revert "Allow modules to override --error-when-new UnflaggedApi"" into main 2024-08-29 18:56:17 +00:00
Priyanka Advani (xWF)
b09c0d25c9 Revert "Allow modules to override --error-when-new UnflaggedApi"
This reverts commit 3001ce3bf5.

Reason for revert: Droidmonitor created revert due to b/363016109

Change-Id: Iaf3ca41520b4328fc727af8837e5dff6def41f2b
2024-08-29 18:48:14 +00:00
Treehugger Robot
bcd2eb039e Merge "Allow modules to override --error-when-new UnflaggedApi" into main am: f016b08ece
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248195

Change-Id: Ibc31a18dbefa39ec6eacae8165c4b76cc240ac9f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-29 18:02:09 +00:00
Treehugger Robot
f016b08ece Merge "Allow modules to override --error-when-new UnflaggedApi" into main 2024-08-29 17:58:56 +00:00
Paul Duffin
3001ce3bf5 Allow modules to override --error-when-new UnflaggedApi
Some `java_sdk_library` and `droidstubs` modules already specify
`--error UnflaggedApi` but they are currently ignored because they are
added before the `--error-when-new UnflaggedApi` automatically added by
Soong and Metalava uses the last setting. That means adding
`--error-when-new UnflaggedApi` in change https://r.android.com/3248013
actually reduced the severity of the issue for those modules making it
more likely that they would be missed.

This change only adds the `--error-when-new UnflaggedApi` if it does
not already appear in the metalava command.

Bug: 361582214
Test: m checkapi
Change-Id: I499183276c7520605cca7acc6e6e9ab535feaa86
2024-08-29 15:35:58 +01:00
Priyanka Advani (xWF)
c2ba6683c5 Merge "Revert^3 "Implement detecting container violations."" into main am: 88a8daf8ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248525

Change-Id: I7969a4be11e013e100f4be9fb13914244b094b7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 23:30:03 +00:00
Priyanka Advani (xWF)
88a8daf8ca Merge "Revert^3 "Implement detecting container violations."" into main 2024-08-28 23:20:03 +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
4e373a7904 Merge changes Ia693c4a5,I8e5620d2 into main am: c14be38f1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247222

Change-Id: Id0c06c93eda0e4978d9df052542370f28e64da38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 21:43:02 +00:00
Jihoon Kang
c14be38f1a Merge changes Ia693c4a5,I8e5620d2 into main
* changes:
  Revert^2 "Implement detecting container violations."
  Define additional container violations
2024-08-28 21:35:16 +00:00
Treehugger Robot
86b818fe76 Merge "Report UnflaggedApi issues as warnings but treat as errors when new" into main am: 5fa409b88e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248013

Change-Id: Ieeb57fcf4365e1134123f17a16a7ad8d6d5d6bcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 19:20:05 +00:00
Treehugger Robot
5fa409b88e Merge "Report UnflaggedApi issues as warnings but treat as errors when new" into main 2024-08-28 19:13:24 +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
Paul Duffin
88d3b39846 Report UnflaggedApi issues as warnings but treat as errors when new
The `UnflaggedApi` issue is only reported when doing API linting and
defaults to `Severity.HIDDEN` because AndroidX (among other users) do
not support using `@FlaggedApi` annotations. This change switches it to
be warning by default in the  Android build as there are some existing
instances of it, but will be treated as an error by the "Build Warnings
Aye Aye Analyzer" in a Gerrit change if it occurs on lines that are
modified/added by that change.

Bug: 361582214
Test: m checkapi
Change-Id: Ie5ed23d00dd49454aeb5b43ccd8ad027d9d34fd2
2024-08-28 18:24:02 +01:00
Satish Yalla
b2407feae1 Merge "Revert "Implement detecting container violations."" into main am: f2d6e5004f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3244001

Change-Id: Ibfcf7b1965a52402917a32a203bf55cb82d1626b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 05:52:08 +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
30f3795688 Merge "Implement detecting container violations." into main am: 26f071db92
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3155659

Change-Id: Id60c6920d6c964193b53c8b5f7026472c5fcacb0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 04:43:21 +00:00
Treehugger Robot
26f071db92 Merge "Implement detecting container violations." into main 2024-08-28 04:39:12 +00:00
Treehugger Robot
cd08b3bfda Merge "dexpreopt rules for google mainline prebuilts with missing source" into main am: 529da9b897
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241767

Change-Id: Ic80a3aef33c0b43c1c28e1bc8c8b9501a6bd4799
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 01:28:20 +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
e1028aa539 Merge changes from topic "ctx_in_ideinfo" into main am: 9cbbafe300
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3246818

Change-Id: Ia2b721e9967c0772acd7dd261ec18315f6c26b5e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 00:53:10 +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
Treehugger Robot
cc02a664cf Merge "Make IdeInfo into a provider" into main am: 78a3761bde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3245754

Change-Id: If90b650d7e0832de74a858c541277f9658f477c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 23:55:40 +00:00
Treehugger Robot
78a3761bde Merge "Make IdeInfo into a provider" into main 2024-08-27 23:49:10 +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
Cole Faust
08c7f86575 Make IdeInfo into a provider
In order to keep the changes minimal, call the old IdeInfo method right
after GenerateAndroidBuildActions and then set the result of that
into a provider.

Test: Diff'd ninja files and saw no difference.
Change-Id: Ic706e7dbcb7c6e3d2a381ddae383eb87e105f385
2024-08-27 15:50:35 -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
8bd23c11bd Merge "Contents validation of override_apex's bootclasspath fragments" into main am: 39d61f53ff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241777

Change-Id: Ib59bb6607b8b35a3fe4e85815d5d2c325f9b4899
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 20:41:11 +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
Spandan Das
3f90d0bfe6 Merge "Move installation rules of dexpreopt'd apex systemserver jars to soong" into main am: 18c2607bde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3237119

Change-Id: I340ad00b8bff36520f3335f11fec8b307531f1ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-26 22:36:51 +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
Treehugger Robot
b354c61de5 Merge "Guarantee frameworks.aidl stability." into main am: 7389ad5c18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3236516

Change-Id: Ife4978df1cc8bd8272a4ea4ce36f197ee93c4fb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-26 21:29:22 +00:00
Treehugger Robot
7389ad5c18 Merge "Guarantee frameworks.aidl stability." into main 2024-08-26 21:21:19 +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
Treehugger Robot
85beba636a Merge "Remove suffix based stub matching logic" into main am: 65c530c17e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3235808

Change-Id: Iad8c5a6fc68dc6e8cc2770a4f3f57a9fac18d3be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-23 03:52:13 +00:00
Treehugger Robot
65c530c17e Merge "Remove suffix based stub matching logic" into main 2024-08-23 03:42:12 +00:00
Treehugger Robot
97f6eac103 Merge "Make java_sdk_library phony target depend on its stub jar" into main am: fe5f57b27f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3236043

Change-Id: Iea26027f6a9948fa3407df84831a075b957463be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-23 03:20:34 +00:00
Treehugger Robot
fe5f57b27f Merge "Make java_sdk_library phony target depend on its stub jar" into main 2024-08-23 03:14:53 +00:00
Jihoon Kang
4b9220af10 Make java_sdk_library phony target depend on its stub jar
Currently, the (from-text) stub jar depends on the check api timestamp
of the same api scope droidstubs. However, building the top level
sdk_library phony target does not trigger check api, as the top level
java_sdk_library "depends" on the stub submodules but the top level
phony target does not build the stubs generated by its submodule, nor
the top level java_sdk_library generate any output files.

In order to support the user's workflow of observing checkapi failure
after modifying the api by running `m <java_sdk_library name>`, this
change adds the paths to the stub jars as dependencies as the top level
java_sdk_library phony target.

Bug: 234113632
Test: modify source file api, run m <java_sdk_library name> and observe checkapi failure
Change-Id: Iccd42c8ef7d5de20f71c347455c1a90d83a6c70c
2024-08-22 22:11:04 +00:00
Jihoon Kang
fa3f0782f7 Remove suffix based stub matching logic
This change prevents non-stub modules with stub suffix from being
determined as the stub module, and instead makes the check more robust
by determining the condition based on the user-hidden
`Stub_contributing_api` property, which is only set for the stub
submodules generated by `java_sdk_library`.

Test: m nothing --no-skip-soong-tests
Bug: 361179822
Change-Id: I28a599c5b4fe1e8460e60580c0535aaf19e39ba3
2024-08-22 22:05:03 +00:00
Yu Liu
de9f7f2f00 Merge "Access output files thru providers in Soong tests." into main am: fed2be9f98
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3233572

Change-Id: If5bbef16025bfe3d95615398ac4afa97604daf29
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-21 17:31:58 +00:00
Steven Moreland
465baeed14 Guarantee frameworks.aidl stability.
Apps share these classes from the BCP, so even if
they are changed, they stay in sync.

Bug: 258850063
Test: build
Change-Id: I50b6a928c29f5d9eca9496b91363a8fc5d397b00
2024-08-21 16:47:49 +00:00
Yu Liu
51c2231eab Access output files thru providers in Soong tests.
The outputFiles field on ModuleBase will be removed next.

Bug: 358425833
Test: CI
Change-Id: I6d665ac13134d9278e5908f64c454366bc6bca5e
2024-08-21 00:03:50 +00:00
Treehugger Robot
c59a128390 Merge "Restrict R8 -libraryjars refs for stable targets" into main am: 0fd3de6151
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3233562

Change-Id: I719d8ec110b692833aed69550f24eaa7159de6f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-20 22:37:26 +00:00
Treehugger Robot
0fd3de6151 Merge "Restrict R8 -libraryjars refs for stable targets" into main 2024-08-20 22:31:28 +00:00
Jared Duke
2246844554 Restrict R8 -libraryjars refs for stable targets
The current R8 dex pipeline gathers transitive header jars to avoid
issues with missing class definitions. While this is benign for
platform targets not using a stable SDK, it can introduce issues
for stable targets (e.g., duplicate class defs for mainline framework
modules).

Bypass this transitive jar referencing for such targets that should
reference explicit, stable, stub API libraries. A follow-up change
will resolve specific issues with mainline system server targets.

Bug: 360905238
Test: m
Change-Id: I11a136d33ca9dd0dfff436c7045bf1807d17b1e7
2024-08-20 20:45:35 +00:00
Cole Faust
0821a8cf57 Merge "Only add deps on java_binary's jni_libs on host" into main am: b4cc88efef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3230584

Change-Id: I5a6588ee4724f6b128e0e2ed5092b3f52c57996c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-20 20:13:16 +00:00