Commit Graph

7888 Commits

Author SHA1 Message Date
Spandan Das
f4ef60c1a5 Merge "Support mechanism to select a specific version of module sdk prebuilt" into main am: 5809f65748 am: 6a830dc530
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2935330

Change-Id: Idd80e40739e34e885a7aa5803676e3e3dbcb8e81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-31 02:58:33 +00:00
Treehugger Robot
098d9ee800 Merge "Disable stub validation when WITHOUT_CHECK_API=true" into main am: e288043ee7 am: 3691588436
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2935430

Change-Id: I2e0f08a89112be870cf153f2ad94b21fefc7c0b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-31 02:56:24 +00:00
Spandan Das
6a830dc530 Merge "Support mechanism to select a specific version of module sdk prebuilt" into main am: 5809f65748
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2935330

Change-Id: I300fa14f92d53d87c6fa51517974e3450bd1c836
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 22:56:10 +00:00
Treehugger Robot
3691588436 Merge "Disable stub validation when WITHOUT_CHECK_API=true" into main am: e288043ee7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2935430

Change-Id: Ia0a4e03608b56eef00eb1585da26213bee949e27
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 22:54:59 +00:00
Spandan Das
5809f65748 Merge "Support mechanism to select a specific version of module sdk prebuilt" into main 2024-01-30 22:43:33 +00:00
Treehugger Robot
e288043ee7 Merge "Disable stub validation when WITHOUT_CHECK_API=true" into main 2024-01-30 22:20:21 +00:00
Xin Li
14a55a9b82 Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: I763b033f0f5f275091db45ab62df6af48dcddc66
Change-Id: I65077e51b4a073f2628fb0995e80ad64368def26
2024-01-30 10:34:06 -08:00
Jihoon Kang
4f04df9f50 Disable stub validation when WITHOUT_CHECK_API=true
Even when building stubs from source, the rules for the
java_api_library modules are generated although they are not
executed. This leads to NPE, as setting `WITHOUT_CHECK_API=true`
prevents `checkCurrentApiTimestamp`, which the java_api_library modules
depend on, from being generated.

To prevent the NPE, this change prevents the `checkCurrentApiTimestamp`
from being registered as the dependency of the java_api_library modules
when `WITHOUT_CHECK_API=true` is set.

Test: BUILD_FROM_SOURCE_STUB=true WITHOUT_CHECK_API=true m nothing
Bug: 320601440
Change-Id: I4f19e30d9cd74bdc20dde0d14884fb03ff223ccb
2024-01-30 02:40:20 +00:00
Spandan Das
3cf0463a47 Support mechanism to select a specific version of module sdk prebuilt
This CL is the java_(test_)_import equivalent of aosp/2928483.

With trunk stable, we will have
multiple prebuilts of the prebuilt java .jars in
prebuilts/module_sdk/art/<v>/test-exports/, and this CL introduces a
mechanism to use apex_contributions to select a specific versioned
prebuilt when building.

Implementation details: Create a new source_module_name property to
identify the root module. rdeps referring to the root module will get
redirected if necessary. This property also
becomes the stem, if `stem` is not set explicitly.

Bug: 322175508

Test: Added a unit test
Change-Id: I2dff38acdf2002355586dbb2be8c1f98af4741f7
2024-01-30 01:59:51 +00:00
Treehugger Robot
c6db30b81a Merge "Prevent disabling checks via flags property" into main am: 59739666e6 am: 5fd64b9c70
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2933578

Change-Id: I274a32a4cbadb85fadb192f7e60049506791e1e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 01:30:53 +00:00
Treehugger Robot
59739666e6 Merge "Prevent disabling checks via flags property" into main 2024-01-30 00:14:17 +00:00
Cole Faust
5d0aaf42db Prevent disabling checks via flags property
strict_updatability_linting currently only checks that updatability
checks aren't disabled via disabled_checks / warning_checks, you could
get around it using the `flags` property. Only allow controlling checks
via the *_checks properties.

Bug: 322802379
Test: m nothing --no-skip-soong-tests
Change-Id: Ia311622e1409f9cc201ab55f8749f2d13fccf551
2024-01-29 14:48:23 -08:00
Treehugger Robot
01157faf70 Merge "Fix the args used to dexpreopt system server jars in prebuilt apexes" into main am: 5a48d4fe3d am: 33605c3fab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2925197

Change-Id: I1d676c37a8e8f611d612d00d68dab2dda8db0f50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-26 23:10:07 +00:00
Treehugger Robot
5a48d4fe3d Merge "Fix the args used to dexpreopt system server jars in prebuilt apexes" into main 2024-01-26 21:55:59 +00:00
Treehugger Robot
9909f5af38 Merge "Add build flag to enable ResourceProcessorBusyBox by default" into main am: 99ed03f4fe am: 4ccd312ed5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2929990

Change-Id: Ic45b89c81b5f70eba08fc45f078932458de94a5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-26 20:21:33 +00:00
Treehugger Robot
99ed03f4fe Merge "Add build flag to enable ResourceProcessorBusyBox by default" into main 2024-01-26 19:07:25 +00:00
Spandan Das
e21a8d4dc6 Fix the args used to dexpreopt system server jars in prebuilt apexes
For prebuilts, java.dexpreopt gets called twice
1. in the context of the top-level prebuilt apex
2. in the context of the java_library shim

Only the artifacts of (1) get installed. The artifacts generated by 2)
are unused. However the args used to generate the artifacts of (1) are
incorrect. It uses moduleName(ctx) to do special-handling of apex system
server jars. This special-handling does not happen in (1), so although
dexpreopt artficats get generated, they get generated with the wrong
args.

To fix this, add an additional parameter in java.dexpreopt to pass the
libraryName explicitly.

Details
- Delete moduleName function. This was used to determine the java
  library name, which is no longer safe
- Add a libraryName parameter to java.dexpreopt
- Most module types will use j.Name() as libraryName
- prebuilt_apex and apex_set will iterate over its `contents` and use
  each element as libraryName when invoking java.dexpreopt

With the correct args passed from (1), we can drop j.dexpreopt from (2)
completely. Dropping (2) also breaks profile guided dexpreopt tests.
These currently operate on (2). They will be moved to (1) in the next CL
of this stack.

Test: presubmits
Test: lunch cf_x86_64_auto-trunk_staging-userdebug && m nothing (this
was a postsubmit failure with aosp/2923733)
Test: art_standalone_dexpreopt_tests on next https://android-build.corp.google.com/builds/abtd/run/L86000030001579256
Test: art-gtest on git_master-art-host https://android-build.corp.google.com/builds/abtd/run/L07800030001550262

Bug: 308790457
Bug: 322255144

Change-Id: I8eb604c82f1fa5289d3cd1a20084d56e4d7485e3
2024-01-26 18:06:41 +00:00
Colin Cross
8f1b033cf7 Add build flag to enable ResourceProcessorBusyBox by default
Setting the RELEASE_USE_RESOURCE_PROCESSOR_BY_DEFAULT build flag will
change the default for use_resource_processor from false to true.

Bug: 294256649
Test: builds
Change-Id: If643bf8db9e2e039200f63f4aac226ed5b44d9e0
2024-01-26 09:09:42 -08:00
Colin Cross
a62e65010a Merge "Convert coverageMutator to a TransitionMutator" into main am: e28cdf362e am: b45435793a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2923152

Change-Id: I33c91aad017a54b077582b7c836b97b86d6091fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 23:57:05 +00:00
Cole Faust
c2dff7c830 Merge "Make hiddenAPIFlagFileCategory an int" into main am: 1627236844 am: 03e69e168c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2925155

Change-Id: Id0f0fc3c78c86ba1871ba946fa4006a41a38b0cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 23:56:32 +00:00
Colin Cross
e28cdf362e Merge "Convert coverageMutator to a TransitionMutator" into main 2024-01-25 23:19:29 +00:00
Cole Faust
1627236844 Merge "Make hiddenAPIFlagFileCategory an int" into main 2024-01-25 22:42:39 +00:00
Asmita Poddar
b53dc17888 Merge "Revert "Ensure sscp jars get copied to $OUT/soong/system_server_dexjars"" into main am: 1f4475cee1 am: ef0e9c3cf4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2927392

Change-Id: Ib8943f63491f5ea54977aea8a57c6132203d3849
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 11:35:14 +00:00
Asmita Poddar
1f4475cee1 Merge "Revert "Ensure sscp jars get copied to $OUT/soong/system_server_dexjars"" into main 2024-01-25 10:08:11 +00:00
Spandan Das
b2fd4ff43f Revert "Ensure sscp jars get copied to $OUT/soong/system_server_dexjars"
This reverts commit 0b7089f134.

Reason for revert: Breaks auto builds https://groups.google.com/a/google.com/g/android-build-police/c/DfXeyxkyfYk/m/4SvZa-jkAAAJ

Change-Id: Ia6ebdf64d03284d2318978c35cb87fd4f0b79531
2024-01-25 04:25:38 +00:00
Spandan Das
cac1bf9ab3 Merge "Ensure sscp jars get copied to $OUT/soong/system_server_dexjars" into main am: 9d4ad66a93 am: a3c8609972
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2923733

Change-Id: I2116caee0a2778574bf49d5f521feda6e4c99693
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 03:01:26 +00:00
Spandan Das
9d4ad66a93 Merge "Ensure sscp jars get copied to $OUT/soong/system_server_dexjars" into main 2024-01-25 01:27:18 +00:00
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