Merge changes from topics "revert-2746976-revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT-KMAGKVIXAT", "sandbox-rust-inputs" into main

* changes:
  support sandboxed rust rules
  conditionally escape rule builder command
  Revert^2 "allow Ninja variables in RuleBuilder API"
  Revert^2 "add crate_root property to rust modules"
  Revert^2 "add rust_toolchain_rustc_prebuilt module type"
This commit is contained in:
Sam Delmerico
2023-09-20 18:48:21 +00:00
committed by Gerrit Code Review
32 changed files with 1620 additions and 424 deletions

View File

@@ -35,6 +35,7 @@ func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
multitree.RegisterApiImportsModule(ctx)
ctx.RegisterModuleType("prebuilt_build_tool", android.NewPrebuiltBuildTool)
ctx.RegisterModuleType("cc_benchmark", BenchmarkFactory)
ctx.RegisterModuleType("cc_object", ObjectFactory)
ctx.RegisterModuleType("cc_genrule", GenRuleFactory)
@@ -67,6 +68,26 @@ func GatherRequiredDepsForTest(oses ...android.OsType) string {
func commonDefaultModules() string {
return `
prebuilt_build_tool {
name: "clang++",
src: "bin/clang++",
}
prebuilt_build_tool {
name: "clang++.real",
src: "bin/clang++.real",
}
prebuilt_build_tool {
name: "lld",
src: "bin/lld",
}
prebuilt_build_tool {
name: "ld.lld",
src: "bin/ld.lld",
}
prebuilt_build_tool {
name: "llvm-ar",
src: "bin/llvm-ar",
}
cc_defaults {
name: "toolchain_libs_defaults",
host_supported: true,
@@ -568,6 +589,12 @@ var PrepareForTestWithCcDefaultModules = android.GroupFixturePreparers(
// Additional files needed in tests that disallow non-existent source.
android.MockFS{
"defaults/cc/common/bin/clang++": nil,
"defaults/cc/common/bin/clang++.real": nil,
"defaults/cc/common/bin/lld": nil,
"defaults/cc/common/bin/ld.lld": nil,
"defaults/cc/common/bin/llvm-ar": nil,
"defaults/cc/common/libc.map.txt": nil,
"defaults/cc/common/libdl.map.txt": nil,
"defaults/cc/common/libm.map.txt": nil,