aboutsummaryrefslogtreecommitdiff
path: root/rust/coverage_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Split Rust crate builds into compile and link phases."Colin Cross2023-10-021-13/+9
| | | | | | | | | | | | | This reverts commit e7c71c344d462cac998b37d551bd78baa892082d. The intermediates created by the separated rust compile steps are very large, on the order of 60GB. This is more than CI can support for now, revert the split into compile and link phases. This comes at the expense of incremental build time, especially when modifying C/C++ sources that are dependencies of rust modules. Bug: 293349612 Test: builds Change-Id: I81169e7d0727330c8de5e7688dcdc87fe7b8d3b5
* Revert "support sandboxed rust rules"Wen-yi Chu2023-09-221-23/+23
| | | | | | | | | | Revert submission 2629131-sandbox-rust-inputs Reason for revert: Fail on android build. Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs Change-Id: Ifd9aa46e80a12d8f4ffa0a2daa74b96727cbb7e6
* support sandboxed rust rulesSam Delmerico2023-09-151-23/+23
| | | | | | | | | | | This commit adds support for compiling rust rules inside the sbox sandbox. To compile a rust module with sandboxing enabled, the entry point to the crate must be specified via the `crate_root` property, and all input sources and compile-time data must be specified via the `srcs` and `compile_data` properties. Bug: 286077158 Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
* Split Rust crate builds into compile and link phases.Peter Collingbourne2023-04-121-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [rust/coverage] Use new flag for coverage instrumentationPirama Arumuga Nainar2022-06-071-1/+1
| | | | | | | | | > warning: `-Z instrument-coverage` is deprecated; use `-C instrument-coverage` Test: above warning is absent when running: $ m CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS=* rust Change-Id: I8687c04534db3c8a67f209b93ed13d54c2f86dc8
* [rust] [coverage] Don't pass -C link-dead-codePirama Arumuga Nainar2021-08-041-1/+1
| | | | | | | | | | Bug: http://b/186873963 Per jgalenson@, this was added for GCOV and is not needed for clang coverage. Test: http://go/abtd/run/L71000000950546158 Change-Id: I352669687cbe764d938acb94d9d4fe0c24a31a56
* Migrate Rust to LLVM coverage.Joel Galenson2021-01-151-81/+4
| | | | | | Bug: 177675913 Test: Manually compile, run, and see output with llvm-cov. Change-Id: I66729cff87a848782e9fa1b95cbbc06318c5761a
* rust: Fix incorrect expected gcno file for dylibsIvan Lozano2020-11-171-1/+1
| | | | | | | | | | | | | | | For Rust dylibs we generate a file suffix of .dylib.so. rustc seems to split the output filename for the gcno file at the first '.', so instead of libfoo.dylib.gcno (which our build system expects), it produces libfoo.gcno. This fixes the mismatch so the build system can find the gcno file that gets produced for Rust dylibs. Bug: 170983066 Test: CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS=external/rust/crates \ m libandroid_log_sys Change-Id: Icba48bf10ab06c255bd17053d57feb889b1f9ee5
* Revert "Make lots of tests run in parallel"Colin Cross2020-10-091-3/+0
| | | | | | | | | | This reverts commit 323dc60712491c71ccdc5363c42df61f0a192487. Reason for revert: Possible cause of test instability Bug: 170513220 Test: soong tests Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
* Make lots of tests run in parallelColin Cross2020-10-061-0/+3
| | | | | | | | | | Putting t.Parallel() in each test makes them run in parallel. Additional t.Parallel() could be added to each subtest, although that requires making a local copy of the loop variable for table driven tests. Test: m checkbuild Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
* rust: Add libstd linkage mutator for rlibs.Ivan Lozano2020-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | The current state of linkage is that device targets always link libstd dynamically except for rust_ffi_static which requires a static libstd linkage. However this prevents producing rust_ffi_static modules which depend on other Rust libraries as those dependencies will link libstd dynamically and cause a collision. We also want our rust_test modules to statically link in libstd as well. This adds a linkage mutator for rlibs that creates a variant for each libstd linkage. Dependent modules can then select the variant that matches their linkage of libstd. Also fixes an issue where installation paths were being generated for rlibs and static libs even though they weren't being installed. This broke when adding the linkage mutator as Make would complain about multiple targets producing the same output. Bug: 168729404 Test: rust_ffi_static module with other rustlib dependency can be built. Change-Id: I955b484bf5809e8fc5517750c7f8df82d3ca8895
* Migrate away from removed optionJoel Galenson2020-08-251-1/+1
| | | | | | | | | | Upstream removed the -Z no-landing-pads option in https://github.com/rust-lang/rust/pull/70175, which we picked up in our latest toolchain update. Fixes: 166317885 Test: Build and TreeHugger Change-Id: I51c0ef671bf6a334b2b7223da42cab547e4407d3
* rust: Change default variantsMatthew Maurer2020-07-011-6/+12
| | | | | | | | | | | | | rust_library now produces only rlib and dylib variants. rust_library_foreign now produces static and shared variants. This change was made because both are common cases, but all four together essentially never happens. This allows us to have fewer repeat module definitions. Bug: 143217452 Test: cd external/rust; mma Change-Id: Iaf69e8da38f7c12710331c51464699cf7cbbb656
* Add gcov coverage support to Rust modules.Ivan Lozano2020-05-051-0/+181
This adds gcov coverage support for Rust device library and binary modules (including test modules). Support is provided to pass Rust static library gcno files to CC modules and visa versa. Additional changes: * Begin mutator added for Rust modules. * SuffixInList added to android package. * CoverageEnabled added to Coverage interface. * CoverageFiles added to LinkableLibrary interface. * Fix in coverage mutator for non-CC modules which marked the wrong variant as the coverage variant. * Added coverage libraries to the cc.GatherRequiredDepsForTest. Bug: 146448203 Test: NATIVE_COVERAGE=true COVERAGE_PATHS='*' m -j <rust_module> Change-Id: If20728bdde42a1dd544a35a40f0d981b80a5835f