Remove GetPythonBinary request type

This has been dead code for over a year.

Fixes: 232976601
Test: m nothing
Change-Id: Ida305fc8fa61d8ac83d74ea2cf007073a0019cec
This commit is contained in:
Chris Parsons
2023-05-23 17:55:47 +00:00
committed by Christopher Parsons
parent a2244043ea
commit 6b49888a17
3 changed files with 0 additions and 81 deletions

View File

@@ -8,7 +8,6 @@ import (
var (
GetOutputFiles = &getOutputFilesRequestType{}
GetPythonBinary = &getPythonBinaryRequestType{}
GetCcInfo = &getCcInfoType{}
GetApexInfo = &getApexInfoType{}
GetCcUnstrippedInfo = &getCcUnstrippedInfoType{}
@@ -45,8 +44,6 @@ type CcInfo struct {
type getOutputFilesRequestType struct{}
type getPythonBinaryRequestType struct{}
// Name returns a string name for this request type. Such request type names must be unique,
// and must only consist of alphanumeric characters.
func (g getOutputFilesRequestType) Name() string {
@@ -72,31 +69,6 @@ func (g getOutputFilesRequestType) ParseResult(rawString string) []string {
return splitOrEmpty(rawString, ", ")
}
// Name returns a string name for this request type. Such request type names must be unique,
// and must only consist of alphanumeric characters.
func (g getPythonBinaryRequestType) Name() string {
return "getPythonBinary"
}
// StarlarkFunctionBody returns a starlark function body to process this request type.
// The returned string is the body of a Starlark function which obtains
// all request-relevant information about a target and returns a string containing
// this information.
// The function should have the following properties:
// - The arguments are `target` (a configured target) and `id_string` (the label + configuration).
// - The return value must be a string.
// - The function body should not be indented outside of its own scope.
func (g getPythonBinaryRequestType) StarlarkFunctionBody() string {
return "return providers(target)['FilesToRunProvider'].executable.path"
}
// ParseResult returns a value obtained by parsing the result of the request's Starlark function.
// The given rawString must correspond to the string output which was created by evaluating the
// Starlark given in StarlarkFunctionBody.
func (g getPythonBinaryRequestType) ParseResult(rawString string) string {
return rawString
}
type getCcInfoType struct{}
// Name returns a string name for this request type. Such request type names must be unique,

View File

@@ -40,34 +40,6 @@ func TestGetOutputFilesParseResults(t *testing.T) {
}
}
func TestGetPythonBinaryParseResults(t *testing.T) {
t.Parallel()
testCases := []struct {
description string
input string
expectedOutput string
}{
{
description: "no result",
input: "",
expectedOutput: "",
},
{
description: "one result",
input: "test",
expectedOutput: "test",
},
}
for _, tc := range testCases {
t.Run(tc.description, func(t *testing.T) {
actualOutput := GetPythonBinary.ParseResult(tc.input)
if !reflect.DeepEqual(tc.expectedOutput, actualOutput) {
t.Errorf("expected %#v != actual %#v", tc.expectedOutput, actualOutput)
}
})
}
}
func TestGetCcInfoParseResults(t *testing.T) {
t.Parallel()
testCases := []struct {