Commit graph

4944 commits

Author SHA1 Message Date
Kevin Dagostino
dfc72a8ca2 Merge "Use existing BUILD files for test-related tools." 2022-12-01 07:32:59 +00:00
Christopher Parsons
e2da96f892 Merge "Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""" 2022-11-30 20:02:52 +00:00
Sam Delmerico
d0b3cd0733 Merge "fallback to nonmixed builds for unsupported builds" 2022-11-30 19:40:59 +00:00
Yu Liu
734fefdf90 Merge "Support abi check in bazel." 2022-11-30 17:57:42 +00:00
Treehugger Robot
d0cd326415 Merge "Add more cases to vendor-installed module" 2022-11-30 17:19:25 +00:00
Christopher Parsons
ff4cceb7bc Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""
This reverts commit f8ab0321e3.

Reason for revert: Fixed underlying bugs (aosp-riscv and llvm breakages)

Change-Id: Ib7fe8e39af5bbe40bac615c815307ad9f05e83d3
2022-11-30 15:44:15 +00:00
Sam Delmerico
5150d0d309 fallback to nonmixed builds for unsupported builds
Bug: 253664931
Change-Id: I8026d0412b8dd62f55edf776f72747209ce2e955
2022-11-30 10:36:48 -05:00
Treehugger Robot
f219c0fc87 Merge "Revert "Allowlist build files in external/python/absl-py"" 2022-11-30 07:47:26 +00:00
Kevin Dagostino
3e2da94e2d Use existing BUILD files for test-related tools.
Allowlist BUILD files of test-related tools so that they appear in the final bp2build workspace. This is required for Bazel test rules that are dependent on these projects.

Test: b build //prebuilts/runtime/... //tools/asuite/atest:atest-tradefed  //tools/asuite/atest/bazel/reporter/...
Change-Id: Ie34658706efe6ca7657c935528df8daef61bfc0c
2022-11-30 06:07:59 +00:00
Cole Faust
762c2def20 Revert "Allowlist build files in external/python/absl-py"
Revert submission 2308141-colefaust_run_b_from_out_folder

Reason for revert: Breaks CI due to more instances of the bazel shutdown issue
Reverted Changes:
I51c28e232:Allowlist build files in external/python/absl-py
I9e6530d95:Cd into the bazel workspace instead of using --pac...

Change-Id: Ice47ef2baaef9976546f9562dc7dd9b19b383d59
2022-11-30 05:16:30 +00:00
Krzysztof Kosiński
b35b88ee82 Merge "Revert "Add tzdata do the Bazel mixed build prod mode allowlist."" 2022-11-30 00:19:17 +00:00
Krzysztof Kosiński
f8ab0321e3 Revert "Add tzdata do the Bazel mixed build prod mode allowlist."
This reverts commit ff387e55fc.

Reason for revert: breaks aosp-riscv target
https://android-build.googleplex.com/builds/submitted/9347261/aosp_riscv64-userdebug/latest/view/logs/build_error.log

Change-Id: I789d0af91ab18185fbbe68616c6e10f59be4169c
2022-11-29 23:16:13 +00:00
Treehugger Robot
00652e7570 Merge "Disable bazel for riscv_64" 2022-11-29 22:58:59 +00:00
Chris Parsons
428c30f89a Disable bazel for riscv_64
This product is experimental and unsupported for Bazel at this time

Test: lunch aosp_riscv64-userdebug && m nothing
Test: lunch aosp_arm64-userdebug && m nothing
Change-Id: I761afb9524f1008f9d5472d2de19bb84342e9e29
2022-11-29 15:35:56 -05:00
Cole Faust
5d4f066ec9 Merge "Allowlist build files in external/python/absl-py" 2022-11-29 20:03:20 +00:00
Yu Liu
56ccb1aecd Support abi check in bazel.
Bug: 253498204
Test: Manual and unit test.
Change-Id: Id23c4f772f67c4ba05704eaad77322133474b42b
2022-11-29 11:25:10 -08:00
Igor Foox
6463871fd9 Merge "Add tzdata do the Bazel mixed build prod mode allowlist." 2022-11-29 18:09:23 +00:00
Kiyoung Kim
f160f7ffa8 Add more cases to vendor-installed module
Current InstallInVendor only checks vendor property, but there are more
properties to check if the module will be installed in the vendor. This
change adds two more cases (soc_specific and proprietary) to the
function.

Bug: 233294155
Test: N/A
Change-Id: Ic3cb4c52f5097cdcc6231c0e85a62ce3ad6094b3
2022-11-29 10:58:08 +09:00
Treehugger Robot
efc1bc7f2f Merge "Improve mixed builds error messages" 2022-11-28 22:06:21 +00:00
Cole Faust
93dc19d39d Allowlist build files in external/python/absl-py
Needed because we import absl-py in our bazel.workspace file.
It only worked before in b, not mixed builds, because b was
run from the real android tree instead of out/soong/workspace.

Bug: 234449134
Bug: 249685973
Test: Presubmits
Change-Id: I51c28e23260bed7ca7d4968fd823f52f0d26a0ab
2022-11-28 12:00:00 -08:00
utzcoz
4283bf300b Remove unused rules for platform-robolectric-4.4-prebuilt
platform-robolectric-4.4-prebuilt was removed by
https://android-review.googlesource.com/c/platform/prebuilts/misc/+/2298317,
and soong's special rules for platform-robolectric-4.4-prebuilt is not
needed anymore.

Test: m

Signed-off-by: utzcoz <utzcoz@gmail.com>
Change-Id: I3304aa1061d8b945b03cfe1a91f466ceb6ca1260
2022-11-28 07:53:20 +00:00
Igor Foox
ff387e55fc Add tzdata do the Bazel mixed build prod mode allowlist.
Bugs:  b/258504104
Test: Ran a local build and checked build metrics and ninja file,
presubmits.

Change-Id: Ifdefdaebc13188e036b0b9cd55fbdcdfbdc8e11f
2022-11-27 21:48:40 -05:00
Treehugger Robot
378124baf1 Merge "Allow stubs implementation to be omitted" 2022-11-24 11:12:18 +00:00
Usta (Tsering) Shrestha
3caa38827c Merge "volatile-status.txt to be translated to an order-only dep in build.ninja" 2022-11-23 15:31:16 +00:00
Cole Faust
2ced8c8a57 Prevent duplicated license_kinds
Bazel fails when there are duplicate license_kinds.

Bug: 260148018
Test: go test
Change-Id: I47a27d37d66be947e4a744cd04a3cdcc0b000de4
2022-11-22 17:43:40 -08:00
Cole Faust
97d1527dd2 Improve mixed builds error messages
When a target does not have a certain provider we need,
currently we just fail at the dictionary lookup. Change
it so that we fail with a message that tells us what
target had the issue.

Bug: 260131489
Test: Presubmits
Change-Id: I99fd018835c14eba0d4db54ba2769b2da1b278f6
2022-11-22 14:38:24 -08:00
usta
fdb3e34df7 volatile-status.txt to be translated to an order-only dep in build.ninja
Bug: b/260092986
Test: 1. `out/soong/build.ninja` has `bazel-out/volatile-status.txt` as order-only dep 2. `touch Android.bp && m --bazel-mode-staging aapt2` updates bazel-out/volatile-status.txt but aapt2 is not rebuilt

Change-Id: I1fa23437fea14e0d25b68d75010e964dff34766d
2022-11-22 17:12:30 -05:00
Alan Stokes
73feba3330 Allow stubs implementation to be omitted
When defining a stubs library, allow specifying that the
implementation library does not need to be installed. This allows for
cases where the implementation is deployed in some non-standard way -
e.g. inside a Microdroid virtual machine.

Without this, we get build errors like: "TARGET module
com.android.compos requires non-existent TARGET module: libvm_payload".

Default behavior is unchanged. The change is protected by an allowlist
to limit usage to the immediate use case.

Bug: 243512108
Test: builds; soong tests pass
Test: Remove allowlist, see build failure
Change-Id: Iaae75f2e93b842f5944a7518cc95069d62c5a638
2022-11-22 16:00:02 +00:00
Treehugger Robot
dd33a493fb Merge "use CommonAttributes for Tags in protos filegroups" 2022-11-22 15:46:59 +00:00
Spandan Das
6960ac12ac Add jarjar's deps to bp2build allowlist
jarjar switched its deps from prebuilts to source (aosp/2305413). Add
the source directory to the allowlist. This should fix broken bp2build
presubmits

Test: b build //external/jarjar
Change-Id: Ic7f37ea0ac167dc3b0f605ca0e67f8740652e0b1
2022-11-22 04:58:06 +00:00
Sam Delmerico
e9b33f70ae use CommonAttributes for Tags in protos filegroups
The Tags attribute is now available in CommonAttributes, and if we use
that one, we won't get errors with conflicting definitions of the
attribute if a global Tags value is added via CommonAttributes.

Test: m bp2build
Change-Id: I422ed817b84e6808ef60fe3599fe84332bc51d8e
2022-11-21 16:25:20 -05:00
Paul Duffin
6fcb32258a Merge "Revert "Improve error reporting when depending on prebuilt implementation jar"" 2022-11-21 17:20:03 +00:00
Paul Duffin
7ed6ff8c76 Revert "Improve error reporting when depending on prebuilt implementation jar"
This reverts commit c61783b20d.

Bug: 257969510
Reason for revert: b/255275437 - breaks checkbuild target

Change-Id: I01f88053cc24dbc1a4eb5c009f15473bdff3d565
2022-11-21 10:57:30 +00:00
Usta (Tsering) Shrestha
1ad62c7073 Merge "ShouldKeepExistingBuldFileForDir look up by dir" 2022-11-19 03:55:46 +00:00
Sasha Smundak
4975c82666 Provide Bazel timing breakdown for the mixed builds
Instead of single event in the build metrics
```
| soong_build.mixed_build.bazel          | 1:17.1 |
```
it will now show:
```
| soong_build.mixed_build.bazel          | 1:17.1 |
| soong_build.mixed_build.bazel.cquery   |   51.9 |
| soong_build.mixed_build.bazel.aquery   |   23.1 |
| soong_build.mixed_build.bazel.symlinks |    2.1 |
```

Test: treehugger
Change-Id: I84a7dda6e3122860da9aaa98bfa6afe33d392dcf
2022-11-16 18:44:08 -08:00
Wei Li
c33c2e732a Merge "Fix the following issues in bazel_handler:" 2022-11-16 23:45:47 +00:00
Sam Delmerico
775f2cb3cd Merge "export neverallow include dir list to Bazel" 2022-11-16 20:52:17 +00:00
Wei Li
cbd181c8e8 Fix the following issues in bazel_handler:
1) Convert coverage path wildcard to regex values for --instrumentation_filter to Bazel.
2) Handle the error properly when aquery commmand returns error.

Bug: 258397103
Test: CIs
Change-Id: Ie7485c2c45f2eb0e1ca0dc60478aae04ab151b61
2022-11-16 08:59:23 -08:00
Alix Espino
3044987181 Merge "bp2build for java_library with .kt srcs or common_srcs" 2022-11-16 15:40:55 +00:00
Usta Shrestha
ea9996411d ShouldKeepExistingBuldFileForDir look up by dir
instead of scanning every entry in the map for prefix-match, search each ancestor of the dir

Bug: N/A
Test: bazel_test.go#TestShouldKeepExistingBuildFileForDir()
Change-Id: I7c9afa456cca5a70624ae1e9c9b96c43b0110c1e
2022-11-15 21:39:37 -05:00
Sam Delmerico
46d08b4e39 export neverallow include dir list to Bazel
Bazel needs to recreate the neverallow behavior for absolute includes,
so export the list of include dirs to soong_injection.

Bug: 250931909
Test: aosp/2302925
Change-Id: I3bd345ea4cfb3181f07e4570466f2fc8c5fe32da
2022-11-15 17:33:21 -05:00
Alix
8062f4dee7 bp2build for java_library with .kt srcs or common_srcs
java_library modules with .kt srcs or common_srcs will be converted into
module type kt_jvm_library

Test: m bp2build, manually inspected build files for allowlisted modules
Bug: 258688914
Change-Id: I8293a11c8247b4b76358d0991f82c6b61b58adc3
2022-11-15 20:01:29 +00:00
Bob Badour
3800b5a787 Only generated notices for built variants.
Test: banchan dcla-notice mainline_modules_arm64; m apps_only dist
Change-Id: I6b0e2eb64f2f3db87dfed68affb44fe141da3eaa
2022-11-14 14:17:55 -08:00
Paul Duffin
280765acc4 Merge "Improve error reporting when depending on prebuilt implementation jar" 2022-11-14 16:38:11 +00:00
Treehugger Robot
4d87828d15 Merge "Export ndk/aml arches to Bazel" 2022-11-14 16:17:41 +00:00
Paul Duffin
73d394dec2 Merge "Allow namespace config to be tested properly" 2022-11-14 14:08:40 +00:00
Paul Duffin
c61783b20d Improve error reporting when depending on prebuilt implementation jar
The sdk snapshot must not be including implementation code for boot
libraries, the implementation is provided by dex jars within the
corresponding APEX. However, the snapshot does need a module for each
boot library so that the build can seamlessly access the dex files from
the APEX.

A java_library boot library (like core-oj) is represented in the
snapshot by a java_import module which requires a jar file to be
provided, otherwise it is disabled. However, that is provided purely
to keep Soong happy and should never be used.

Previously, the snapshot would contain an empty file for the jar. As
an empty file is an invalid jar any tool (like compiler) that tried
to consume it would fail which was the correct behavior. Unfortunately,
the error message that was produced was not very helpful, it was just
some variant on `invalid file` which lead to a lot of bugs being
raised.

This change replaces that empty file with a reference to the output
from a genrule which runs a script which produces a more useful error
message, with information on how to fix the issue, and fails the build.

It also adds a Name() method to the SdkMemberProperties type as that is
needed in AddInternalModule() to construct the name of the additional
module.

Tested as follows:

In AOSP/master make the following changes:
1. Temporarily set visibility on core-oj and core-libart to
   //visibility:public.
2. Run packages/modules/common/build/mainline_modules_sdks.py to create
   the snapshots.

For each of the S, T and latest snapshots I did the following in the
s-aml-prebuilt-test, t-aml-prebuilt-test and aosp/master branches:

1. Created an Android.bp file containing the following:
  java_library {
    name: "broken",
    static_libs: [
      "prebuilt_core-libart",
      "prebuilt_core-oj",
    ],
  }

2. Fix the visibility issues and run `m broken` where it fails with an
   invalid file.

3. Delete the contents of the prebuilts/module_sdk/art/current/sdk
   directory.

4. Unpack the relevant version of the art-module-sdk snapshot into the
   directory.

5. Run `m broken` where it fails with the helpful message.

6. Test the instructions on how to use the ninja -t path tool to
   identify the cause of the problem and fix it.

Bug: 257969510
Test: See above.
Change-Id: I125bde2d7202afff84c97daebcef37e21c548a3a
2022-11-14 10:14:10 +00:00
Kevin Dagostino
92f33d91f3 Add tools/asuite/atest/ to keep existing BUILD file list
Test:  b build tools/asuite/... && b cquery tools/asuite/...
--output=files

Change-Id: I2696327a60e770d0929ccc1baa3b4af703a2269d
2022-11-12 04:43:17 +00:00
Liz Kammer
992918d21f Export ndk/aml arches to Bazel
Test: lunch ndk-eng; b build //bionic/libc --config=android
Change-Id: I1ec6f7d0f084aafe948f27111275537b6d9e9637
2022-11-11 15:27:56 -05:00
Vinh Tran
7a8362c252 Remove AfdoAdditionalProfileDirs product variable
AfdoAdditionalProfileDirs is unconnected to build/make/core/soong_config.mk and is currently unused. Removing AfdoAdditionalProfileDirs will cut down on complexity when we migrate the support of auto-fdo profiles to Bazel cc rules.

b/258684450 proposes an alternative to support the use cases that were meant to be supported by AfdoAdditionalProfileDirs.

Test: existing go tests
Bug: 253540178
Change-Id: I024e48598a560717a1d6c19b16bde3fe65ff1961
2022-11-11 03:29:31 +00:00