add rust_toolchain_rustc_prebuilt module type

Sandboxing the rust rules requires having explicit inputs for the rust
toolchain. This module type makes the rustc prebuilt and its
dependencies explicit as a module that can be depended on by all rust
rules.

Bug: 286077158
Test: rust sandboxing topic + go test
Change-Id: If2b80b32e329e6a6ee11ba824de868cf04714553
This commit is contained in:
Sam Delmerico
2023-07-13 10:52:57 -04:00
parent 8d7f2e41d1
commit b45c844ce7
3 changed files with 50 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ package android
import "path/filepath"
func init() {
RegisterModuleType("prebuilt_build_tool", prebuiltBuildToolFactory)
RegisterModuleType("prebuilt_build_tool", NewPrebuiltBuildTool)
}
type prebuiltBuildToolProperties struct {
@@ -101,10 +101,6 @@ var _ HostToolProvider = &prebuiltBuildTool{}
// prebuilt_build_tool is to declare prebuilts to be used during the build, particularly for use
// in genrules with the "tools" property.
func prebuiltBuildToolFactory() Module {
return NewPrebuiltBuildTool()
}
func NewPrebuiltBuildTool() Module {
module := &prebuiltBuildTool{}
module.AddProperties(&module.properties)