Commit graph

67148 commits

Author SHA1 Message Date
Colin Cross
a052ddbb7e Shard srcjars when sharding javac compilation
java_library rules with javac_shard_size set split the sources into
shards to invoke javac multiple times, but were using a single javac
invocation for all srcjars.  For fraemwork-minus-apex, this srcjar
shard was the long pole at 15.7 seconds, containing 266 srcjars with
1542 java files with a total of 614593 lines.

Use a rough approximation of 5 sources per srcjar to determine the
number of shards to split the srcjars into based on javac_shard_size.
This results in splitting the srcjars for frameworks-minus-apex into
8 shards, with the longest taking 10.5 seconds to compile.

The longest shard contains most of the aidl srcjars, which have been
generated by sharded groups of 50 aidl files and have a much higher
average number of sources per srcjar (a mean and median of 27).  A
future improvement could be to shard those separately assuming a
higher number of sources per srcjar.

Bug: 302033097
Test: USE_RBE=false m frameworks-minus-apex
Change-Id: I85e740c7fcf5651cf18c0cdc90ab8c6ee39cb47b
2023-09-25 21:46:58 -07:00
Jingwen Chen
c6f3c10615 Allowlist system/core/libstats/expresslog
Fixes: 302046711
Test: b build //system/core/libstats/expresslog:libexpresslog --config=android
Change-Id: I904fa0e6bd31d454ec38be91dbeecb765593266c
2023-09-26 02:02:08 +00:00
Treehugger Robot
0c0b0d6857 Merge "Add bp2build for rust_protobuf module" into main 2023-09-26 00:51:06 +00:00
Treehugger Robot
b5a1bbffda Merge "Skip snapshot for sanitizer variants with both cfi and hwasan" into main 2023-09-26 00:41:09 +00:00
Jihoon Kang
534e2e504d Merge changes from topics "remove_api_files", "remove_naming_convention" into main
* changes:
  Remove naming conventioned based file sorting in java_api_library
  Remove api_files property from java_api_library
2023-09-25 22:31:53 +00:00
Vinh Tran
47faaad254 Add bp2build for rust_protobuf module
We only supported bp2build for rust_protobuf_host because the non-host toolchain for rust is not checked in yet. aosp/2759750 changed a converted module from rust_protobuf_host to rust_protobuf and broke CI.

This CL adds bp2build support for rust_protobuf but makes the target incompatible with android os for now untilnon-host rust toolchain is checked in.

Bug: 301956497
Test: b build //build/make/tools/aconfig:all --config=android
Change-Id: I739896c79f32674000c2603e394f16860a6fc57d
2023-09-25 17:37:59 -04:00
Spandan Das
af72583468 Generate a ndk_sysroot target in bp2build
This target will have a dependency edge to every bp2build equivalent of
Soong's ndk_headers. In b builds, sdk variants will compile against this
aggregated CcInfo providing target

A non monolithic alternative was discarded after conversations in
b/300504837#comment1-5

Contents of bp2build generated target: https://paste.googleplex.com/6643820291686400

Implementation details
- Since there is no equivalent Soong module for ndk_sysroot, hardcode
  bp2build/build_conversion.go to collect all ndk_headers soong modules.
  Add them to `deps` of a ndk_sysroot target
- Create `ndk_sysroot` in build/bazel/rules/cc/BUILD.bazel. This is
  expected to be a temporary location. This will use the
  cc_library_headers macro
- Update SetStubsForDynamicDeps so that sdk variant of rdeps depends on
  //build/bazel/rules/cc:ndk_sysroot. This will provide a CcInfo during
  compilation. Since ndk_sysroot is of type cc_library_headers, it will
  not get packaged into the apk.
- Refactor `goBazelTarget` to a generic `bTarget` so that it is
  representative of the expanded usage by ndk_sysroot

Test: b build //build/bazel/examples/android_app/java/com/app:app_with_sdk_variant_of_jni_deps --config=android (with aosp/2755284)

Bug: 300504837

Change-Id: Ifa427dd78115703ab251b0e1a0b71d3f19e91008
2023-09-25 21:27:19 +00:00
Jihoon Kang
cfbc4077b3 Import make variable NextReleaseHideFlaggedApi to Soong
This change imports NextReleaseHideFlaggedApi exported from soong_config

Test: m nothing
Bug: 299570421
Change-Id: I410596a39d2ba9ad353c5cf48bd38b1e843633b2
2023-09-25 20:54:46 +00:00
Treehugger Robot
b95a8b33be Merge "Enable/disable optimize for android_test and android_test_helper_app by default." into main 2023-09-25 17:51:14 +00:00
Cole Faust
71aa535721 Merge "Emit a system image target for the current product" into main 2023-09-25 17:08:34 +00:00
Jingwen Chen
65229207d1 Enable/disable optimize for android_test and android_test_helper_app by default.
Follow up to https://android-review.git.corp.google.com/c/platform/build/bazel/+/2727853/comment/f2c5802e_245fd302/

Test: New unit tests, presubmits
Test: `atest-dev HelloWorldTests --roboleaf-mode=dev`

Change-Id: I88efcf72fbcb717d05e71ba50ba7802c3bece816
2023-09-25 15:27:33 +00:00
Usta (Tsering) Shrestha
ed0163ec88 Merge "Include label in aquery error" into main 2023-09-25 15:09:31 +00:00
Jingwen Chen
b70c096a65 Allowlist libflagtest and FlagMacrosTests.
Test: atest-dev FlagMacrosTest --roboleaf-mode=dev
Fixes: 300335177
Change-Id: I44a63b0a1aa6bef30736f72d01d7a80930e2f48d
2023-09-25 14:58:54 +00:00
Justin Yun
a05a4f6f87 Skip snapshot for sanitizer variants with both cfi and hwasan
cfi and hwasan cannot be enabled at the same time. Skip building
vendor snasphots for the snapshot variants with both cfi and hwasan.

Bug: 277174974
Bug: 290779821
Test: HWASAN_INCLUDE_PATHS=frameworks/native/libs/gui m
Change-Id: Iaae913367a70e150d77a614de5f942aea98d1086
2023-09-25 23:07:49 +09:00
Sam Delmerico
d46f6c81de Revert^2 "conditionally escape rule builder command"
53ed08aec0

Change-Id: Ic6e754bb270dbd3fa67ec31b5cbc1c5ef77d3238
2023-09-25 12:13:17 +00:00
Sam Delmerico
285b66a117 Revert^4 "allow Ninja variables in RuleBuilder API"
789a7e0883

Change-Id: Iee1156adf0ad6e6d2ae7e22d90a447d4b564e59f
2023-09-25 12:13:17 +00:00
Sam Delmerico
63ca14e9b7 Revert^4 "add crate_root property to rust modules"
9c64274b27

Change-Id: I1c4dad76842cebf18cd82e04e435910f09038d07
2023-09-25 12:13:17 +00:00
Sam Delmerico
f2b16069bb Revert^4 "add rust_toolchain_rustc_prebuilt module type"
930fd8bfb1

Change-Id: Id3f3a66022a496aab7db93670a7bdf8507384875
2023-09-25 12:13:17 +00:00
Colin Cross
40c7bae1df Merge changes from topics "revert-2629131-sandbox-rust-inputs-JRFPQTIPEY", "revert-2758566-WBNIADIEXA" into main
* changes:
  Revert^3 "add rust_toolchain_rustc_prebuilt module type"
  Revert^3 "add crate_root property to rust modules"
  Revert^3 "allow Ninja variables in RuleBuilder API"
  Revert "conditionally escape rule builder command"
  Revert "support sandboxed rust rules"
  Revert "fix failing rust_aconfig_library test"
  Revert "rustSetToolchainSource to use linux-x86 srcs"
  Revert "remove rust deps on clang prebuilts"
2023-09-23 05:19:13 +00:00
Ray Chin
4ad574cc37 Merge "Fix read file error in extract_apks" into main 2023-09-23 04:09:18 +00:00
Zi Wang
7c5b6d5273 Merge "Pass java_library libs and static_libs to java_*_proto_library" into main 2023-09-23 03:45:48 +00:00
Treehugger Robot
11b20b2993 Merge "Switch bp2build mutator to bottom up" into main 2023-09-23 00:05:47 +00:00
Wonsik Kim
ee03e4e577 Merge "Add libcodec2_aidl into allowlist" into main 2023-09-22 22:12:33 +00:00
Wen-yi Chu
930fd8bfb1 Revert^3 "add rust_toolchain_rustc_prebuilt module type"
9333ac1249

Change-Id: Ic7f064806553a0cfbc286136a764b5ea3898d06c
2023-09-22 22:05:54 +00:00
Wen-yi Chu
9c64274b27 Revert^3 "add crate_root property to rust modules"
60375c4adf

Change-Id: I356e936139592893a47d4c6b9e747f24470b11f9
2023-09-22 22:05:54 +00:00
Wen-yi Chu
789a7e0883 Revert^3 "allow Ninja variables in RuleBuilder API"
0e2d63e4d2

Change-Id: I4a22fb398fc7bfdf86613829dfbc9c35fab11ee7
2023-09-22 22:05:54 +00:00
Wen-yi Chu
53ed08aec0 Revert "conditionally escape rule builder command"
Revert submission 2629131-sandbox-rust-inputs

Reason for revert: Fail on android build.

Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs

Change-Id: I0d70fb9bbb9597d5fa68e764cdcf57f1a0333037
2023-09-22 22:05:54 +00:00
Wen-yi Chu
41326c1f41 Revert "support sandboxed rust rules"
Revert submission 2629131-sandbox-rust-inputs

Reason for revert: Fail on android build.

Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs

Change-Id: Ifd9aa46e80a12d8f4ffa0a2daa74b96727cbb7e6
2023-09-22 22:05:54 +00:00
Colin Cross
df0ed707a5 Revert "fix failing rust_aconfig_library test"
This reverts commit 521eb20dc2.

Reason for revert: b/301463284

Change-Id: I45f4793694654f3afd2dee6188e0bf58cfb48992
2023-09-22 22:05:39 +00:00
Colin Cross
7ba7e8232b Revert "rustSetToolchainSource to use linux-x86 srcs"
Revert submission 2758566

Reason for revert: b/301463284

Reverted changes: /q/submissionid:2758566

Change-Id: Ia4966732e9bec105c854f09aa0523329ef4d8fd0
2023-09-22 22:02:28 +00:00
Colin Cross
05cbcb3539 Revert "remove rust deps on clang prebuilts"
Revert submission 2758566

Reason for revert: b/301463284

Reverted changes: /q/submissionid:2758566

Change-Id: I54f0ecbbd922deb23009ca89ff79689e128f4f31
2023-09-22 22:02:28 +00:00
Cole Faust
cb193ec471 Emit a system image target for the current product
This system image can be built with bazel instead of make.

Bug: 297269187
Test: m bazel_sandwich
Change-Id: I5fd61a28f664d8310435c3b7e5dbdd89a7ec6159
2023-09-22 14:42:33 -07:00
usta
a79afd7efa Include label in aquery error
When an Action fails to convert to a Ninja build statement,
include the bazel label in the error message.

Test: NA
Bug: 301638491
Change-Id: I592978c5e530043769b0232fdd200ad13b72c39b
2023-09-22 17:31:32 -04:00
Romain Jobredeaux
afc5d27ab0 Do not convert android_library_import with no aars.
Bug: 301007952
Change-Id: Ia32d47eeb1a888ea2555d5ca08f56f191c040bc7
2023-09-22 15:52:59 -04:00
Chris Parsons
6666d0f6b1 Switch bp2build mutator to bottom up
This should be no-op, as the underlying mutator has not changed yet.

Some other refactoring is required and done in this CL:

- Delete some old, dead ApiBp2build code
- Fix casting to TopDownMutator when it's not necessary

This change is required to prepare for allowlist v2 work, as only
BottomUp mutators can AddDependency.

Bug: 285631638
Test: m nothing
Test: presubmits
Change-Id: I5212a5f5634cc13056195783e6df37ff8eb000da
2023-09-22 19:19:22 +00:00
Christopher Parsons
68a3d9b33e Merge "Handle already existing targets of different name" into main 2023-09-22 18:52:07 +00:00
Zi Wang
4dbd0e8688 Pass java_library libs and static_libs to java_*_proto_library
If a java_library module has proto srcs, a java_*_proto_library target
will be created for it. Proto sources are generated and then compiled
by a java_library target. We need to pass the libs and static_libs of
the java_library module to this java_library target so that
the compile-time classpath is correct.

Test: updated unit tests and CI

Bug: 301469542
Change-Id: I05b2efce6fda2223e85728b3c4c7b1815d04c3dd
2023-09-22 11:20:06 -07:00
Jihoon Kang
a96a7b1e13 Remove naming conventioned based file sorting in java_api_library
With api_files property being removed from java_api_library, all api
files are passed to java_api_library via java_api_contribution, which
provide api_surface information. Instead of relying on the naming
convention of the api files, java_api_library can utilize this
information to sort the api files from narrower api scope to the wider
api scope.

Test: m --build-from-text-stub
Bug: 295429988
Change-Id: Idd832778833c072c6b7e9d1f775533e5f4e2af00
2023-09-22 16:55:43 +00:00
Sam Delmerico
eba2a2af22 Merge changes I620cfd7b,I8ed1919a into main
* changes:
  remove rust deps on clang prebuilts
  rustSetToolchainSource to use linux-x86 srcs
2023-09-22 16:44:02 +00:00
Alix Espino
c62b27a7ea Merge "Mark android_* modules with java_resources as unconvertible" into main 2023-09-22 14:56:18 +00:00
Liz Kammer
596ee5c82d Merge "Do not convert non-unit tests." into main 2023-09-22 14:08:53 +00:00
Mark White
a1c9bb08b5 Added new framework-pdf jar inside MediaProvider module
Bug: 301574837
Test: presubmit and m framework-pdf
Change-Id: Ib5294ef9d1c632777af0ca9225d459cbc188e589
2023-09-22 13:28:51 +00:00
Treehugger Robot
64a2cc1a9a Merge "Use assemble_vintf output for vintf fragments in APEX" into main 2023-09-22 11:23:04 +00:00
Jooyung Han
90934ac906 Use assemble_vintf output for vintf fragments in APEX
With aosp/2681229, assemble_vintf modifies the input, instead of
checking. APEX should use the output of assemble_vintf instead of
running it as validation.

Bug: 299034304
Test: m
Change-Id: I9446908e1df85b4f3f89d29ebe9cace3982d7757
2023-09-22 15:47:15 +09:00
Ray Chin
0523ee828a Fix read file error in extract_apks
Bug: 301409551
Test: build
Change-Id: I353efea233e524c838298447b08743eeeedbb263
2023-09-22 13:20:50 +08:00
Motomu Utsumi
9c5b51e4f6 Merge "Remove unused file path" into main 2023-09-22 02:06:54 +00:00
Spandan Das
7ba007a3c6 Merge "Create a bp2build converter for ndk_headers" into main 2023-09-21 23:11:33 +00:00
Zi Wang
0dc9d095b4 Merge "Allowlist grpc-java and its deps" into main 2023-09-21 22:52:34 +00:00
Cole Faust
747ecf4b1e Merge "Decouple the target build variant from the platform" into main 2023-09-21 21:18:47 +00:00
Jihoon Kang
6be0f00671 Remove api_files property from java_api_library
java_api_contribution provides api_surface information, but files
directly passed to java_api_library do not possess such information.
Currently, the api surface is assumed via naming convention for api
files passed via api_files property, but this is fragile.

This change removes the api_files property from java_api_library and
enforce all api files to be passed via java_api_contribution

Test: m nothing --build-from-text-stub
Bug: 300964421
Change-Id: If01d9ed978fe469d4ee0d685582a51629ebecc56
2023-09-21 21:02:39 +00:00