Commit graph

677 commits

Author SHA1 Message Date
Yi Kong
7433f1d1dc Merge "AFDO for Rust" 2022-01-22 04:16:27 +00:00
Charisee
1a716de57e Update RustDefaultVersion to 1.58.1
Change-Id: Idf6b1e2a83eeb0bdace0583ab02d7c1b393b6c4c
2022-01-21 19:47:53 +00:00
Yi Kong
46c6e59415 AFDO for Rust
Bug: 195134194
Bug: 165018530
Test: build
Change-Id: I30932a22dc0b22716cdc925a3fcc5f9a169fcec4
2022-01-21 18:13:18 +08:00
Pirama Arumuga Nainar
3ae0b5a7c1 Merge "Revert memory mapped coverage" 2022-01-19 06:03:26 +00:00
Treehugger Robot
706ab94ee7 Merge "Allow tools/vendor to build rust" 2022-01-18 22:04:14 +00:00
Pirama Arumuga Nainar
aa966c5630 Revert memory mapped coverage
Bug: http://b/194128476
Bug: http://b/210012154

Reverts:
e6840726bd "[coverage] Override -Wframe-larger-than"
71d697c5cb "Enable memory-mapped coverage instrumentation"

Coverage metrics dropped for ~10 of the 40 modules.  There are also
regressions in mainline when running tests on older platform builds.

Test: presubmit
Change-Id: I4a2b005d3b54764b762b5422e03b7a9ec8727227
2022-01-18 13:13:47 -08:00
Richard Fung
3d11a5698a Allow tools/vendor to build rust
This is necessary to move the mk_payload package from
packages/modules/Virtualization/microdroid to an ARC owned directory.

Bug: 196891323
Test: m -j
Change-Id: Ifa3e509fb4ffa7861e45f69dd4654e8fbe1677ff
2022-01-18 18:26:35 +00:00
Ivan Lozano
2a1291d01d Merge "rust: Fix exported MinSdkVersion" 2022-01-14 22:39:09 +00:00
Ivan Lozano
a91ba25464 rust: Fix exported MinSdkVersion
The exported rust.MinSdkVersion always returns an empty string. Instead
it should return the Min_sdk_version property like rust.minSdkVersion.

This CL renames minSdkVersion to MinSdkVersion so the exported function
has the correct behavior.

Bug: 211858959
Test: m
Change-Id: I4fecfba711c0d3d7a22f4fdf7684924a9457b464
Merged-In: I4fecfba711c0d3d7a22f4fdf7684924a9457b464
2022-01-14 19:57:55 +00:00
Chris Wailes
57c23fa814 Update RustDefaultVersion to 1.58.0
This CL updates the RustDefaultVersion to the new prebuilt version
number and adds an argument to suppress a new linter warning,
non-send-fields-in-send-ty, that is prone to false positives.  See
https://github.com/rust-lang/rust-clippy/issues/8045 for more
information.

Test: m rust
Bug: 213921092
Change-Id: Ide568327f0a8994a6a934d14bb67b3139d0d98da
2022-01-13 17:14:17 -08:00
Treehugger Robot
e751b5355e Merge "Remove self from OWNERS" 2022-01-12 01:45:56 +00:00
Pirama Arumuga Nainar
6609484961 Merge "Enable memory-mapped coverage instrumentation" 2022-01-10 22:36:57 +00:00
Joel Galenson
bfa6a23761 Remove self from OWNERS
Test: None
Change-Id: I14317674f8c9487752ebc2d17c769ed777497ee8
2022-01-06 10:16:34 -08:00
Chih-Hung Hsieh
5140a042e1 Update clang version to clang-r437112b
Bug: 201432564
Test: make
Change-Id: I77bb074ed8dee7cad63d3b3765d9a2c3bc1b8aae
2022-01-05 16:44:51 -08:00
Treehugger Robot
9b3b15c382 Merge "rust: Register rustdoc with checkbuild" 2022-01-05 21:54:40 +00:00
Treehugger Robot
0b9b99adf2 Merge "rust: Support protobuf wrappers well known types" 2022-01-04 19:54:44 +00:00
David Duarte
b6be48d6c9 rust: Support protobuf wrappers well known types
Test: m nothing

Change-Id: I271474f59745670cbba98704182d0966eae6b0ee
2022-01-04 08:52:45 +00:00
Matthew Maurer
2e2ec0573f Merge "rust: Disable dylib vendor modules" 2021-12-20 21:40:56 +00:00
Matthew Maurer
bdda910395 rust: Disable dylib vendor modules
These modules do not currently build correctly. Support is planned but
not complete.

Bug: 204303985
Test: Presubmit + build `rust_library` with `vendor_available: true`
Change-Id: Iac7df9fe0d4eaa9a5ec0ff5a9cd5670af23df2a6
2021-12-16 23:42:47 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Joel Galenson
f25ab75d63 Merge "rust: Fix Host multilib prop for rust_test modules." 2021-12-15 15:28:00 +00:00
Pirama Arumuga Nainar
71d697c5cb Enable memory-mapped coverage instrumentation
Bug: http://b/194128476
Bug: http://b/210012154

- pass -runtime-counter-relocation flag, which is needed to enable
memory-mapped coverage on Linux/Android.

- Include '%c' specifier in -fprofile-instr-generate compiler flag to
default to memory-mapped coverage.

- Disable continuous coverage if instrumentation is on for bionic/libc
(http://b/210012154).

Test: Run few coverage tests on Forrest.
Change-Id: Ie3a912f66470fcd3ffc2ffd73371a4e1d2b15df3
2021-12-13 14:44:32 -08:00
Matthew Maurer
c1738b449b rust: Migrate default edition to 2021
Bug: 210475268
Test: Presubmit
Change-Id: I915a8779c032dc463bf76a1a41f545d29a7be044
2021-12-13 18:20:53 +00:00
Matthew Maurer
e3803630c2 rust: Register rustdoc with checkbuild
Bug: 197237709
Test: m checkbuild, manually verify rustdoc targets built
Change-Id: Icfcc4a8c1bc7de4c5e1abbe495646504490ac927
2021-12-10 21:59:15 +00:00
Colin Cross
b435744fdc Merge changes from topic "soong-license-metadata"
* changes:
  Add dependency license annotations
  Build license metadata files in Soong
  Escape Host*Variable contents
2021-12-10 21:43:49 +00:00
Chris Wailes
bc62193c7f Replace Rust global arg with more legible alternative
Bug: 201431719
Test: m rust
Change-Id: I5e0fae74e1df02f059ddcfa004b29059126a52e0
2021-12-09 13:56:32 -08:00
Colin Cross
b674b43656 Add dependency license annotations
Add annotations to dependency tags that are dynamic or classpath
linkage.

Bug: 207445310
Test: m checkbuild
Change-Id: Ife89b8f234aa40c380c721eda7dd18cab697fbb3
2021-12-08 15:08:59 -08:00
Treehugger Robot
a85f7bde32 Merge "Support rust_toolchain_library for rust-project" 2021-12-08 14:14:34 +00:00
Thiébaud Weksteen
566eb80d3c Support rust_toolchain_library for rust-project
Bug: 209678277
Test: SOONG_GEN_RUST_PROJECT=1 m nothing; check that libstd is included
Change-Id: Ic197e00bc4695aa6dcd46b8c704a82a2e5e90460
2021-12-08 17:54:19 +11:00
Treehugger Robot
4efcb9d81a Merge "Update clang version to clang-r437112" 2021-12-08 04:00:23 +00:00
Chih-Hung Hsieh
253fd0609d Update clang version to clang-r437112
Bug: 201432564
Test: make
Change-Id: Idad9e1154b2c65eb29b7682c205f7bb50af17f0b
2021-12-07 15:24:38 -08:00
Chris Wailes
58e748d8d4 Merge "Allow users to enable local incremental Rust builds" 2021-12-07 19:33:24 +00:00
Ivan Lozano
f5c98a2fe5 rust: Fix Host multilib prop for rust_test modules.
NewRustTest will set MultilibBoth true for modules which target
devices, however modules which target both device and host
incorrectly sets MultilibBoth for the host variant. Host tests
can only produce the primary arch target. Therefore, add the
rustTestHostMultilib load hook to set MultilibFirst for the
host variant.

Test: m rust_test module with host_supported: true, check if x86 test
      produced.
Change-Id: I5b04b2a2d898823bcf326336d1d28c46945d47f5
2021-12-07 10:19:48 -05:00
Chris Wailes
d9781fd67e Allow users to enable local incremental Rust builds
This CL allows users to set the SOONG_RUSTC_INCREMENTAL environment
variable to enable incremental Rust builds.  The out/soong/rustc
directory is used for intermediate artifacts.

Test: m rust
Change-Id: Ica2587c30596325b7d3e82d8e3c1d610b92718b8
2021-12-06 15:02:20 -08:00
Yi Kong
203e6f4115 Add "-Z debug-info-for-profiling" flag for AutoFDO
Test: presubmit
Bug: 195134194
Change-Id: I0133ce99e2d5f415e553f7ae8e2ff93c739d6a32
2021-12-07 02:43:20 +08:00
Treehugger Robot
f8646fc937 Merge "Update RustDefaultVersion to 1.57.0" 2021-12-03 23:04:54 +00:00
Chris Wailes
284b7f32cc Update RustDefaultVersion to 1.57.0
Change-Id: I90e03f864541175e13701184ee74a89ffd03790b
2021-12-03 12:00:59 -08:00
Matthew Maurer
0e714da0f3 rust: Ensure unwind tables are generated
Currently, we are depending on a platform default in rustc's
android_base module to keep unwind tables generated. That default was
configured specifically to change the behavior for Firefox profiling
purposes prior to the existence of the override flag. As a result,
there's no structural reason the default will remain as is.

Bug: 193702360
Test: m
Change-Id: Ic5b57d5a31f4e67a66351a3f0efc530c95aa3836
2021-11-24 22:03:25 +00:00
Pirama Arumuga Nainar
1381dceeba Update rust prebuilt version to 1.56.1p1
Respin rust point release 1.56.1p1 with cherry-pick of
https://reviews.llvm.org/D104556 (needed for Rust coverage).

Bug: https://issuetracker.google.com/issues/206980172
Test: m rust
Change-Id: Ib63a7d8128c86ae9291c4f5275726cfc3bc15f48
2021-11-22 09:55:44 -08:00
Ivan Lozano
9fdba2844e Merge "rust: Add rust_toolchain_library module." 2021-11-17 16:59:15 +00:00
Ivan Lozano
45e0e5b012 rust: Add rust_toolchain_library module.
Adds a new rust_toolchain_library module, a module which can compute the
source path from the toolchain root.

Bug: 140642453
Test: m

Change-Id: I2d90722880279533eb93d2d946ac8c31fc0b1835
2021-11-16 08:51:48 -05:00
Ivan Lozano
aed0adfee9 Merge "rust: Add Recovery Snapshot Soong tests for rust." 2021-11-16 13:47:18 +00:00
Ivan Lozano
b993a835c3 Merge "rust: Add data_libs and data_bins to rust_test" 2021-11-16 13:46:49 +00:00
Ivan Lozano
3e1bc6cc0d Merge "Use new soong_cc_rust_prebuilt.mk" 2021-11-15 22:19:46 +00:00
Ivan Lozano
4e5f07d27b rust: Add data_libs and data_bins to rust_test
Allows defining data binaries and libraries that should be installed
alongside a rust_test module, similar to cc_test.

This refactors cc_test as well so it can define rust_ffi_shared and
rust_binary modules as data.

Bug: 171710847
Test: New Soong tests pass.
Test: Example module installs data appropriately.
Change-Id: I0b56098fb475ec54f9b7a761220d260fe68cbee1
2021-11-15 17:18:42 -05:00
Ivan Lozano
c2ca1ee83d rust: Add Recovery Snapshot Soong tests for rust.
Bug: 197866992
Test: m nothing
Change-Id: I4b5401cf2ffa0dbcc6fea60f90bad4c47a9d5e6b
2021-11-15 17:11:20 -05:00
Ivan Lozano
92a89ed1c5 Merge "rust: Skip global 'fuzzer' sanitizer static bins" 2021-11-15 19:17:54 +00:00
Ivan Lozano
602227bcb5 Merge "rust: Only apply hwasan flags once to fuzz targets" 2021-11-15 16:03:31 +00:00
Ivan Lozano
6c5b8f4e02 rust: Skip global 'fuzzer' sanitizer static bins
The 'fuzzer' sanitizer enables 'hwasan', which is not supported for Rust
static binaries. Make sure we skip applying this sanitizer to those
binaries.

Bug: 204776996
Test: SANITIZE_TARGET=fuzzer m <static_rust_executable>
Change-Id: I619cfab32b46c0811590973344eb5cdbe3f1a119
2021-11-15 09:35:12 -05:00
Ivan Lozano
f3e8fc3f0b rust: Only apply hwasan flags once to fuzz targets
On HWASAN global sanitized builds, fuzz targets had hwasanFlags applied
twice. Rust only allows llvm-args flags to be passed in once however, so
this broke compilation.

Bug: 204915322
Test: SANITIZE_TARGET='hwaddress fuzzer' m <fuzzer>
Change-Id: I4f6c35e04bc4c891d9c66e8a53c3dcb88e8670cf
2021-11-13 07:46:05 -05:00