Commit graph

67083 commits

Author SHA1 Message Date
Romain Jobredeaux
3fe1edde31 Use manual BUILD files in jdk8 and allowlist apache-commons-compress
Bug: 302008402
Bug: 302587886
Change-Id: I91401bf3fcda4c83ad2bb9d782b4021ffe6fd103
2023-09-29 15:08:55 -04:00
Sam Delmerico
0dfd62a391 Merge "Revert^2 "rustSetToolchainSource to use linux-x86 srcs"" into main 2023-09-28 09:53:29 +00:00
Jingwen Chen
6b73be150c Merge "Allowlist directories for tradefed's deps." into main 2023-09-28 06:51:29 +00:00
Maxim Siniavine
4aa82a13db Merge changes from topic "revert-2755310-HIIDCMFNIU" into main
* changes:
  Revert "Add soong config variable Release_expose_flagged_api"
  Revert "Add flagged api hide conditional to droidstubs"
2023-09-28 01:08:44 +00:00
Maxim Siniavine
5548bf3053 Revert "Add soong config variable Release_expose_flagged_api"
Revert submission 2755310

Reason for revert: Broken build b/302407753

Reverted changes: /q/submissionid:2755310

Change-Id: Ib5c01033882500296989a7c4476a723d95292aab
2023-09-28 01:01:59 +00:00
Maxim Siniavine
1180919dda Revert "Add flagged api hide conditional to droidstubs"
Revert submission 2755310

Reason for revert: Broken build b/302407753

Reverted changes: /q/submissionid:2755310

Change-Id: I56306fc3b7e5608d21dbefe18d6a886561599f40
2023-09-28 01:01:59 +00:00
Treehugger Robot
f51ed265e4 Merge "Make platform_mappings file deterministic" into main 2023-09-28 00:37:51 +00:00
Cole Faust
e136ddac77 Make platform_mappings file deterministic
Fixes: 301473943
Test: presubmits
Change-Id: I24a1fef87c1fb59b5aeb8ac9c05306cddee32399
2023-09-27 14:14:01 -07:00
Romain Jobredeaux
641b62b205 Merge changes from topic "bazel_framework_res" into main
* changes:
  bp2build support for framework-res
  Keep rules_testing BUILD files
2023-09-27 20:52:50 +00:00
Sam Delmerico
7a346cdaa0 Revert^2 "rustSetToolchainSource to use linux-x86 srcs"
7ba7e8232b

Change-Id: Ia10aede6a8b7422848146500506458ae495f7b9a
2023-09-27 20:45:48 +00:00
Treehugger Robot
aaf91a48e9 Merge "Fix false positives of go modules in bpbuild-prog" into main 2023-09-27 19:33:56 +00:00
Treehugger Robot
1eeda315c8 Merge "Add frameworks/base/mime to allowlist" into main 2023-09-27 18:52:42 +00:00
Jihoon Kang
af26c102b8 Merge changes from topic "expose_flagged_api" into main
* changes:
  Add flagged api hide conditional to droidstubs
  Add soong config variable Release_expose_flagged_api
2023-09-27 17:09:27 +00:00
Aleksei Vetrov
31bbfe911b Merge "NDK library: fix ABI monitoring error message" into main 2023-09-27 16:38:57 +00:00
Liz Kammer
15d7b0b0a5 Fix false positives of go modules in bpbuild-prog
Test: b run //build/bazel/scripts/bp2build_progress:bp2build_progress \
  -- report -m tradefed
Change-Id: I5b9ed1333d61013649056920ffe7110e9786b29e
2023-09-27 09:38:41 -04:00
Jingwen Chen
7501a1b15b Allowlist directories for tradefed's deps.
Fix: 302094734
Test: presubmits/bp2build-incremental
Test: b build //tools/tradefederation/core/util_apps/... --config=android
Change-Id: I3d35650a1001defb74eb93a62b361109a5baccd9
2023-09-27 13:10:45 +00:00
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
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
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