Skip to content

Commit

Permalink
ctx.attr => ctx.file fixes so many things
Browse files Browse the repository at this point in the history
  • Loading branch information
fahhem committed Nov 30, 2022
1 parent 3e23cf1 commit 9dc72d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ interface PyRuntimeInfoProviderApi extends ProviderApi {
+ "</code>."),
@Param(
name = "bootstrap_template",
// allowedTypes = {
// @ParamType(type = FileApi.class),
// },
allowedTypes = {
@ParamType(type = FileApi.class),
},
positional = false,
named = true,
defaultValue = "None",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9dc72d6

Please sign in to comment.