Commit Graph

7844 Commits

Author SHA1 Message Date
Spandan Das
e9f86b6b0b Merge changes from topic "apex_contributions_build_flags" into main am: c31b24977e am: e48000d86f am: 874d391f63
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808754

Change-Id: Iea3c3e3ac6b9ae49c2b54bf78831495b19637df4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09 03:17:22 +00:00
Spandan Das
fc12d2f494 Special-case java_sdk_library in source vs prebuilt selection
If a java_sdk_library is listed in `contents`, then restrict the source
vs prebuilt selection superseding to only the internal stub libraries.

Defer the source vs prebuilt selection mechanism of the top-level
library to the existing mechanisms for now. This is necessary because
this top-level library acts as a hook for
- hiddenapi: boot jars are deapxed from the prebuilt apex
- dexpreopt: system server jars are deapexed from the prebuilt apex and
  installed via required

If `next` uses `framework-foo` and `service-foo` as the top-level
library instead of the prebuilt equivalents, then the bootjars installed
in out/soong/dexpreopt_x86_64/apex_bootjars will come from source. And
the *.odex files of the system server jars will come from source.

Bug: 308174768
Test: Added a java_sdk_library unit test to assert that the new
mechanism supersedes the `prefer` flag

Change-Id: Ib43198a3b547c58b54f1f0966e95584215096d32
2023-11-08 18:37:24 +00:00
Spandan Das
1c4d94dccf Use all_apex_contributions for source/prebuilts selection
This flattened singleton module explicitly lists by module name whether source or
prebuilt version of a module should be used. If a module appears in this
metadata module, it supersedes all other source vs prebuilts selection
mechanism

Implementation details
- Update the module dep chain from <source> --> <prebuilt> to <source>
  --> <prebuilt> --> all_apex_contributions
- all_apex_contributions sets a provider which is bubbled up
  to the source module. This requires changing `prebuilt_select` to a
  bottom up mutator
- Update `usePrebuilt` to consult the new provider before falling back
  to existing source vs selection mechanisms. If (foo|prebuilt_foo) is
  listed in the selected `apex_contributions` modules, it
  will be used superseding any other selection mechanisms.
- Update this depTag to IsMetaDepTag so that bootclasspath_fragment's
  validation ignores this new dependency.

Test: Added unit tests to assert that this new mechanism supersedes
`use_source_config_var`

Bug: 308174768
Change-Id: I39a85639642711f3c96b6f18b94d626b55e80c66
2023-11-08 18:37:24 +00:00
Spandan Das
e3fcb41ff7 Create a singleton all_apex_contributions module type
This will be a container for the the apex_contributions
selected using build flags. This module will be used to query the state of
selected apex contributions instead of a global that can be mutated by
anyone.

It will set a provider containing metadata for source vs prebuilts
selection. To reduce the overhead of a new mutator, this will be done in
the existing `prebuilt_select` mutator.

It will validate that there are no dups (`foo` and `prebuilt_foo` cannot
be both selected)

Bug: 308174923

Test: go test ./android

Change-Id: Ie42999a71f35d70e0e977f5ab07ce451608d9f35
2023-11-08 18:37:18 +00:00
Alyssa Ketpreechasawat
9f63436385 Revert "Revert "Added new framework-pdf jar inside MediaProvider..."
Revert submission 2775627-revert-2759049-framework-pdf-UAOVGTHHXO

Reason for revert: submit together with the fix to allow this new jar to coexist w/ mainline prebuilts

Reverted changes: /q/submissionid:2775627-revert-2759049-framework-pdf-UAOVGTHHXO

Change-Id: I877af450918647524d7e24371fb3343a8a2900dc
2023-11-08 16:03:58 +00:00
Treehugger Robot
8f14181875 Merge "Export build flags to soong." into main am: 2ab031f467 am: 1d6e69cda7 am: 5ef54931f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2803674

Change-Id: I52af4213a59f60378f0c1679ae19f00a3dea4c34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 05:57:57 +00:00
Jihoon Kang
2a929ad250 Revert^2 "Default from-text stub generation in build"
This change defaults Java stubs to be generated from API text files
during build. Using the `--build-from-source-stubs` flag, users can
toggle between the feature.

This change relands aosp/2617457.

Test: m nothing && verify ninja path exists between android_stubs_current and android_stubs_current.from-text, and does not exist between android_stubs_current.from-source, m nothing --build-from-source-stub && verify the opposite
Bug: 301522358
Change-Id: Ic129dafc3231e71470af982374739930947b69cb
2023-11-08 04:25:52 +00:00
Treehugger Robot
2ab031f467 Merge "Export build flags to soong." into main 2023-11-08 04:15:17 +00:00
Inseob Kim
e4e85d5f9f Export build flags to soong.
This exports a map of build flags used in this release config to Soong.

Bug: 302514918
Test: manual
Change-Id: Id95c03e14cfbb91c0cb9c8c37a065b8387733317
2023-11-08 04:01:38 +00:00
Treehugger Robot
d0fb443b0e Merge changes from topic "apex-elf-checker" into main am: a19c9141aa am: 0b7bebe722 am: 8b75f6e1f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2817254

Change-Id: I6e5ca5e47e0371815ec32587fe59cefde3d9c9ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 03:33:54 +00:00
Treehugger Robot
a19c9141aa Merge changes from topic "apex-elf-checker" into main
* changes:
  Add check for unwanted_transitive_deps
  Add JoinWithPrefixSuffixAndSeperator() utility
2023-11-08 01:50:01 +00:00
Treehugger Robot
6507f6e8d0 Merge "Create an apex_contributions module type" into main am: 29f5f2574d am: c3e8223cc3 am: afa4668550
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808370

Change-Id: Ia7691545e7863747a550304a7a39c9b4fee8d5c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-07 20:56:44 +00:00
Treehugger Robot
29f5f2574d Merge "Create an apex_contributions module type" into main 2023-11-07 19:49:52 +00:00
Jooyung Han
b0864e086e Add JoinWithPrefixSuffixAndSeperator() utility
Bug: n/a
Test: m blueprint_tests
Change-Id: I0fa5d291ce10d699df787feaf9fdaf667aa22686
2023-11-07 13:08:53 +09:00
Jeff Sharkey
37e5e61aeb Merge "Add android_ravenwood_test build rule" into main 2023-11-06 18:47:29 +00:00
Alyssa Ketpreechasawat
0788a7e8bf Merge "Disable verify_overlaps test instead of hiddenapi check." into main am: 98e555c842 am: aa91b88610 am: d186d78927
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2816955

Change-Id: I34abbaea5c2114fdd5bd56878482879509181a8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 12:46:55 +00:00
Alyssa Ketpreechasawat
7daf2786b6 Disable verify_overlaps test instead of hiddenapi check.
Disabling hiddenapi check entirely can be dangerous and it might change the
accessibility of @hide Api too. We should only disable verify_overlaps
test which is required for module_sdk and apexes mismatch.

Test: atest CtsInlineMockingTestCases
Bug: 308187068
Bug: 307480026
Change-Id: I44f48e85d802b3a8f2711bc2047bdab721369f08
2023-11-06 09:49:16 +00:00
Spandan Das
0d53dd289e Create an apex_contributions module type
This module type does not any build actions, but provides metadata about
the contributions of the mainline module to other mainline modules/
platform. One immediate use case for this metadata is source vs
prebuilts selection

Each mainline module can have more than 1 metadata modules. Static build
flags will be used to select the right one in trunk.bzl, next.bzl, ...

Bug: 308174923
Test: go build ./android
Change-Id: I5ead0c38fe64b78de08db1736d97a8ab7374d6d9
2023-11-03 22:33:02 +00:00
Makoto Onuki
32eb1338f0 Add android_ravenwood_test build rule
Modeled after android_robolectric_test.

Bug: 292141694
Test: m nothing --no-skip-soong-tests
Test: m hoststubgen ravenwood-runtime tradefed atest && atest-dev HostStubGenTest-framework-test
Change-Id: Ibef8953db45b86264c8a827868793b42f8f2d6ab
2023-11-03 10:36:08 -06:00
Treehugger Robot
ff3e22930f Merge "Optimize out empty path components" into main am: c012b631ae am: 35df455e56 am: 97aa75372d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2804377

Change-Id: I4e0bf2c3ea90a9d3ddffe4863f575abcd37ee23c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 23:56:46 +00:00
Treehugger Robot
c012b631ae Merge "Optimize out empty path components" into main 2023-11-02 22:36:11 +00:00
Colin Cross
bf9ed3fba2 Optimize out empty path components
filepath.Join("foo", "") returns a newly allocated copy of "foo",
while filepath.Join("foo") does not.  Strip out any empty path
components before calling filepath.Join.

Test: TestValidatePath
Change-Id: Ib47dbcd9d6463809acfe260dfd9af87ea280b4de
2023-11-02 14:37:21 -07:00
Treehugger Robot
aac3228eaa Merge "Remove pre singletons" into main am: 717e7769ce am: 4e4e8d4dcd am: b66c965c1c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2813820

Change-Id: I8c53578d163c830243faa5c4819b7857bbc4eb60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-02 19:29:53 +00:00
Cole Faust
ae6cda6f10 Remove pre singletons
They're no longer used.

Test: m nothing --no-skip-soong-tests
Change-Id: I8984164cfc1a062c428ea7f1a4dd5b8940bee84b
2023-11-02 10:05:55 -07:00
Colin Cross
0d44054481 Merge "Add performance counter metrics to build.trace.gz" into main am: 66d6409e06 am: 62cefe7d1d am: 70820c3fbc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2808388

Change-Id: Ibc19e9880938e5dfba00cd219455c09e9fbb3165
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-30 23:41:05 +00:00
Colin Cross
66d6409e06 Merge "Add performance counter metrics to build.trace.gz" into main 2023-10-30 22:21:14 +00:00
Zi Wang
fe152e302a Update TestNonExistentPropertyInSoongConfigModule
with new expected error message that reflects the real unrecognized
property

Test: TestNonExistentPropertyInSoongConfigModule and CI

Bug: 171232169
Change-Id: I5af8e62b12a80c4891d7f3b57bbf4be456b2a798
2023-10-30 14:42:44 -07:00
Colin Cross
46b0c75204 Add performance counter metrics to build.trace.gz
Start a background goroutine at the beginning of soong_build that
captures the CPU usage, heap size, and total system memory every
second.  Propagate the values through soong_build_metrics.pb back
to soong_ui, and then into build.trace.gz.

Test: m nothing, examine build.trace.gz
Change-Id: Iad99f8f1f088f4f7f7d5f76566a38c0c4f4d0daa
2023-10-30 12:39:07 -07:00
Fyodor Kyslov
ca86bbd94a Merge "Allowlist libcodec2_soft_av1dec_dav1d" into main am: ec2739fc22 am: b573b75db8 am: de85ed5e43
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2802353

Change-Id: Iec7acffc83321162dc73861148e82cafe5597abb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 20:18:48 +00:00
Treehugger Robot
05a0aab64b Merge "Temporarily disable swcodec in mixed bulid" into main am: 54028dc5ae am: 3f543604f4 am: 89ffe9e99c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2802594

Change-Id: I0f67e5b075ced96ecfcc82c90a47f5fead1643da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-25 20:16:41 +00:00
Fyodor Kyslov
ec2739fc22 Merge "Allowlist libcodec2_soft_av1dec_dav1d" into main 2023-10-25 19:22:15 +00:00
Vinh Tran
1c11c61897 Temporarily disable swcodec in mixed bulid
When aconfig (rust_binary) becomes a transitive dependency of swcodec, mixed build swcodec breaks because the cargo_build_script rust rule declares a directory which is not handled by mixed build yet. See b/307389608 for more context.

A follow-up CL will fix the issue and allow enabling swcodec in mixed build again.

Bug: 307389608
Test: Presubmit
Change-Id: I7ba7b5cd06b231f4867870fe8d0bd53299528fe3
2023-10-25 10:52:41 -04:00
Harish Mahendrakar
5c98a68ed6 Allowlist libcodec2_soft_av1dec_dav1d
Bug: 289716589
Test: builds

Change-Id: Iee45b8fff6aea3fcf31fc1ea718911f54d42362c
2023-10-24 18:31:09 +00:00
Sebastian Pickl
2e196473d0 Revert "Default from-text stub generation in build"
This reverts commit 182b56b870.

Reason for revert: breaking boot tests b/307495247, b/307411752

Bug:307495247
(cherry picked from https://android-review.googlesource.com/q/commit:1c4188c9da7b55cdae967e2d2a0a3c9a51c0ad9f)
Merged-In: Iea05703b767d2699ca3cf69377eb44b1d21697ad
Change-Id: Iea05703b767d2699ca3cf69377eb44b1d21697ad
2023-10-24 12:46:36 +00:00
Anton Hansson
05eabd9c4d Merge "Created empty framework-location non-updatable module" into main 2023-10-24 12:43:36 +00:00
Sebastian Pickl
479ab86e6b Merge "Revert "Default from-text stub generation in build"" into main 2023-10-24 12:43:24 +00:00
Sebastian Pickl
1c4188c9da Revert "Default from-text stub generation in build"
This reverts commit 182b56b870.

Reason for revert: prime suspect for breaking boot tests b/307495247, b/307411752

Bug:307495247
Change-Id: Iea05703b767d2699ca3cf69377eb44b1d21697ad
2023-10-24 11:20:06 +00:00
Anton Hansson
af1c929943 Merge "SdkTestCore for non-updatable modules" into main 2023-10-24 10:06:54 +00:00
Jihoon Kang
58c55df235 Merge "Default from-text stub generation in build" into main am: 82f0f7eca1 am: 7e27c69da1 am: 3efc4ce811
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2617457

Change-Id: I3c1245e95bb785dcd118023632d48eeb202600a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-23 22:42:51 +00:00
Jihoon Kang
82f0f7eca1 Merge "Default from-text stub generation in build" into main 2023-10-23 21:42:50 +00:00
Mark White
9421c4ceb9 SdkTestCore for non-updatable modules
Provides SdkTestCore/test_core_current sdk_version for non-updatable
modules that have their test scope dependent on test apis from
framework-minus-apex.

Ignore-AOSP-First: Change in topic with internal-first projects
Bug: 289776578
Test: m checkapi | go test ./java

Merged-In: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
Change-Id: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
2023-10-23 15:25:55 +00:00
Jihoon Kang
4275458352 Merge "Modify the product variable Build_from_text_stub value" into main am: e8f21ac529 am: 6f2a1fe31e am: 1ee4f84795
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2797656

Change-Id: Ieb94c90c7fe3944a9bc7c24a1f20f7cb9c5f7059
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-21 02:40:28 +00:00
Jihoon Kang
e8f21ac529 Merge "Modify the product variable Build_from_text_stub value" into main 2023-10-21 01:45:07 +00:00
Jihoon Kang
182b56b870 Default from-text stub generation in build
This change defaults Java stubs to be generated from API text files
during build. Using the `--build-from-source-stubs` flag, users can
toggle between the feature.

Test: m nothing && verify ninja path exists between android_stubs_current and android_stubs_current.from-text, and does not exist between android_stubs_current.from-source, m nothing --build-from-source-stub && verify the opposite
Bug: 274805756
Change-Id: I28834f92c1b1311e3fe0a71a6ea9e8ec2e278d7e
2023-10-20 23:11:19 +00:00
Cole Faust
6b8c283c7b Merge "Load a list of plugins from vendor/google_clockwork" into main am: c9ef6f71cf am: 3c5a1e9bab am: fc4e739708
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2798384

Change-Id: I978d32319cd4c1c9d01b1bff7880e48a7a866080
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-20 23:11:09 +00:00
Jihoon Kang
531a416d6a Modify the product variable Build_from_text_stub value
productVariables.Build_from_test_stub is currently being set by the
config.buildFromTextStub value. However, this leads to divergence in the
behaviors between the exported BuildFromTextStub() value and the config
value, as the former depends on other factor (whether is it a coverage
build). This change fixes the divergence by making the product variable
value to be set by the former.

Test: m nothing
Bug: 301522358
Change-Id: Ic4de5a179dd1094eb8788663e4d6afa4bea724ea
2023-10-20 22:58:25 +00:00
Cole Faust
c9ef6f71cf Merge "Load a list of plugins from vendor/google_clockwork" into main 2023-10-20 22:00:16 +00:00
Vinh Tran
f132f795a1 Merge "Allowlist librustc_demangle_static" into main am: 4193286396 am: 5a0225f756 am: ddab96a339
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2794696

Change-Id: Ic03fbfe8bb65e4267fa564d7af7eea5e8be82286
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-20 19:14:54 +00:00
Cole Faust
97e19031c2 Load a list of plugins from vendor/google_clockwork
Some wear partners have vendor/google_clockwork but not vendor/google.

Bug: 290816499
Test: Presubmits
Change-Id: Id45f68bf6f734acc1ee6abbfd2314d9ff6be75fb
2023-10-20 11:54:16 -07:00
Vinh Tran
4193286396 Merge "Allowlist librustc_demangle_static" into main 2023-10-20 18:17:53 +00:00