Commit graph

59169 commits

Author SHA1 Message Date
Treehugger Robot
b0e1044222 Merge "Change condition to match go/thirdpartylicenses" 2022-11-30 22:10:50 +00:00
Yabin Cui
29f248b086 Reland "Update clang version to clang-r475365"
This reverts commit a558be6472.
Reason for revert: broken build was fixed

Bug: 253033919
Test: build
Change-Id: If6adf2ece00081eb2eeec7895461293751f94be1
2022-11-30 13:34:35 -08: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
Treehugger Robot
82c41a8a19 Merge "Improve error output for missing ABI dumps." 2022-11-30 19:18:48 +00:00
Treehugger Robot
b4bac94eb5 Merge "Copy bazelrc files into the queryview workspace" 2022-11-30 18:36:48 +00:00
Yu Liu
734fefdf90 Merge "Support abi check in bazel." 2022-11-30 17:57:42 +00:00
Treehugger Robot
e0229e6855 Merge "Add the symlinks of the external repository in api_bp2build workspace" 2022-11-30 17:38:09 +00:00
Bob Badour
07c034bf34 Change condition to match go/thirdpartylicenses
Policy uses restricted_if_statically_linked at
https://opensource.google/documentation/reference/thirdparty/licenses#RestrictedIfStaticallyLinked

Test: m droid

Change-Id: I6eee52bef179b2a2b4257595e596652cfbdfef68
2022-11-30 09:34:51 -08:00
Alix Espino
9ba98bb9cf Merge "Bp2Build for libs property in java_library" 2022-11-30 17:34:49 +00:00
Treehugger Robot
d0cd326415 Merge "Add more cases to vendor-installed module" 2022-11-30 17:19:25 +00:00
Jihoon Kang
c05902cff9 Merge "Add phony rule for java_api_library module type" 2022-11-30 17:06:29 +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
9b2e24c318 Merge "Exclude prebuilts/clang/host/linux-x86/clang-dev/BUILD from the symlink forest." 2022-11-30 11:51:59 +00:00
Jingwen Chen
bcfadce598 Exclude prebuilts/clang/host/linux-x86/clang-dev/BUILD from the symlink forest.
Background: toolchain/llvm_android/test_compiler.py generates clang-dev, a directory
symlink pointing to out/install/linux-x86/clang-dev, which itself
contains a BUILD file. This BUILD file should be excluded from the
symlink forest because it's not an allowlisted BUILD file.

Problem: However, our current symlink forest logic and finder logic doesn't
handle this situation. It's not in bazel.list:

```
$ less out/.module_paths/bazel.list | grep prebuilts/clang
prebuilts/clang/host/linux-x86/BUILD.bazel
prebuilts/clang/host/linux-x86/cc_toolchain_config.bzl
prebuilts/clang/host/linux-x86/cc_toolchain_constants.bzl
prebuilts/clang/host/linux-x86/cc_toolchain_features.bzl
prebuilts/clang/host/linux-x86/clang-r450784d/BUILD.bazel
prebuilts/clang/host/linux-x86/clang-r450784e/BUILD.bazel
prebuilts/clang/host/linux-x86/clang-r458507/BUILD.bazel
prebuilts/clang/host/linux-x86/clang-r468909/BUILD.bazel
prebuilts/clang/host/linux-x86/clang-r468909b/BUILD.bazel
prebuilts/clang/host/linux-x86/clang-r475365/BUILD.bazel
```

The symlink forest logic uses this bazel.list file and matches it
against the keepExistingBuildFile list to exclude BUILD files from the
symlink forest. Since clang-dev/BUILD.bazel is not in bazel.list, it's
symlinked into the forest.

All of these gymnastics could be avoided if we added custom BUILD file
name support to Bazel, and only symlinked (e.g.) Android.bazel and
ignored all other BUILD files in the tree. It would be very clear which
checked-in BUILD files we want to use in the symlink forest.

I think we should pursue custom BUILD file names instead of adding more
complexities, to say, the finder logic, to support such a use case. It's
also why I decided to add this hardcoded exclusion to keep the
workaround simple.

Bug: 260809113
Test: presubmits
Test: $ DIST_DIR=/tmp/dist prebuilts/python/linux-x86/bin/python3 toolchain/llvm_android/test_compiler.py --build-only --target aosp_raven-userdebug --no-clean-built-target --module dist --module droid --module tidy-soong_subset --with-tidy ./
Change-Id: I415371543585c1c5e8e00e6958105f65ea5978ee
2022-11-30 08:44:05 +00:00
Hsin-Yi Chen
f36301260e Add a build rule for opt-in ABI dumps
The developers can specify ref_dump_dirs for shared libraries in
Android.bp. Each of the ref_dump_dirs generates a command to diff the
ABI with the reference dumps in the directory. The existing ABI diff for
VNDK, NDK, and Mainline are not changed.

Bug: 227282691
Test: make libutils
Change-Id: I62158393c8804200e96d538bc69c24147cb5caa5
2022-11-30 16:00:51 +08:00
Treehugger Robot
f219c0fc87 Merge "Revert "Allowlist build files in external/python/absl-py"" 2022-11-30 07:47:26 +00:00
Kiyoung Kim
d5d1ab1b3e Support NDK variant of cc_api_variant
Update cc build logic to support NDK variant of cc_api_variant. Any
cc_api_library with NDK variant of cc_api_variant would be treated as
similar with NDK library.

Bug: 259007436
Test: Cuttlefish vendor build succeeded
Change-Id: I75a7475f4fdcbac779f5aa64e76c60f94ea7ea1a
2022-11-30 16:36:14 +09:00
Hsin-Yi Chen
0af4e6728a Deprecate ABI reference dumps in gzip
ABI dumps in gzip are no longer supported because they cannot be
reviewed or merged.

Bug: 227282691
Test: make
Change-Id: I9fdf943fb8ae30aeae884d4d361a65034ab6fa94
2022-11-30 15:02:18 +08: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
Hsin-Yi Chen
a6ddb144f8 Refactor the build rules for ABI diff
- Move the logic that determines the versioned dump directories
  from pathForVndkRefAbiDump to linkSAbiDumpFiles.
- Move sourceAbiDiff which generates the flags for ABI diff from
  builder.go to library.go.
- Define two functions that generate the rules for cross-version and
  same-version ABI diff.

Bug: 227282691
Test: make
Change-Id: Ic33799e86dd9ae627f5680b70973f96e15c030e9
2022-11-30 11:34:39 +08:00
Spandan Das
6b91a38b51 Add the symlinks of the external repository in api_bp2build workspace
Unlike bp2build, api_bp2build depends on a well-defined subset of checked-in
BUILD/bzl files, and we create symlinks for that subsset in
out/soong/api_bp2build. Since we now cd into the workspace after
aosp/2308141, we need to add the sylimks of the external repositories as
well

Test: bazel build --config=api_bp2build //:empty
Change-Id: Ia7ecc5543226893a3878bc0fd35e025a37c80413
2022-11-30 02:22:57 +00:00
Yabin Cui
a7526ad43a Merge "Revert "Update clang version to clang-r475365"" 2022-11-30 02:02:37 +00:00
Yabin Cui
a558be6472 Revert "Update clang version to clang-r475365"
This reverts commit 7a53b71f3b.

Reason for revert: fix aosp_riscv64-userdebug build

Change-Id: Ie1579c5692335573b85fd5b062a4104023276287
2022-11-30 02:00:43 +00:00
Treehugger Robot
acf23fe098 Merge "Revert "Enable sizeof-array-div warning"" 2022-11-30 01:50:46 +00:00
Yabin Cui
4a06eea3cf Merge "Update clang version to clang-r475365" 2022-11-30 00:46:00 +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
Jihoon Kang
423d229c3b Add phony rule for java_api_library module type
Context
- Create phony rule for java_api_library module with its artifact
  (*.jar) as dependency
- Fix source directory base mislinkage issue for input text files passed
  from java_api_contributions modules

Test: m
Change-Id: I055332fd5bc7ef0d03e7b311b0efa93f4454102f
2022-11-29 23:37:55 +00:00
Krzysztof Kosiński
6be24baec4 Revert "Enable sizeof-array-div warning"
This reverts commit 5a06f330ed.

Reason for revert: Breaks aosp_bramble-userdebug
https://android-build.googleplex.com/builds/submitted/9348502/aosp_bramble-userdebug/latest/view/logs/build_error.log

Change-Id: I4e360638dee2c2d620c814ccb1c752cef47c0d21
2022-11-29 23:19:34 +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
Chih-hung Hsieh
bd879db596 Merge changes I84cf63d1,Ia74af915
* changes:
  Enable sizeof-array-div warning
  Enable array-parameter warning
2022-11-29 21:41:24 +00:00
Cole Faust
6d51e731a6 Copy bazelrc files into the queryview workspace
They are still read when using bazel with queryview, so they
need to be in the workspace so that they can be found.

Bug: 234449134
Test: m queryview && ./build/bazel/bin/bazel query --config=queryview //...
Change-Id: I1f2187dffd5a0e6cfb44ebe0c6738fa9bbef509d
2022-11-29 12:46:48 -08: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
Alix
341484b3da Bp2Build for libs property in java_library
Bp2build for both *->java_library and java_library->* edges.

Change-Id: I2540c9af2ae2fe7677767d507647b1c6669b9bb7
Bug: 244210934
Test: ./bp2build testcase, manually inspected build files for hamcrest-library, hamcrest targets
2022-11-29 19:44:50 +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
Jason Wu
47d7ccfffd Merge "Upload bp2build_metrics file" 2022-11-29 18:50:32 +00:00
Igor Foox
6463871fd9 Merge "Add tzdata do the Bazel mixed build prod mode allowlist." 2022-11-29 18:09:23 +00:00
Dan Albert
f7cb563a18 Improve error output for missing ABI dumps.
Bug: http://b/156513478
Test: tried using this, saw the error message
Change-Id: Ia5b292315a5c5d603ab0ba4dc3303b1b8ff2ef5b
2022-11-29 17:20:16 +00:00
Paul Duffin
45c566591e Merge "Output min_sdk_version to snapshot" 2022-11-29 17:19:54 +00:00
Jason Wu
c4a03138e0 Upload bp2build_metrics file
Test: m nothing
Test: m --bazel-mode-dev
Test: Verified bp2build_metrics is available in local metrics tables from builds that include this CL

Bug: 257537925

Change-Id: I09617a7850f1471f18192a0418396126fd4c98ef
2022-11-29 16:18:45 +00:00
Anton Hansson
805e0a53ef Ignore native bridge archs for apex selection
This leads to an arm64 apex being used on a device that is mixed
x86_64 with nativebridge=arm64. A device like that doesn't appear
to work with arm64 binaries. For example, the boringssl-self-check
binary crashes on boot.

Bug: 260115309
Test: unit test
Test: boot emulator with this combination
Change-Id: Ic4a91974290a05b1799f755fcf52ef226d68f4c2
2022-11-29 12:56:37 +00:00
Jiakai Zhang
7d78bad7e2 Merge "Only dexpreopt system server jars for the primary arch." 2022-11-29 11:57:24 +00:00
Jingwen Chen
ed6240d1bc Merge "Revert "bp2build conversion for Sanitize.Integer_overflow"" 2022-11-29 02:35:07 +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
Chih-Hung Hsieh
5a06f330ed Enable sizeof-array-div warning
Except third-party external/vendor projects.

Bug: 148815709
Test: presubmit; make tidy-soong_subset
Change-Id: I84cf63d1b9e244acb3ff3bc913ee9c2f1eae0e5a
2022-11-29 00:13:01 +00:00
Chih-Hung Hsieh
823e0b7e12 Enable array-parameter warning
Except third-party external/vendor projects.

Bug: 241941550
Test: presubmit; make tidy-soong_subset
Change-Id: Ia74af9155d7d1aca0e6cecf1103f4d0de4345291
2022-11-29 00:12:07 +00:00