Commit graph

64497 commits

Author SHA1 Message Date
Sam Delmerico
ca438e6b72 mixed builds correctly reference stubs libs
Bug: 270408757
Test: go test
Test: m NeuralNetworksTest_shared_partial --bazel-mode-staging
  && verify that Ninja commands link libneuralnetworks via stubs
Change-Id: I19bf5a829cea7fd00c0f82511ad2bddbc40fae4f
2023-04-14 12:42:23 -04:00
Jeongik Cha
b745e2e205 Use module type, size of srcs or deps to prioritize module
Instead of listing up module names, use another information from soong
such as module type, or size of inputs.

I focused on recall, not precision or accuracy, because false negative
module can slow down whole build

Bug: 273282046
Test: m --ninja_weight_source=ninja_log
Change-Id: I8fcc26f1312fda36197c787d240bc3d7b5346481
2023-04-15 00:58:15 +09:00
Treehugger Robot
9e1117bf66 Merge "Differentiate between public and module-lib stub variants" 2023-04-14 02:46:23 +00:00
MarkDacek
9c094ca153 Fix issue where bazel-force-enabled-modules aren't actually analyzed.
Bug: 273910287
Test: run mixed_mode_test.sh

Change-Id: I309c423b6e7f505ad1db0d9327e7de6b8298dfe9
2023-04-14 02:17:54 +00:00
Treehugger Robot
3d1b6964ec Merge "Update min_sdk_version used in testNoUpdatableJarsInBootImage" 2023-04-13 23:25:45 +00:00
Cole Faust
d82f036b89 bp2build support for python_test(_host)
There was a request for using b with python tests. bp2build python
tests exactly the same way as python binaries so that they can be
used with `b`.

Bug: None
Test: go test
Change-Id: Id68a6a73572745a4885b3e5bb1b8452e36baa982
2023-04-13 16:10:59 -07:00
Cole Faust
d580613a0e Remove special handling of prebuilt_framework-res
prebuilt_framework-res doesn't appear to exist anymore.

Bug: 185811447
Test: m nothing
Change-Id: Ib1aa929fbe007f87d03bdc85e4d54c6fae4e510b
2023-04-13 15:48:30 -07:00
Romain Jobredeaux
1a3382c0c2 Delete platform mapping specific bp2build code
Bug: 249685973
Test: Presubmits
Change-Id: Ib76a7659dfe57731100550c2cff4de960be2f1d7
2023-04-13 18:48:00 -04:00
Treehugger Robot
f5cd477841 Merge "Split Rust crate builds into compile and link phases." 2023-04-13 22:45:02 +00:00
Spandan Das
b2b41d57cd Differentiate between public and module-lib stub variants
The public stubs of libclang_rt.* originate from the same module. When
generating the Androidmk entries for these stubs, we need to add a
suffix to differentiate between the two stub variants.

This is likely an issue specific to libclang_rt.*. The public stubs of
other libraries like libc, liblog, ... come from a separate module
ndk_library which adds an .ndk suffix

Test: lunch module_arm64only && TARGET_BUILD_APPS="build.bazel.examples.apex.minimal" build/soong/soong_ui.bash --make-mode  nothing
(with aosp/2535141)
Test: lunch aosp_cf_arm64_phone-userdebug && m nothing

Change-Id: I2b4411cb022b4e27f44d2fce6cb26492dd7e2278
2023-04-13 22:25:40 +00:00
Treehugger Robot
01add2893c Merge "Add external_updater to bazel allowlist." 2023-04-13 21:13:05 +00:00
Trevor Radcliffe
4ffcdad9c0 Merge "New test for propagation of CFI" 2023-04-13 21:10:57 +00:00
Romain Jobredeaux
a3c029e7d5 Merge "Bp2build support for sdk_version and java_version." 2023-04-13 20:53:07 +00:00
Dan Albert
f1235a8787 Add external_updater to bazel allowlist.
Bug: None
Test: treehugger
Change-Id: I2b8a357198dbe0b2be4850ba7de4a749910c1be1
2023-04-13 16:39:28 +00:00
Trevor Radcliffe
bc65f63abc New test for propagation of CFI
Bug: 261733820
Test: It is a test

Change-Id: I3aedbdc14c4f5c41a706962894b6c686dbb1a70c
2023-04-13 14:46:40 +00:00
Jooyung Han
748fd189b5 Merge "Make conv_linker_config visible to linkerconfig" 2023-04-13 08:24:40 +00:00
Elliott Hughes
7d57090bb3 Merge "Temporarily disable shadow call stack for riscv64." 2023-04-13 01:47:42 +00:00
Cole Faust
70079c1192 Merge "Don't type variables as booleans in mk2rbc" 2023-04-12 23:35:53 +00:00
Peter Collingbourne
e7c71c344d Split Rust crate builds into compile and link phases.
Teach rustc to generate object files instead of a linked executable
for binary and shared library crates. This lets us skip the lengthy
Rust compilation phase when only the C++ dependencies of these crates
have changed.

This works using a Python script that replaces the linker invoked by
rustc and converts the linker command line into a rspfile that can be
used during the link phase. The script makes certain assumptions about
how rustc invokes the linker, but since we control the version of Rust
we use, we can update the script if those assumptions ever break. I've
asked the Rust developers about adding an official way to do this so
hopefully we won't need to rely on this hack in the future.

The rustc rule for Kythe has been altered to pass linker=true, somewhat
consistent with the main rustc rule, which now doesn't invoke the actual
linker either. `m xref_rust` still succeeds, but hopefully we can find
someone who knows more about the rest of the Kythe pipeline who can let
us know whether it should still work. Otherwise, let's use this CL as
an opportunity to find out whether the rest of the pipeline is happy
with linker=true, since otherwise we will find it hard to maintain the
Kythe rule in the future.

Change-Id: Ifb9c8689c1bd78c0afcf6fdfd111140d20377536
2023-04-12 15:51:41 -07:00
Treehugger Robot
5a15e9522c Merge "Fix crash when missing platform sdk version" 2023-04-12 21:35:31 +00:00
Elliott Hughes
2aff6c1132 riscv64: stop reserving x18 for shadow call stack.
We're switching from x18 to gp, in stages. This change frees up x18
again now bionic and ART have switched to gp. There's no need for a
corresponding "reserve gp" change because gp is automatically reserved.
That's what makes it the perfect choice for shadow call stack (at
least until we get Zsslpcfi and an actual hardware shadow stack pointer
special-purpose register).

Bug: https://github.com/google/android-riscv64/issues/72
Bug: http://b/277909695
Test: treehugger
Change-Id: Iaee1d44cba8daf5d4a27a3791fe3cc28ed1a5d9a
2023-04-12 14:24:44 -07:00
Treehugger Robot
7a9626c655 Merge "Make buildroot.cquery determinisitc" 2023-04-12 21:04:52 +00:00
Elliott Hughes
5beb42fe22 Temporarily disable shadow call stack for riscv64.
We're trying to switch from x18 to gp for shadow call stack, ideally
without breaking anything, so let's disable shadow call stack while we
rearrange things behind the scenes...

Bug: http://b/277909695
Test: treehugger
Change-Id: Ic1a6bceaf0ab20dc66e1903747ebb668232a253a
2023-04-12 13:11:29 -07:00
Cole Faust
c7335de0dd Don't type variables as booleans in mk2rbc
Our boolean support is not fully fleshed out enough to make variables
real booleans. Keep them strings for now to resolve CI failures.

Bug: 275865081
Test: ./build/bazel/ci/rbc_dashboard.py --quick with aosp/2526609
Change-Id: I636bd9f39b50a47ecf92aecd2bf8ea41eac4d604
2023-04-12 12:13:28 -07:00
Trevor Radcliffe
2a1de1bfe6 Merge "Separate out Cross DSO flag for Bazel" 2023-04-12 18:38:39 +00:00
Cole Faust
37d27c4884 Fix crash when missing platform sdk version
Fixes: 277890306
Test: Presubmits
Change-Id: I26658a90856cb057c631bb71ca0cd094ed648cf5
2023-04-12 10:32:18 -07:00
Treehugger Robot
f937bad953 Merge "Merge TQ2A.230405.003" 2023-04-12 17:22:25 +00:00
Treehugger Robot
ebf93ff2d8 Merge "add libneuralnetworks[_static] to staging allowlist" 2023-04-12 17:08:01 +00:00
Jooyung Han
4b4f03fd82 Make conv_linker_config visible to linkerconfig
linkerconfig_diff_test uses conv_linker_config.

Bug: 276890767
Test: atest --host linkerconfig_diff_test
Change-Id: I2f669b83f24b9dd563fc034738fe4ba83f95fd49
2023-04-12 17:20:47 +09:00
Jingwen Chen
aea34a38ca Merge "Revert^2 "Re-land test tzdata apex with bazel builds."" 2023-04-12 06:50:26 +00:00
Cole Faust
12f9cef5fe Merge "Break constant information out of product vars" 2023-04-12 04:08:45 +00:00
Romain Jobredeaux
2eef2e13e9 Bp2build support for sdk_version and java_version.
This CL adds java_version and sdk_version support to bp2build
converters for
   - java library
   - java binary
   - android library
   - android binary
   - android library import

Although java import doesn't support java_version and sdk_version, the
neverlink java_library wrapper around a java_import must specify a
sdk_version when targetting a device. "none" is used by convention.

Change-Id: I22a69dea2e351858368df69ed6a703b568d613ea
Bug: 215230098
Test: Presubmits
2023-04-11 21:05:48 -04:00
Cole Faust
eb644cfb34 Break constant information out of product vars
We don't want rules to load the product variables directly, because
then they won't be able to transition on them.

Break constant information that is safe to load outside of the
product vars file, so that we can make the product vars file have
more restricted visibility later.

Bug: 269577299
Test: m nothing
Change-Id: I848bff33e4f5798f51296ea3a2600615cab36985
2023-04-11 15:38:43 -07:00
Steven Moreland
a80b113f55 Merge "Add name hint to Soong." 2023-04-11 20:26:04 +00:00
Jihoon Kang
bbd707fadf Merge "Remove completed TODO in android/visibility.go" 2023-04-11 19:23:31 +00:00
Alex Márquez Pérez Muñíz Díaz Puras Thaureaux
c641cc496b bp2build: migrate export_{,system_}include_dirs -> *includes for cc_prebuilt_library{,_static,_shared}
Migrate `export_include_dirs` property to attribute `export_includes`, handling arch/os-variants
Migrate `export_system_include_dirs` property to attribute `export_system_includes`, handling arch/os-variants

Test: cc_prebuilt_library_{,shared_,static_}conversion_test.go
Test: mixed_droid.sh
Bug: 229374533

Change-Id: I658a336a71265af0545c1c2db1a4f6eb613a7366
2023-04-11 18:56:41 +00:00
Trevor Radcliffe
9f4b4769c5 Separate out Cross DSO flag for Bazel
See the other CL in this topic for a description of why.

Bug: 261733820
Test: Unit Tests
Change-Id: I045c2f883258c3f5db9790300d89a7be04d56012
2023-04-11 17:43:15 +00:00
Liz Kammer
f6275096ea Remove module with a cc_test_library static dep
Currently we treat cc_test_library as a shared library but it really can
be both a static and a shared library. This causes issues when trying to
statically link a shared library.

Test: bp2build.sh
Change-Id: Ie3a4c0ffa607e1c9fcffe015d216be7a9bccfb4d
2023-04-11 11:06:07 -04:00
Jingwen Chen
6134211c2d Revert^2 "Re-land test tzdata apex with bazel builds."
fb8b1a69e9

Change-Id: Id5c0edd1cd4aacbb75a8019e0a5ada4e608fbf09
2023-04-11 14:55:27 +00:00
Trevor Radcliffe
a772d6588d Extract out Visibility flags
Bug: 261733820
Test: Unit tests
Change-Id: Ief4ca3b34de6df9a613e94fd31b447a7bb1f04f8
2023-04-11 13:41:17 +00:00
Treehugger Robot
3848896584 Merge "Include license texts and kinds for VNDK snapshot" 2023-04-11 08:44:44 +00:00
Jingwen Chen
ed35066ec7 Merge "Revert "Re-land test tzdata apex with bazel builds."" 2023-04-11 07:23:31 +00:00
Junho Yoon
fb8b1a69e9 Revert "Re-land test tzdata apex with bazel builds."
Revert submission 2522075-tzdata-test-apex-bazel

Reason for revert: DroidMonitor: Potential culprit for Bug X - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted

Reverted changes: /q/submissionid:2522075-tzdata-test-apex-bazel

Change-Id: I08bfddf05a3461328c0b77dfe6c532a7f20a3df9
2023-04-11 07:15:14 +00:00
Xin Li
e7903cfa11 Merge TQ2A.230405.003
Bug: 271343657
Merged-In: I3bf5aecbfd717036a5b167696b107ee6cb1830b4
Change-Id: I85caea2f4b81679a6789aee7a642d7b9c54d9edb
2023-04-10 23:54:50 -07:00
Treehugger Robot
1000493802 Merge "Re-land test tzdata apex with bazel builds." 2023-04-11 02:42:06 +00:00
Treehugger Robot
9aecb53b8d Merge "Include NDK CRT object variants in the sysroot." 2023-04-11 01:00:04 +00:00
Yi Kong
6706ff674b Merge "Turn off stack protector check for noreturn calls" 2023-04-11 00:42:33 +00:00
Steven Moreland
671dc2319b Add name hint to Soong.
Bug: N/A
Test: updated, also manual:

error: system/tools/aidl/Android.bp:431:1: "aidl_test_client_ndk" depends on undefined module "aidl-test-versioned-interface-ndk". Did you m
ean ["aidl-test-versioned-interface-V1-ndk" "aidl-test-versioned-interface-V2-ndk" "aidl-test-versioned-interface-V3-ndk" "aidl-test-version
ed-interface-api"]?

Change-Id: I62f679d1f2152b42cdc336b6e3e7814cd2594c92
2023-04-10 20:20:41 +00:00
Yi Kong
ecc18df6ff Turn off stack protector check for noreturn calls
This feature has a substantial impact on RSS memory usage (>2% in many processes). Turn this off for now.

Test: RSS memory benchmark
Bug: 277565884
Bug: 277083500
Change-Id: I2fc5826048ba5d00cabcc8401ac40a6f54812a43
2023-04-10 11:57:19 +00:00
Jooyung Han
33a25c1a0d Merge "Run apex_sepolicy_tests" 2023-04-10 02:36:35 +00:00