Commit graph

693 commits

Author SHA1 Message Date
Treehugger Robot
744c740c92 Merge "Update Rust OWNERS" 2022-02-24 21:43:15 +00:00
Stephen Hines
a982582cf8 Update Rust OWNERS
We haven't updated this in a while, and we have new team members who
should be able to edit Rust build-related rules.

Test: N/A
Change-Id: Iaf001d0718ca187e5570a1198d06a3ae4db78e4c
2022-02-23 12:05:27 -08:00
Pirama Arumuga Nainar
f80a59fac9 [rust] Update clang version used to build bindgen
Bug: http://b/214080353

Use clang-r445002

Test: presubmit
Change-Id: I8b7d5b55757838c303e3695e398e84687804e948
2022-02-23 19:35:08 +00:00
Treehugger Robot
309ee8d398 Merge "Propagate data_bins from Soong to Make" 2022-02-18 01:26:07 +00:00
yangbill
22bafec042 Propagate data_bins from Soong to Make
Write the list of a test module's data_bins value to the
`LOCAL_TEST_DATA_BINS` Makefile variable defined for each module.
This enables downstream tools to correctly set up the runtime
environment for execution. And currently only sh_test, cc_tests, and
rust_tests has this attribute in Android.bp.

Bug: 215234071
Test: m out/soong/Android-aosp_cf_x86_64_phone.mk
Change-Id: I8d47f5f9b25afdc5975c6b414405badb38dbde4b
2022-02-17 04:06:34 +00:00
Justin Yun
2b3ed6403c Fix rust snapshot to capture static libs correctly
SnapshotStaticLibs must include static libs, but it had shared libs.

Bug: 219746113
Test: build vendor snapshot
Change-Id: I0660811bb94446129ae97f52306b065dec73cabd
2022-02-16 08:15:07 +09:00
Aditya Belsare
c0bd27b3b0 Add cert_validator to allowed rust paths
Test: m libcert_request_validator works

Change-Id: I40b8027e98a775dc1b9d3a8ab4431c12d6088c12
2022-02-08 07:32:31 +00:00
Liz Kammer
0ea7998208 Update error messages for failed globs.
Currently error messages appear like:
&fs.PathError{Op:"open", Path:"..." Err:0x18}
which make them difficult to parse.

Test: CI
Change-Id: I18da18abc43230d0ea37d166179d07e585077f51
2022-02-07 08:56:47 -05:00
Treehugger Robot
7afffe6af0 Merge "Allow UWB to use Rust in reference HAL" 2022-01-28 22:08:36 +00:00
Treehugger Robot
6bf833f428 Merge changes from topic "musl_rust"
* changes:
  Support building rust modules against musl libc
  Support genrules as CrtBegin and CrtEnd in rust
  Support multiple crtbegin and crtend dependencies
2022-01-27 21:39:18 +00:00
Pirama Arumuga Nainar
1785fcb171 Merge "[rust/coverage] Remove obsolete WAR to pass -z,start-stop-gc" 2022-01-27 18:37:40 +00:00
Pirama Arumuga Nainar
668da23096 [rust/coverage] Remove obsolete WAR to pass -z,start-stop-gc
Bug: http://b/199203503

Rust's llvm-project source now includes  https://reviews.llvm.org/D97448
and we no longer need this workaround.

Test: m unicode-xid_test_src_lib and verify __llvm_prf_data section is
      present.
Change-Id: I0387bd3af8bfc765f3aba3b309bfbc7ef49d565d
2022-01-26 21:39:49 +00:00
Matthew Maurer
2f90708221 Allow UWB to use Rust in reference HAL
Bug: 216358770
Change-Id: If0be032a248f6258232e2e47c489983b5416c536
2022-01-25 22:40:12 +00:00
Colin Cross
e32f093120 Support building rust modules against musl libc
Add a rust toolchain for musl libc, use std library built from source,
and add default dependencies on musl libc.

Bug: 216192129
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ic5ff4487db9693aeb08a13405f4d18465eecdc4b
2022-01-24 17:33:05 -08:00
Colin Cross
018cbebd71 Support genrules as CrtBegin and CrtEnd in rust
Musl will use a genrule output as a linker script in CrtBegin,
support genrules as Crt* dependencies.

This is equivalent to Ie384089d26459797d0b4b5fef84846507fc508ad
in cc.

Bug: 216192129
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ibc08fdcff7a6bca2a1ec05b781ce929080e211bd
2022-01-24 17:33:05 -08:00
Colin Cross
fe605e14ee Support multiple crtbegin and crtend dependencies
Musl libc with an embedded linker uses multiple crtbegin dependencies,
convert rust's CrtBegin and CrtEnd to lists.

Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ie843801e87b1f38ace84502d9e4f938a92ec1fa2
2022-01-24 17:33:05 -08:00
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