Commit Graph

8311 Commits

Author SHA1 Message Date
Jihoon Kang
9e68e0e980 Merge "Prepare to generate "runtime" stubs in droidstubs" into main am: dbc88dc4d0 am: e3602321e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2921390

Change-Id: Ic4d1b65351314e70eb5d37d91b06fae8f627e2b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-24 22:43:51 +00:00
Jihoon Kang
dbc88dc4d0 Merge "Prepare to generate "runtime" stubs in droidstubs" into main 2024-01-24 21:30:38 +00:00
Jihoon Kang
5d8ee7234d Merge "Error when WITHOUT_CHECK_API=true in from-text stub build" into main am: 5373efc1c7 am: 325278c925
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2925990

Change-Id: I7705e660a39bb60364f32b41c68950e87393ff4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-24 19:53:02 +00:00
Colin Cross
f5f4ad3db6 Convert coverageMutator to a TransitionMutator
Convert coverageMutator to a TransitionMutator as a step towards
variants-on-demand.

Bug: 319288033
Test: coverage_test.go
Test: treehugger coverage builds
Change-Id: Ic50c0040dea8b42c36b5d784221daa00b7b0d379
2024-01-24 10:17:10 -08:00
Jihoon Kang
5373efc1c7 Merge "Error when WITHOUT_CHECK_API=true in from-text stub build" into main 2024-01-24 18:06:53 +00:00
Spandan Das
0b7089f134 Ensure sscp jars get copied to $OUT/soong/system_server_dexjars
(This was missed in aosp/2876756, which copied only the bcp jars)

This hardcoded location is used by dex2oat to compile the dexpreopt
artifacts. The copy rules are currently generated by java_(sdk)_library
for source builds, and their prebuilt counterparts in prebuilt builds.

After this change, the copy rule will be bifurcated between source and
prebuilt builds
1. For source builds, it will come from java_(sdk)_library
2. For prebuilt builds, it will come from the top-level prebuilt apex.
   Since there can be multiple prebuilt apexes in trunk stable,
   HideFromMake will be used to determine which deapexed jar to copy.

The bifurfaction is expected to be temporary. It is needed for now since
the `apex_contributions` which will be used for source vs prebuilt
selection have not been populated completely.

Test: Added a unit test
Test: Presubmits
Test: git_master-art-host:
art-gtest (https://android-build.corp.google.com/builds/abtd/run/L40800030001459791)
Test: git_main:art_standalone_tests
(https://android-build.corp.google.com/builds/abtd/run/L09000030001463855)

Bug: 308790457

Change-Id: I3105d3b3a7e5c41cb601d07806f4ea483a61b50a
2024-01-24 05:14:40 +00:00
Cole Faust
22e8abcaa6 Make hiddenAPIFlagFileCategory an int
hiddenAPIFlagFileCategory used to contain function pointers, and is
used in a provider. Providers must be serializable for incremental
soong support, so the function pointers must be removed.

Refactor hiddenAPIFlagFileCategory into a simple int.

Bug: 322069292
Test: m nothing --no-skip-soong-tests
Change-Id: I2bd50fa1b59979f30869b405314cbef16ee345f1
2024-01-23 18:01:47 -08:00
Jihoon Kang
91bf3dd4ac Error when WITHOUT_CHECK_API=true in from-text stub build
Given that WITHOUT_CHECK_API=true is incompatible with from-text stub
build, this change makes the module raise an error when the two
conflicting configurations are set.

This change also modifies the checkapi error message, that
DISABLE_STUB_VALIDATION does not bypass checkapi.

Test: m nothing --no-skip-soong-tests && WITHOUT_CHECK_API=true m nothing
Bug: 322060779
Change-Id: I597309baa8fcfbefa05863c7b392bfb8b6774cea
2024-01-24 01:21:47 +00:00
Jihoon Kang
b85d6ffa61 Merge "Rename apiScope.stubsTag" into main am: fbe572b064 am: 802f2238fb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2921389

Change-Id: Ifdd497519b9dc0b31d49cb05442e82b45896d270
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-23 02:17:49 +00:00
Jihoon Kang
fbe572b064 Merge "Rename apiScope.stubsTag" into main 2024-01-23 01:43:55 +00:00
Jihoon Kang
ee11328709 Prepare to generate "runtime" stubs in droidstubs
In order to prepare generating "runtime" stubs in droidstubs, this
change performs some cleanups, which are:

- Modify droidstubs providers methods to take a StubsType enum as an
  input, in order to remove exportable-specific providers. The methods
  are also modifed to return an error when the artifact is not provided
  for the input StubsType.

- Wrap droidstubs artifact to a struct. This removes artifacts common to
  all stubs types from being written out as a individual module property
  (e.g. exportableAnnotationsZip -> exportableArtifacts.annotationsZip)

Test: m nothing --no-skip-soong-tests
Bug: 319162970
Change-Id: I6d6c57c5417ca71eab5ddda7981b71fd84fa6ee1
2024-01-23 00:29:25 +00:00
Jihoon Kang
b743155a26 Rename apiScope.stubsTag
The different roles of stubs (e.g. dependency to java modules,
hiddenapi, dist to sdk snapshot) are now split to different set of stubs
(everything, exportable and eventually runtime), while a single set of
stubs are responsible for all roles for the prebuilt stubs. Thus, the
stubs from source are depending different stubs tag (e.g.
everythingStubsTag, exportableStubsTag), while the prebuilt stubs
utilize stubsTag. Given that this tag is only used for the prebuilt
stubs, it can be renamed to `stubsTag`.

Test: m nothing --no-skip-soong-tests
Bug: 319162970
Change-Id: Iacdf434fab6a403482fd2f1de24e6f260ad80756
2024-01-22 19:40:08 +00:00
Cole Faust
24e25c0499 Re-enable strict updatability linting
Now that all use cases where it would've errored on are removed.

Ignore-AOSP-First: the properties were only removed in internal main to make the LSC smaller
Bug: 320698986
Test: m nothing --no-skip-soong-tests, and also locally edited soong to add a quick build that runs all the strict updatability checks in the tree and ran that
Change-Id: If9e23327a3c0944cc8c6849914fe51dc48bdb626
2024-01-19 14:15:34 -08:00
Colin Cross
fdacb77500 Fix data race in propagateRROEnforcementMutator am: 7e6a9012c0 am: e2f1b79768
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2913032

Change-Id: I2f064ea2abc1d9b04a20a63b1c9aae2c1c66e322
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 01:08:40 +00:00
Colin Cross
95c6bc0fab Fix data race in dex_bootjars am: 84ed511ceb am: 85426ee04f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2913030

Change-Id: I978c42a28ee5d7cf5ebce1388a07b1d2661a1b82
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 01:08:32 +00:00
Colin Cross
e2f1b79768 Fix data race in propagateRROEnforcementMutator am: 7e6a9012c0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2913032

Change-Id: I8e425838331f483e4a644a8c7b547a250c4d9114
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 00:26:27 +00:00
Colin Cross
85426ee04f Fix data race in dex_bootjars am: 84ed511ceb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2913030

Change-Id: Ie025407c0baf94615c7cbb7a5bcbecabcf4c216e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 00:26:21 +00:00
Colin Cross
1b1b9a937b Merge changes from topic "soong-tests-presubmit" into main
* changes:
  Add script to run Soong tests with go tools
  Disable TestVariantSingletonModule when go test -short is used
  Fix data race in propagateRROEnforcementMutator
  Fix data race in finder_test.go
  Fix data race in dex_bootjars
  Fix race CommonGlobalCflags when running tests in parallel.
  Fix data race in snapshot singletons when running parallel tests
2024-01-18 23:58:45 +00:00
Treehugger Robot
029e2b71f2 Merge "Add better error handling to bootDexJar function" into main am: 193bb8c317 am: e71b0efd54
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2912400

Change-Id: I7e55e49bc317eb4186b4716516884dff596a153e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-18 22:09:51 +00:00
Colin Cross
7e6a9012c0 Fix data race in propagateRROEnforcementMutator
propagateRROEnforcementMutator walks dependencies of each module and
modifies them via SetRROEnforcedForDependent.  That is unsafe in a
parallel mutator, as the same dependency could be being visited by
two parent modules at the same time.  Don't mark it as a parallel
mutator.

Test: go test -race ./...
Change-Id: I9870aaa7d165bf72b751e3ceff5a2a3eb4d74ec4
2024-01-18 13:23:06 -08:00
Treehugger Robot
193bb8c317 Merge "Add better error handling to bootDexJar function" into main 2024-01-18 20:38:13 +00:00
Colin Cross
84ed511ceb Fix data race in dex_bootjars
Move fields in bootImageConfig that are written during
GenerateAndroidBuildActions into a provider to avoid a data race.

Test: go test -race ./...
Change-Id: I0d6783530843889b96f32d748bda7824493d2e32
2024-01-17 16:10:37 -08:00
Spandan Das
3a3920129d Add better error handling to bootDexJar function
aosp/2876754 missed adding error handling to one of the places which
consumes the dex jar deapexed from prebuilt apexes. This CL ensures that
when we have multiple prebuilt apexes _without_ flagging, the hiddenapi
processing code emits a more descriptive error "Multiple deapxers..."
rather than a cryptic error "<module> does not provide a dex jar"

Test: m nothing --no-skip-soong-tests

Change-Id: I80849fa7cca17d724ac53c94bb353b169175ee28
2024-01-17 20:59:43 +00:00
Treehugger Robot
f3aafbddc4 Merge "Promote the NewApi check to an error again" into main 2024-01-17 17:47:16 +00:00
Cole Faust
028b94cdc5 Promote the NewApi check to an error again
Now that all existing cases have been baselined.

Ignore-AOSP-First: Requires a LSC that is difficult to do across branches.
Bug: 268261262
Test: m lint-check
Change-Id: I413f86ff7a1f33564465f3ba9cd52924a4242901
2024-01-17 07:45:35 +00:00
Treehugger Robot
a6ba24bcfe Merge "Remove HideFlaggedApi() related logic and the related product variables" into main am: c0412f5d31 am: bd44b17537
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2911028

Change-Id: I1b06464b5784e64825ffa81209971ba944b4be8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 01:42:48 +00:00
Treehugger Robot
c0412f5d31 Merge "Remove HideFlaggedApi() related logic and the related product variables" into main 2024-01-17 00:20:54 +00:00
Treehugger Robot
b31d06a669 Merge "Disable prebuilt apps without an apk later" into main am: 535f739153 am: 731c981258
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2909137

Change-Id: I92c58414ee2825f327c3f5475d1216e497272490
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-16 21:50:25 +00:00
Treehugger Robot
751c28bba9 Merge "Implicitly bump up Java target to 1.8" into main am: ce8d254149 am: cc3e1287da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2910522

Change-Id: I7ec513907849ca405d36d90b895d8f763ce797cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-16 21:45:25 +00:00
Jihoon Kang
78b6b30aec Remove HideFlaggedApi() related logic and the related product variables
With the recent build changes to support generating mainlin module sdk
with flagged apis, the build no longer depends on the values of these
product variables in exposing the flagged apis, but these are determined
by the aconfig flags. Given that these variables are no longer used,
this change removes these variables and the variables dependent code.

Test: m nothing --no-skip-soong-tests
Bug: 320515715
Change-Id: I6af94da73cc7fc7ffce670928aad81cec5d383b4
2024-01-16 20:20:27 +00:00
Treehugger Robot
535f739153 Merge "Disable prebuilt apps without an apk later" into main 2024-01-16 18:25:30 +00:00
Treehugger Robot
ce8d254149 Merge "Implicitly bump up Java target to 1.8" into main 2024-01-16 18:09:41 +00:00
Sorin Basca
d567a514ee Implicitly bump up Java target to 1.8
Bug: 320294595
Test: m
Change-Id: I693e564c67d17254d68f3a9c16664c1da93b9488
2024-01-15 16:38:46 +00:00
David Srbecky
3150c8fee1 Merge "Revert^7 "Enable dex container (DEX v41) for the whole system"" into main am: cf33b025d9 am: 3f4aab9266 am: 1c5557d198
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2898928

Change-Id: I8a02e14be924a2927e48fc0ea3251f9ae60c25be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-15 12:53:47 +00:00
David Srbecky
cf33b025d9 Merge "Revert^7 "Enable dex container (DEX v41) for the whole system"" into main 2024-01-15 11:10:45 +00:00
Yanning Jia
43668c6f13 Revert^7 "Enable dex container (DEX v41) for the whole system"
This reverts commit 7022550d0e.

Reason for revert: Breaks app's DRM

Bug: 317744117
Change-Id: I539e6ec037db1c297fe7cf85d294bebe963ab214
2024-01-15 11:09:32 +00:00
Jihoon Kang
0b5da4eb6f Merge changes from topic "hiddenapi_exportable" into main am: 7e9343b889 am: cf38079804 am: 5aea28265a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2897486

Change-Id: Iac2820fecdb0bb91040879461dd8a4de012c3ade
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:27:25 +00:00
Jihoon Kang
4243511709 Enable hiddenapi check for exportable stubs am: bd093457e2 am: c32db5a7ad am: e1678131d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889892

Change-Id: Idb07d662b8e37dcd0138f4e7d086ef2eefb9d23b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:27:21 +00:00
Jihoon Kang
5bfd7373a1 Add defaults support for bootclasspath_fragment module type am: 9272dccb1e am: 9604b5571f am: 34d7b23631
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2906878

Change-Id: I1c133dfefc6743decef09ebba754636b9ce2cc39
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:27:13 +00:00
Jihoon Kang
c32db5a7ad Enable hiddenapi check for exportable stubs am: bd093457e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889892

Change-Id: If6c32bbf60f9105164e145ee186247de779c26eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 01:33:10 +00:00
Jihoon Kang
9604b5571f Add defaults support for bootclasspath_fragment module type am: 9272dccb1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2906878

Change-Id: Ia17f45a63c30986af63fe18b39ba62cae6ee1247
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 01:33:08 +00:00
Cole Faust
97494b197e Disable prebuilt apps without an apk later
Currently, android_app_import modules get disabled during their load
hook if they don't have a set `apk` property. This causes them to be
disabled before soong config variables can be applied, which would've
set the apk property.

Move the disabling into a DefaultableHook, which will run after the
soong config variables.

Bug: 319897584
Test: m nothing --no-skip-soong-tests
Change-Id: Ia0f6a39c35b3b11249bfa74ad532858189be24b1
2024-01-12 17:02:58 -08:00
Jihoon Kang
7e9343b889 Merge changes from topic "hiddenapi_exportable" into main
* changes:
  Copy exportable artifacts to module sdk snapshot
  Enable hiddenapi check for exportable stubs
  Add defaults support for bootclasspath_fragment module type
2024-01-12 23:50:37 +00:00
Jihoon Kang
f55a5f7b37 Copy exportable artifacts to module sdk snapshot
This change modifies the copy rules of the sdk_library when generating
the module sdk snapshots so that the exportable artifacts (annotations
zip, api file, removed api file, srcjar file) are copied instead of the
everything artifacts.

In order to satisfy the prebuilts compatibility, this feature is flag
guarded by the build flag "RELEASE_HIDDEN_API_EXPORTABLE_STUBS"

Test: m --no-skip-soong-tests
Bug: 315027929
Change-Id: I8bf5bb1f196aa9b5db78ba4677caa5f4337e3021
2024-01-12 01:50:19 +00:00
Jihoon Kang
bd093457e2 Enable hiddenapi check for exportable stubs
This change modifies the dependencies of the hiddenapi to always depend
on the exportable stubs, instead of the currently utilized everything
stubs.

To support this, the full api surface exportable stubs are defined in a
separate change at the `frameworks/base` project. Note that the full api
surface exportable stubs are only used for the hiddenapi purpose, and
`sdk_version` continues to utilize the currently existing everything
stubs.

Currently, this feature is hidden behind the build flag
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS". This feature will be fully
enabled once metalava fully supports handling of the flagged apis.

Test: ENABLE_HIDDENAPI_FLAGS=true m
Bug: 317426356
Change-Id: I109b7cd27b20ceffcdf1766ab8106b0c276be2b3
2024-01-12 01:03:10 +00:00
Jihoon Kang
9272dccb1e Add defaults support for bootclasspath_fragment module type
This change transforms the bootclsspath_fragment module into a
defaultable module, in order to modify the "art-bootclasspath-fragment"
module definition based on the build flag in
https://r.android.com/2897389

Test: m nothing
Bug: 315027929
Change-Id: I01ba7b15e4fcdea9bd31c369110a3c9ee38bc9f6
2024-01-12 01:02:45 +00:00
LaMont Jones
ed89443a0f Merge changes Iaf6d45a4,Ic56e8ef3,I11f0a0b5 into main am: 15b031e10e am: 0f2753094a am: 82cf614b7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901516

Change-Id: Iafb7bcff23771b8342fc9adb99f679645f83b83c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 21:14:15 +00:00
Dennis Shen
cdb407e795 Merge "Enforce one aconfig_declaration per aconfig package" into main am: 2127887e32 am: 31a87f5977 am: 8c0e06052d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901767

Change-Id: Ib99cde6b13bf0f64910cf693aa6cb315fc546be4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 14:39:50 +00:00
LaMont Jones
afe7baf47d Propagate aconfig providers for more modules.
Bug: 308625757
Test: manual
Change-Id: Iaf6d45a4259f1c6c34476c34c431344283ae2830
2024-01-10 14:03:30 +00:00
LaMont Jones
acae2d7656 move SetAconfigFileMkEntries to android
This will need to be called by some modules handled in android.

Bug: 308625757
Test: manual
Change-Id: Ic56e8ef3a453c59866aab6d39a21108cf8536b56
2024-01-10 14:03:29 +00:00