Commit graph

67120 commits

Author SHA1 Message Date
Sam Delmerico
ec59517f6a Merge changes from topic "reland-rust-sbox-1" into main
* changes:
  Revert^2 "conditionally escape rule builder command"
  Revert^4 "allow Ninja variables in RuleBuilder API"
  Revert^4 "add crate_root property to rust modules"
  Revert^4 "add rust_toolchain_rustc_prebuilt module type"
2023-09-27 08:10:26 +00:00
Treehugger Robot
c5b9abba30 Merge "Allowlist libflagtest and FlagMacrosTests." into main 2023-09-27 00:18:46 +00:00
Treehugger Robot
37f9391768 Merge "Fix for ndk having sanitizers" into main 2023-09-26 23:46:49 +00:00
Jihoon Kang
d91a8e806a Add flagged api hide conditional to droidstubs
APIs annotated with @FlaggedApi should not be included in the artifact
when building sdk target products in the "next" release configuration.

This change adds such logic by passing additional flag to metalava in
droidstubs.

The flag does not need to be passed to metalava invocation done in
java_api_library, as java_api_library generates stubs using api
signature files (i.e. *-current.txt files), and they will not contain
apis marked @FlaggedApi. The metalava invocation in droidstubs is
responsible for removing such apis.

Test: go test ./java && m TARGET_PRODUCT=sdk TESTING_TARGET_RELEASE_NEXT=true nothing and inspect ninja command for generating stubs and verify the flag is included
Bug: 299570421
Change-Id: Ia4b699b6e3ff6324f050eecc9ff5b622fdc04621
2023-09-26 22:46:05 +00:00
Jihoon Kang
03f1aa064a Add soong config variable Release_expose_flagged_api
The variable is a release config variable which will be used to
determine whether if the api marked @FlaggedApi is exposed or not.

Test: m nothing
Bug: 299570421
Change-Id: I5647608065543cf5059836f6d6e8906a23145541
2023-09-26 22:32:50 +00:00
Liz Kammer
06d442e954 Add frameworks/base/mime to allowlist
Test: b build //frameworks/base/mime/...
Test: b build //frameworks/base/mime/... --config=android
Change-Id: If73e04e33487bbb63e14475b34f34b31b1386f16
2023-09-26 22:22:58 +00:00
Zi Wang
ffb9a2af93 Merge "Allowlist part of tradefed deps" into main 2023-09-26 22:20:02 +00:00
Liz Kammer
ba23cb6436 Fix for ndk having sanitizers
Test: go test soong tests
Test: verify no NeuralNetworksTest_random_graph sdk variants in
    build.ninja when aosp_x86 is lunched
Bug: 302093869
Change-Id: I6429aa75518cca6974abcf7330236a6a07135ea1
2023-09-26 17:06:33 -04:00
Romain Jobredeaux
832e131725 Merge "Do not convert android_library_import with no aars." into main 2023-09-26 20:08:04 +00:00
Romain Jobredeaux
9c06ef353b bp2build support for framework-res
Change-Id: I5b32a702e02b5f1ec08d5608d766a8a0c08d845c
Bug: 276928228
Bug: 297356405
2023-09-26 15:06:50 -04:00
Romain Jobredeaux
c9e585eabf Keep rules_testing BUILD files
Change-Id: I9036ac0c372f1935e29477bdd1a42203f65e5385
2023-09-26 15:04:13 -04:00
Colin Cross
b983ceac33 Merge "Shard srcjars when sharding javac compilation" into main 2023-09-26 18:01:49 +00:00
Jihoon Kang
e4bb4d4e6b Merge "Import make variable NextReleaseHideFlaggedApi to Soong" into main 2023-09-26 17:49:25 +00:00
Treehugger Robot
7c02986d60 Merge "Add system/tools/hidl to allowlist" into main 2023-09-26 16:59:03 +00:00
Zi Wang
aa516c562e Allowlist part of tradefed deps
Test: CI

Bug: 283193845
Change-Id: Idab167cc1698f40a3853967f31533bdfb6fbd455
2023-09-26 09:39:57 -07:00
Treehugger Robot
8559872623 Merge "Improve optimize bp2build conditional." into main 2023-09-26 15:23:20 +00:00
Matthias Maennich
0a6c5c2ffb NDK library: enable feature flags for diffing ABI representations
Bug: 156513478
Change-Id: I94a0e2de051da9d9d82414a7189399553981c53f
Signed-off-by: Matthias Maennich <maennich@google.com>
2023-09-26 11:30:47 +00:00
Aleksei Vetrov
9c8c5ab3c3 NDK library: fix ABI monitoring error message
Error message in case of not valid "nextAbiDump" included wrong
"prebuiltAbiDump.InvalidReason()". Refactor error message to include
"nextAbiDump.InvalidReason()" instead.

Change-Id: I2581734dd16649af2b282b3459f461658abd3d87
Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
2023-09-26 11:30:47 +00:00
Matthias Maennich
774bac189a NDK library: enable feature flags for dumping ABI representations
Bug: 156513478
Change-Id: I95ebfef65bcadb34f7ed03e34f29e3d6ca363a9f
Signed-off-by: Matthias Maennich <maennich@google.com>
2023-09-26 11:30:47 +00:00
Anton Hansson
2863e4535e Make package parsing code consume annotations
The code previously assumed an annotation meant there was no package
declaration, but package declarations can be annotated. Update the
code to consume any leading annotations.

Bug: 151360309
Test: jar_test.go (& manual verification on full bootclasspath srcs)
Change-Id: I3de5a2a675363fc3627a278103dd2cabe80a2d80
2023-09-26 09:55:52 +00:00
Jingwen Chen
256c389608 Improve optimize bp2build conditional.
Follow up from https://android-review.git.corp.google.com/c/platform/build/soong/+/2757255/comment/fdcf5795_943a04d5/

Test: soong unit tests
Change-Id: I63334bfd19469060673e9a9a239050590934b089
2023-09-26 05:56:54 +00:00
Treehugger Robot
370e34172f Merge "Generate a ndk_sysroot target in bp2build" into main 2023-09-26 05:16:53 +00:00
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