From a588d153c85485336e0509f475a4eec653be339b Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Fri, 16 Jun 2023 10:28:04 -0400 Subject: support sandboxed rust rules 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 --- rust/coverage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'rust/coverage.go') diff --git a/rust/coverage.go b/rust/coverage.go index 5216d6098..b312194f2 100644 --- a/rust/coverage.go +++ b/rust/coverage.go @@ -17,6 +17,7 @@ package rust import ( "github.com/google/blueprint" + "android/soong/android" "android/soong/cc" ) @@ -70,7 +71,10 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags // no_std modules are missing libprofiler_builtins which provides coverage, so we need to add it as a dependency. if rustModule, ok := ctx.Module().(*Module); ok && rustModule.compiler.noStdlibs() { profiler_builtins := ctx.GetDirectDepWithTag(ProfilerBuiltins, rlibDepTag).(*Module) - deps.RLibs = append(deps.RLibs, RustLibrary{Path: profiler_builtins.OutputFile().Path(), CrateName: profiler_builtins.CrateName()}) + deps.Rlibs = android.AddDirectToDepSet[RustLibrary](deps.Rlibs, RustLibrary{ + Path: profiler_builtins.OutputFile().Path(), + CrateName: profiler_builtins.CrateName(), + }) } if cc.EnableContinuousCoverage(ctx) { -- cgit v1.2.3-59-g8ed1b