Commit graph

66380 commits

Author SHA1 Message Date
Treehugger Robot
61a27f80cd Merge "Initial implementation of the bazel sandwich" into main 2023-07-31 23:00:55 +00:00
Treehugger Robot
a7c5278fbe Merge "Ensure extracted JNIs are stored properly in APKs" into main 2023-07-31 22:47:05 +00:00
Treehugger Robot
d97daa5a39 Merge "rust: Add Bindgen_flag_files property" into main 2023-07-31 22:38:31 +00:00
Florian Mayer
2d8b555f2e Merge "Reland "[hwasan] remove workaround for fixed toolchain issue"" into main 2023-07-31 20:46:55 +00:00
Treehugger Robot
abe5e13b9f Merge "add override_apex to version_variant test" into main 2023-07-31 20:36:07 +00:00
Luca Stefani
813de60e00 Ensure extracted JNIs are stored properly in APKs
If the android_app has the use_embedded_native_libs flag
all its JNIs must be stored with the store compression method.

The logic to add JNIs from ARR is as follows:
1) Extract JNI libs from AAR
2) Store JNI libs with deflate
3) Merge deflated JNI libs with APK

This process produces a bogus APK that won't be loaded by the
framework if the use_embedded_native_libs is set as the resulting
APK will have all its merged entries stored as deflate.

To solve the problem in case we merge JNIs with an app requiring
uncompressed JNI we add an extra step to ensure they're compressed
using the store method.

Test: m, verify apk using jni_extract has stored libs
Change-Id: Ic31d47f15412171b5898dd0e2a554cb6bf93293b
2023-07-31 21:16:18 +02:00
Treehugger Robot
7b4449ae94 Merge "Revert "Enable CFI for riscv64"" into main 2023-07-31 18:54:11 +00:00
Cole Faust
a20d947329 Initial implementation of the bazel sandwich
The "bazel sandwich" is a mechanism for bazel to depend on make/soong
outputs. The name comes from the fact that bazel is now at the top
and bottom of the build graph. This is intended to allow us to work
on converting the partition builds to bazel while not all of the
dependencies of the partition have been converted.

It works by adding the bazel_sandwich_import_file rule, which emits a
dangling symlink that starts with bazel_sandwich:, and includes
information that the aquery handler in soong reads. The aquery handler
rewrites the symlink so that it points to a file generated by
make/soong, and adds a ninja dependency from the symlink to the file
it's targeting.

This allows us to depend on make-built files from bazel, but notably
it doesn't allow us to depend on analysis-time information from make.
This shouldn't be a problem for the partitions, but limits the use of
the bazel sandwich to similar, less complicated types of builds.

go/roboleaf-bazel-sandwich

Bug: 265127181
Test: m bazel_sandwich
Change-Id: Ic41bae7be0b55f251d04a6a95f846c50ce897adc
2023-07-31 11:53:41 -07:00
Ivan Lozano
17ac9fa93e Merge "Revert "rust: Add SCS sanitizer option for AArch64"" into main 2023-07-31 18:13:40 +00:00
Treehugger Robot
82c298c240 Merge "Convert coverage libs as alwayslink" into main 2023-07-31 18:13:07 +00:00
Ivan Lozano
22823eed4b Revert "rust: Add SCS sanitizer option for AArch64"
This reverts commit 8827113577.

Reason for revert: hwasan builds breaking

Change-Id: I28094e27d5935c6f371fddddf4b6b0334de9b12c
2023-07-31 18:01:26 +00:00
Treehugger Robot
dc3606a81d Merge "Gen a header library when genrules export includes" into main 2023-07-31 17:48:44 +00:00
Ivan Lozano
0e403456b0 Merge "rust: Add SCS sanitizer option for AArch64" into main 2023-07-31 17:27:01 +00:00
Ivan Lozano
f74612e346 Merge "rust: Add support for more cargo pkg version vars" into main 2023-07-31 16:31:14 +00:00
Prashanth Swaminathan
49dcf79550 Revert "Enable CFI for riscv64"
This reverts commit 73fe13c9b1.

Reason for revert: b/293884796, crash on boot of riscv64 aosp phone.

Change-Id: Ie90e0e99ddaa7bb5d496e2b1d0ab0302702cb2bc
2023-07-31 16:15:57 +00:00
Vinh Tran
60a2ca3332 Merge "Revert "Allowlist build files in rules_python"" into main 2023-07-31 14:27:36 +00:00
Ivan Lozano
f445562840 rust: Add support for more cargo pkg version vars
Add support for CARGO_PKG_VERSION_{MAJOR,MINOR,PATCH}.

Bug: 293602526
Test: m
Test: check build flags for cargo_env_compat module
Change-Id: I6b2796656e3a489cd077c2f42b0bbd04de610ba4
2023-07-31 09:25:18 -04:00
Romain Jobredeaux
6553cf54fb Merge "Enable from-source vs from-text toggling for core.module_lib.stubs." into main 2023-07-31 13:19:25 +00:00
Ivan Lozano
7113df6c8f Merge "rust: Pass ASAN/HWASAN flags alongside fuzzers" into main 2023-07-31 12:42:46 +00:00
Pratyush
d938f83be1 Merge "Disable Hidden API Checks for ENG Builds" into main 2023-07-30 13:57:36 +00:00
Pratyush
faec4db56f Disable Hidden API Checks for ENG Builds
For more discussions/details, please check internal CL ag/24145146

Bug: 289409213
BUg: 285976182
Test: Look for hiddenapi calls in build trace
Change-Id: Ia2780ee419b8da1418ba1c7a7d732712b7c2a322
2023-07-30 13:57:10 +00:00
Florian Mayer
f50eda3b9b Reland "[hwasan] remove workaround for fixed toolchain issue"
This reverts commit e72ee14006.

Bug: 293532332
Reason for revert: Test failure fixed in https://r.android.com/2681595

Change-Id: Id40079133e50492a6e2f3e2794012695562c39f6
2023-07-28 21:22:34 +00:00
Romain Jobredeaux
9d54fdac3d Enable from-source vs from-text toggling for core.module_lib.stubs.
Also fix a typo in legacy core for system modules

Change-Id: I0b3bb04773d7ee616b94252711053d5be396b84a
2023-07-28 16:02:12 -04:00
Christopher Ferris
6ff7d9e532 Merge "Allow ramdisk targets to set cflags/exclude_srcs." into main 2023-07-28 19:02:48 +00:00
Ivan Lozano
8827113577 rust: Add SCS sanitizer option for AArch64
SCS has been supported in Rust since 1.64.0.

This adds SCS as a sanitizer option in Rust.

Bug: 168914033
Test: Built module with sanitize: { scs: true }
Change-Id: Ie54ac4693286878b98704cf052649a267777d764
2023-07-28 14:34:28 -04:00
Florian Mayer
a09c4bf8cb Merge "Revert "[hwasan] remove workaround for fixed toolchain issue"" into main 2023-07-28 18:28:22 +00:00
Treehugger Robot
ecb4c6e4dc Merge "Add test mode for java config modules" into main 2023-07-28 17:31:43 +00:00
Spandan Das
0cc3d672ce Merge "Add GoStdlib mnemonic for special handling of ''" into main 2023-07-28 16:26:57 +00:00
Spandan Das
3671dcd39a Merge changes Ie292173d,I23f14f83 into main
* changes:
  Panic if soongConfig and productConfig values do not match
  Check if soong_config_var propertystruct is zero before panicking
2023-07-28 16:26:44 +00:00
Colin Cross
61bf9ef31e Merge "Delete the javac/classes directory after zipping it" into main 2023-07-28 16:18:31 +00:00
Vinh Tran
a851ba0627 Revert "Allowlist build files in rules_python"
Revert submission 2678115-reroute-rules_python

Reason for revert: manifest for path external/bazelbuild-rules_python doesn't exist in some branches causing CI breakage.

Reverted changes: /q/submissionid:2678115-reroute-rules_python

Change-Id: I4622aea91e477b6a9dfa5dd44829245b4dfabbe6
2023-07-28 16:07:32 +00:00
Mark White
e72ee14006 Revert "[hwasan] remove workaround for fixed toolchain issue"
This reverts commit 07ca220182.

Reason for revert: b/293532332 - bionic unit tests failing

Change-Id: I11412df55d7131ff0bb36dee7258b75a12024100
2023-07-28 13:54:57 +00:00
Joe Onorato
b7c294a17e Add test mode for java config modules
Test: soong unit tests, verify output files are correct
Bug: 288632682
Change-Id: If5a6c916104e60e3688f5614b7420138e1a6323e
2023-07-28 05:30:25 -07:00
Spandan Das
2d93ebba11 Add GoStdlib mnemonic for special handling of ''
This mnemonic has '' args, which would become literal empty when
combined by strings.Join. To prevent this, add it to the
special-handling function.

Bug: 284483729
Test: N/A
Change-Id: Ibd3c3ebc55284882e7336487319070b9710076d3
2023-07-28 03:07:28 +00:00
Spandan Das
7b26e0f04e Panic if soongConfig and productConfig values do not match
Merging is not supported yet, but we do not need to panic if both of
them have the same value.

Test: m nothing
Change-Id: Ie292173d549347164f0d8ad2c04963b97eefe4df
2023-07-28 01:33:44 +00:00
Aditya Kumar
5c2b3e2ea6 Merge "Enable CFI for riscv64" into main 2023-07-28 00:22:36 +00:00
Christopher Ferris
e0202c4823 Allow ramdisk targets to set cflags/exclude_srcs.
Test: Build a ramdisk target with cflags and exclude_srcs set.
Change-Id: I44b8b379441aeda215f0831bbbadea575ea4c68f
2023-07-27 17:06:46 -07:00
Treehugger Robot
6677600f35 Merge "Emit gtest in BUILD files only if Android.bp sets it" into main 2023-07-27 23:52:46 +00:00
Spandan Das
474d43bda6 Check if soong_config_var propertystruct is zero before panicking
If we have a soong_config_module_type with target.android_<arch>.*
properties, we should only panic if a soong_config_var is used to select
on those properties. We already call `IsZero` in an upper function, but
we need to call it in `AddSoongConfigPropertiesFromTargetStruct` as well
because conditions_default gets its own struct.

Test: unit tests
Test: repro'd cmd in b/293206386#comment1, it passes now
Bug: 293206386
Change-Id: I23f14f83cc9be66487625e292e26b204dfea4f9a
2023-07-27 23:18:57 +00:00
Spandan Das
a11df791ed Merge changes from topic "go-test-bp2build" into main
* changes:
  Do not convert soong's tests in bp2build
  Create additional test target for go modules in bp2build
2023-07-27 23:16:29 +00:00
Treehugger Robot
4702ad9786 Merge "Allowlist build files in rules_python" into main 2023-07-27 21:30:33 +00:00
Treehugger Robot
268fad160a Merge "Do not enable AFDO if the option is off, even if there is a profile file" into main 2023-07-27 20:33:41 +00:00
Treehugger Robot
ad18b1467f Merge "[hwasan] remove workaround for fixed toolchain issue" into main 2023-07-27 20:14:35 +00:00
Colin Cross
a706cc8c15 Merge "Avoid extra copy of JNI libs zip" into main 2023-07-27 20:11:20 +00:00
AdityaK
73fe13c9b1 Enable CFI for riscv64
This patch reverts the last remaining piece of commit 1281b99495 as LTO has been enabled in I66c83b1116550179043490a11f66b8630c0e6b1b

Testing:
```
$ source build/envsetup.sh
$ lunch aosp_cf_riscv64_minidroid-userdebug
$ m
$ launch_cvd --num_instances=8 --daemon
$ adb devices
List of devices attached
0.0.0.0:6520    device
0.0.0.0:6521    device
0.0.0.0:6522    device
0.0.0.0:6523    device
0.0.0.0:6524    device
0.0.0.0:6525    device
0.0.0.0:6526    device
0.0.0.0:6527    device
```

Bug: b/282584808, b/254713216


Change-Id: I6fe5b1001c2c64e2a4a55176f4017bb445570176
2023-07-27 18:49:18 +00:00
Cole Faust
9b7a0e7084 Allowlist build files in rules_python
Test: m nothing
Bug: b/200202912
Change-Id: I4dc285824b6672355078679b7a036bad94108e5e
2023-07-27 18:45:02 +00:00
Steven Moreland
c8a5d7c7df Merge "Linker: no demangle." into main 2023-07-27 18:19:09 +00:00
Treehugger Robot
db195fd4cb Merge changes from topic "reland-hack-rv64-libc++" into main
* changes:
  Revert "Revert "Set VIC as minimum SDK version for riscv64""
  Revert "Revert "Use prebuilt NDK libc++ for rv64.""
2023-07-27 18:17:35 +00:00
Ivan Lozano
408d37319a rust: Pass ASAN/HWASAN flags alongside fuzzers
'-Z sanitizer={hw}address' was not being passed if the fuzzer sanitizer
property was also set. Additionally, trying to use the fuzzer sanitizer
with the address sanitizer incorrectly linked in the hwasan runtime.

Bug: 293466009
Test: SANITIZE_TARGET="fuzzer address" m android_logger_fuzzer
Test: SANITIZE_TARGET="fuzzer hwaddress" m android_logger_fuzzer
Test: ldd <fuzzer_on_device> # ensure correct libraries linked
Test: Check build flags
Change-Id: I6b01c8808af07c642217b642af128ebf934f4bc6
2023-07-27 14:00:07 -04:00
Spandan Das
89aa0f71c9 Do not convert soong's tests in bp2build
These tests cannot be run with b since it uses functions that should not be
used outside tests, and it enforces this by looking at os.Args. Since
the pattern (`-test`) is missing in os.Args, these tests panic in b.

A module can be a dep of soong_build via two mechanisms
1. Listed in deps explicitly
2. Via plugin_for to create a reverse dep

This CL denylists (1) explicitly. e.g. soong-android. Another option
would have been to denylist by using Deps() of soong-build, but that
would denylist `golang-protobuf-proto` as well

This CL denylists (2) programmatically.

Note that this CL only denylists creation of the `go_test` target. We
will still create `go_binary` and `go_library` for soong since there
might be tools that depend on soong.
e.g.
```
--> depends on
dexpreot_gen --> soong-dexpreopt --> soong-android (test failure)
```

(The above example means that we might need to convert _some_ of soong
after all, but we can refactor the common bits to common utils. Keeping
this out of scope for now).

Test: b test //build/soong/... //system/tools/...
too)
Bug: 284483729

Change-Id: I809012bdd383febca30da95e991edfde5fd4d9b9
2023-07-27 17:11:51 +00:00