Commit graph

480 commits

Author SHA1 Message Date
Treehugger Robot
62b9c5bd99 Merge "[rust] Update clang version used for bindgen" 2021-04-19 20:18:39 +00:00
Treehugger Robot
9bd39fe80d Merge "Rustdoc support." 2021-04-19 19:40:18 +00:00
Pirama Arumuga Nainar
655a7d50f4 [rust] Update clang version used for bindgen
Bug: http://b/185528062

Test: presubmit
Change-Id: I0060643b0dec998d1d4f8da2c504c79223995f98
2021-04-19 10:10:21 -07:00
Treehugger Robot
aef14db78a Merge changes from topic "tvts-test-host-jni"
* changes:
  Add jni_libs property to java tests
  Add Target to cc.SharedLibraryInfo
2021-04-17 04:35:24 +00:00
Dan Albert
06feee9352 Rustdoc support.
Adds `m rustdoc` which generates documentation for all Rust libraries
to $OUT_DIR/soong/rustdoc.

Follow up work:

* Generate an index page that lists all modules.
* Preserve the artifacts so we can have an always-up-to-date go link.

Test: m rustdoc
Bug: None
Change-Id: Id2d6b9cbab5b02e36b575567563d7cc7606b9401
2021-04-16 13:38:01 -07:00
Thiébaud Weksteen
45c647d4dc Merge changes I59439b77,I7dbaf8be
* changes:
  bloaty: measure stripped Rust binaries
  rust: do not strip static library
2021-04-15 18:46:32 +00:00
Thiébaud Weksteen
e4dd14b25f bloaty: measure stripped Rust binaries
Modify bloaty's MeasureSizeForPath to allow a module to provide multiple
paths. This is used to measure both unstripped and stripped
libraries/binaries. Add unit test to ensure correct measurements are
generated for Rust.

Test: m out/soong/binary_sizes.pb.gz
Change-Id: I59439b77dbf1cf5ad71e1c02996a6a90938536b4
2021-04-15 12:02:51 +02:00
Treehugger Robot
638830a5a0 Merge changes from topic "userdebug_plat_sepolicy.cil_Android.bp"
* changes:
  Add debug ramdisk variant
  Add path tests for ramdisk
2021-04-15 05:22:35 +00:00
Inseob Kim
f84e9c05e2 Add debug ramdisk variant
A module will be installed to debug_ramdisk (or
debug_ramdisk/first_stage_ramdisk if recovery as boot is true) if
debug_ramdisk is set to true.

Bug: 184004542
Test: soong test
Change-Id: Ic5a4d27407e506fffa462de2149e0785f11b2ac7
2021-04-15 00:56:30 +00:00
Ivan Lozano
d466b4a1f5 Merge changes from topic "rust_vendor_support"
* changes:
  Add more Rust vendor image support.
  rust: Use new common image mutator interface.
2021-04-14 19:02:49 +00:00
Ivan Lozano
e8dfbdfb59 Merge "cc: Create a common image mutator interface" 2021-04-14 18:53:18 +00:00
Thiébaud Weksteen
4fab05a2ad rust: do not strip static library
Test: m
Change-Id: I7dbaf8be625acae89b0a62ea13d0b250c6542a79
2021-04-14 19:20:07 +02:00
Tri Vo
9e7bfdae31 Merge "rust: Switch rust_fuzz to HWASan" 2021-04-14 16:49:27 +00:00
Jeffrey Vander Stoep
d587ec225a Merge changes from topic "rust_benchmark"
* changes:
  Attach rust_benchmark to atest and tradefed.
  Add rust_benchmark module to soong.
2021-04-14 08:02:46 +00:00
Tri Vo
505b0e8991 rust: Switch rust_fuzz to HWASan
Bug: 180495975
Test: example_rust_fuzzer
Change-Id: I26e6f15136ee2d5f4ed1167be5c1c6a14b19421a
2021-04-13 15:58:44 -07:00
Ivan Lozano
c08897c1e4 Add more Rust vendor image support.
This adds Rust vendor image support for all module types except
Rust prebuilts.

Bug: 184042776
Test: New Soong tests.
Test: Example cc_library vendor module can depend on rust_ffi_shared.
Test: Example rust_library vendor-only module compiles.

Change-Id: Iaa30ad51fdaedcbf14687da5472581f6af62ff59
2021-04-13 13:17:12 -04:00
Ivan Lozano
699e218324 rust: Use new common image mutator interface.
Refactor rust to use and implement the new common image mutator
interface to handle future image mutations.

Bug: 184042776
Test: m nothing
Change-Id: If6a85e2b8c6a1969d62264eaea6c6b53cae9c039
2021-04-13 13:15:21 -04:00
Ivan Lozano
3a7d000d12 cc: Create a common image mutator interface
As part of adding Vendor support to Rust, refactor the image mutator in
CC to a new common image mutator interface so this logic can be reused
across both CC and Rust.

Bug: 184042776
Test: m nothing
Change-Id: Ia55d5ad840db7cf1a64d6c65ed86487230cb8742
2021-04-13 11:04:44 -04:00
Liz Kammer
9c2108667b rust_fuzzer: add toolchain libraries if non-empty
Test: bp2build
Test: m nothing
Fixes: 185163319
Change-Id: Id8b8e5b21b71f949fa8fa27f8c8cc4aba00c1f7d
2021-04-12 18:52:29 -04:00
Tri Vo
eed4716def Merge changes I46e851c8,I2c9eb248
* changes:
  rust: Add HWASan build support
  Export CC HWASan sanitizer type
2021-04-09 22:31:09 +00:00
Ivan Lozano
1285766d3b Merge "rust: Remove stack-depth sancov" 2021-04-09 21:56:51 +00:00
Tri Vo
0a74c3e06e rust: Add HWASan build support
HWASan for static Rust executables is not supported yet.

Bug: 180495975
Test: build local test app with HWASan
Change-Id: I46e851c82a16943586ec3a789f09a58651d036e3
2021-04-09 10:59:23 -07:00
Jeffrey Vander Stoep
3e2d4d419b Merge "Disable clippy::upper-case-acronyms" 2021-04-09 17:48:43 +00:00
Jeffrey Vander Stoep
e9fb49b555 Merge "Rust: use 1.51.0 prebuilts" 2021-04-09 17:48:43 +00:00
Ivan Lozano
20fcfdf489 rust: Remove stack-depth sancov
This flag causes a linkage error between rustc and our libclang_rt. We
can remove it for now and look into reintroducing it in the future.

We'd need to define 'thread_local uintptr_t __sancov_lowest_stack' to
support this. See https://reviews.llvm.org/D36839

Bug: 180495975
Test: m <fuzzer>
Change-Id: I95c9392307b5f20a0eda0fc76eb7ef79e27ae4df
2021-04-09 13:22:27 -04:00
Jiyong Park
a417f881bd Merge "Shared lib dependencies from rlib are included in APEX" 2021-04-08 23:31:28 +00:00
Thiébaud Weksteen
a8ccbaf1e8 Merge "rust: collect file dependencies for clippy" 2021-04-08 13:31:34 +00:00
Jiyong Park
94e22fd35e Shared lib dependencies from rlib are included in APEX
This change fixes a bug that shared lib dependencies of an rlib is not
installed to the APEX even when the rlib is part of the APEX.

Bug: N/A
Test: m
Change-Id: I88fe461584499839d8018d6b4292374592e7562b
2021-04-08 18:20:39 +09:00
Thiébaud Weksteen
e54504e19c Merge "rust: Add cfgs property" 2021-04-08 08:57:22 +00:00
Bram Bonné
2b9ee14ce0 Merge "Allow Rust code in system/logging/rust" 2021-04-08 07:47:45 +00:00
Jiyong Park
84894570e5 Merge "Stripped rust bin/libs are included in APEX" 2021-04-07 17:51:32 +00:00
Thiébaud Weksteen
94c8325261 rust: collect file dependencies for clippy
Previously, the clippy rule did not keep track of the source files for
which a modification would require the target to be rebuilt. Similarly
to the rustc rule, ensure that we capture all the dependencies via the
dep-info output.

Bug: 181298002
Test: m libkeystore2; inspect generated .clippy.d
Change-Id: Icfc7074e1fca38f7782544e6c436ffbfc6c9b4e0
2021-04-07 16:07:47 +02:00
Jiyong Park
e54f07e38a Stripped rust bin/libs are included in APEX
Previously, when a rust bin or library is selected for an APEX,
OutputFile() was used to get the file to be used. However, OutputFile()
always returns the unstripped output file even when the stripped output
file is available. As a result, APEX having a rust module was very big
due to the debugging information that exists in the unstripped file.

When a rust module is directly installed to the built-in partitions, we
use the stripped one whenever it's available. To make the same happen
when the rust module is placed in an APEX, OutputFile() is modified to
return the unstripped output if it's available.

Bug: 181751814
Test: TARGET_BUILD_APPS=com.android.virt m
The size is reduced from 180MB to 43MB

Change-Id: I6f8479e6a4794aac8bf94a84afdf65d417c75db0
2021-04-07 22:23:31 +09:00
Thiébaud Weksteen
c44e7372ed rust: Add cfgs property
Rust configuration options ("--cfg") are currently defined using the
"flags" property. Adds a specific property to be able to forward these
to the rust-analyzer configuration (rust-project.json).

Bug: 183727250
Test: m libstd
Change-Id: Ida89097814bcd1a45c02a8a79ec5a8e9e59701bd
2021-04-07 15:04:10 +02:00
Jakub Kotur
546ccd5614 Attach rust_benchmark to atest and tradefed.
Automatically generate required tradefed configs for rust benchmarks so
that they're available in atest.

Test: atest <module with rust_benchmark defined>
Bug: 155309706
Change-Id: I6002100367a66b6b0555614acc6cebb00dbf435d
2021-04-06 12:40:34 +02:00
Jakub Kotur
1d640d0521 Add rust_benchmark module to soong.
This commit adds rust_benchmark and rust_benchmark_host commands to
soong. Respectively running rust benchmarks on device and host. Currently
only criterion based benchmarks are supported and criterion library is
automatically linked.

Test: atest <module with rust_benchmark defined>
Bug: 155309706
Change-Id: I6edfc2b4bf30b1163fe59b8c2ecdcd4e7125e7b9
2021-04-06 12:40:32 +02:00
Treehugger Robot
8c56183fb7 Merge changes Id33bf640,I4d67b9b9
* changes:
  Don't use incorrect version names like VER or BOARD even in tests
  SdkSpec = Scope + ApiLevel
2021-04-06 03:18:16 +00:00
Joel Galenson
1301b5ccad Merge "Add system/core/libstats to the Rust allowed list." 2021-04-05 18:50:47 +00:00
Ivan Lozano
d235269392 Merge "rust: Update libfuzzer flags for rust_fuzz" 2021-04-05 15:05:00 +00:00
Jiyong Park
f58c46e36f Don't use incorrect version names like VER or BOARD even in tests
All version names will go through ApiLevelFromUser which triggers an
error when the name is not a valid one.

Bug: 175678607
Test: m
Change-Id: Id33bf64085603914d45ad7942cb8908a4734493f
2021-04-05 09:32:06 +09:00
Ivan Lozano
c044f5bce8 rust: Update libfuzzer flags for rust_fuzz
libfuzzer-sys uses different flags in the 0.4.0 update, so update the
flags for rust_fuzz modules to align.

Test: m <example_fuzzer>
Change-Id: I0a1eb140a7843fdaf5266c05a1ecf6d3964e0f5e
2021-04-02 12:43:28 -04:00
Paul Duffin
e6165d0f46 Merge "Convert remaining rust tests to use test fixtures" 2021-04-01 18:13:23 +00:00
Jeff Vander Stoep
0f36d16fee Disable clippy::upper-case-acronyms
Bug: 184269635
Test: TH
Change-Id: Ib941f9d625d1b8cfc395fd926ddf301e11fb0c4a
2021-04-01 19:40:37 +02:00
Paul Duffin
79abe57f53 Remove FixturePreparer.Extend()
Use GroupFixturePreparers instead.

Bug: 182885307
Test: m nothing
Change-Id: Idc01d3cc5a57576a4cf417e9105d1ab851126e10
2021-04-01 10:33:20 +01:00
Jeff Vander Stoep
60b2234c8d Rust: use 1.51.0 prebuilts
Test: TH
Change-Id: I11c10eda1e989db5084556ff248ff0d0fa85b98c
2021-03-31 11:35:35 +02:00
Paul Duffin
9e0c3f9993 Convert remaining rust tests to use test fixtures
Removes now unused CreateTestContext and stops exporting the
RegisterRequiredBuildComponentsForTest() method as it is only used
locally.

Bug: 181070625
Test: m nothing
Change-Id: Ia2fd3e090f975ee4c807da2c6c162ef3cf7ac446
2021-03-30 22:45:21 +01:00
Joel Galenson
f4b139abcd Add system/core/libstats to the Rust allowed list.
This is where the Rust statspull API will live.

Test: Build
Change-Id: Ia3cae85c576fa3caacd87395dc76069b26e134de
2021-03-30 13:40:43 -07:00
Bram Bonné
e45541d825 Allow Rust code in system/logging/rust
Bug: 162454083
Test: make logger
Change-Id: I1116b930af7e06be31c237867fecc6ccd609e4b3
2021-03-29 16:02:53 +02:00
Thiébaud Weksteen
785f378f7d Merge "rust: Add features list to rust_project.json" 2021-03-29 07:58:08 +00:00
Ivan Lozano
352bdf29b3 Merge "rust: Add whole_static_libs, revert static_lib" 2021-03-26 13:01:14 +00:00