diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyRuntimeInfo.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyRuntimeInfo.java index c3d02d53d14b69..2cb160f8fc0c1f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyRuntimeInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyRuntimeInfo.java @@ -286,13 +286,7 @@ public PyRuntimeInfo constructor( Artifact interpreter = interpreterUncast == NONE ? null : (Artifact) interpreterUncast; Artifact bootstrapTemplate = null; if (bootstrapTemplateUncast != NONE) { - if (bootstrapTemplateUncast instanceof InputFileConfiguredTarget) { - InputFileConfiguredTarget bootstrapTarget = (InputFileConfiguredTarget) bootstrapTemplateUncast; - bootstrapTemplate = bootstrapTarget.getArtifact(); - } else if (bootstrapTemplateUncast instanceof Artifact) { - // SourceArtifact, possibly only in tests? - bootstrapTemplate = (Artifact) bootstrapTemplateUncast; - } + bootstrapTemplate = (Artifact) bootstrapTemplateUncast; } Depset filesDepset = null; if (filesUncast != NONE) { diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/python/PyRuntimeInfoApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/python/PyRuntimeInfoApi.java index 16ba609dd8b30e..2196a221f21560 100644 --- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/python/PyRuntimeInfoApi.java +++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/python/PyRuntimeInfoApi.java @@ -217,9 +217,9 @@ interface PyRuntimeInfoProviderApi extends ProviderApi { + "."), @Param( name = "bootstrap_template", - // allowedTypes = { - // @ParamType(type = FileApi.class), - // }, + allowedTypes = { + @ParamType(type = FileApi.class), + }, positional = false, named = true, defaultValue = "None", diff --git a/src/main/starlark/builtins_bzl/common/python/py_runtime_rule.bzl b/src/main/starlark/builtins_bzl/common/python/py_runtime_rule.bzl index 81a7a374e011d4..48868f6d3f030e 100644 --- a/src/main/starlark/builtins_bzl/common/python/py_runtime_rule.bzl +++ b/src/main/starlark/builtins_bzl/common/python/py_runtime_rule.bzl @@ -75,7 +75,7 @@ def _py_runtime_impl(ctx): coverage_files = coverage_files, python_version = python_version, stub_shebang = ctx.attr.stub_shebang, - bootstrap_template = ctx.attr.bootstrap_template, + bootstrap_template = ctx.file.bootstrap_template, ), DefaultInfo( files = runtime_files,