Skip to content

Commit 33e760b

Browse files
authored
Merge pull request hdl#306 from tjgq/patch-1
Remove uses of ctx.resolve_tools(...).
2 parents 0ecf32f + 74cbcc6 commit 33e760b

File tree

6 files changed

+6
-24
lines changed

6 files changed

+6
-24
lines changed

dependency_support/org_theopenroadproject/tcl_encode.bzl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ def _tcl_encode_impl(ctx):
2323
outfile_name = ctx.attr.out if ctx.attr.out else ctx.attr.name + ".cc"
2424
output_file = ctx.actions.declare_file(outfile_name)
2525

26-
(inputs, _) = ctx.resolve_tools(tools = [ctx.attr._tclsh, ctx.attr._encode_script])
27-
2826
args = ctx.actions.args()
2927
args.add(ctx.file._encode_script)
3028
args.add(output_file)
@@ -35,7 +33,7 @@ def _tcl_encode_impl(ctx):
3533
outputs = [output_file],
3634
inputs = ctx.files.srcs,
3735
arguments = [args],
38-
tools = inputs,
36+
tools = [ctx.executable._tclsh, ctx.file._encode_script],
3937
executable = ([file for file in ctx.files._tclsh if file.basename == "tclsh"][0]),
4038
)
4139
return [DefaultInfo(files = depset([output_file]))]
@@ -61,7 +59,7 @@ tcl_encode = rule(
6159
),
6260
"_tclsh": attr.label(
6361
default = "@tk_tcl//:tclsh",
64-
allow_files = True,
62+
executable = True,
6563
cfg = "exec",
6664
),
6765
},

dependency_support/org_theopenroadproject/tcl_wrap_cc.bzl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ def _tcl_wrap_cc_impl(ctx):
5656
outfile_name = ctx.attr.out if ctx.attr.out else ctx.attr.name + ".cc"
5757
output_file = ctx.actions.declare_file(outfile_name)
5858

59-
(inputs, _) = ctx.resolve_tools(tools = [ctx.attr._swig])
60-
6159
include_root_directory = root_label.workspace_root + "/" + root_label.package
6260

6361
src_inputs = _get_transative_srcs(ctx.files.srcs + ctx.files.root_swig_src, ctx.attr.deps)
@@ -87,7 +85,7 @@ def _tcl_wrap_cc_impl(ctx):
8785
outputs = [output_file],
8886
inputs = src_inputs,
8987
arguments = [args],
90-
tools = inputs,
88+
tools = ctx.files._swig,
9189
executable = ([file for file in ctx.files._swig if file.basename == "swig"][0]),
9290
)
9391
return [

flows/flows.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ flow_binary = rule(
169169
)
170170

171171
def _run_step_with_inputs(ctx, step, inputs_dict, outputs_step_dict):
172-
# inputs and output manifests are for the runfiles of the step executable.
173-
(tool_inputs, input_manifests) = ctx.resolve_tools(tools = [step])
174-
175172
# The inputs_env and inputs handle the named inputs of the step.
176173
inputs = []
177174
inputs_env = {}
@@ -208,11 +205,10 @@ def _run_step_with_inputs(ctx, step, inputs_dict, outputs_step_dict):
208205
outputs = outputs,
209206
inputs = inputs,
210207
command = step[DefaultInfo].files_to_run.executable.path,
211-
tools = tool_inputs,
208+
tools = [step.files_to_run],
212209
arguments = step[FlowStepInfo].arguments,
213210
mnemonic = step[FlowStepInfo].executable_type,
214211
env = dicts.add(constants_env, inputs_env, outputs_env),
215-
input_manifests = input_manifests,
216212
toolchain = None,
217213
)
218214

place_and_route/open_road.bzl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ def openroad_command(ctx, commands, input_db = None, step_name = None, inputs =
229229
command_file = ctx.actions.declare_file(file_name)
230230
ctx.actions.write(command_file, content = "\n".join(real_commands))
231231

232-
(tool_inputs, input_manifests) = ctx.resolve_tools(tools = [ctx.attr._openroad])
233232
openroad_runfiles_dir = ctx.executable._openroad.path + ".runfiles"
234233

235234
log_file = ctx.actions.declare_file(
@@ -253,8 +252,6 @@ def openroad_command(ctx, commands, input_db = None, step_name = None, inputs =
253252
command_file.path,
254253
],
255254
executable = ctx.executable._openroad,
256-
tools = tool_inputs,
257-
input_manifests = input_manifests,
258255
env = {
259256
"QT_QPA_PLATFORM": ctx.attr.qt_qpa_platform,
260257
"TCL_LIBRARY": openroad_runfiles_dir + "/tk_tcl/library",

static_timing/build_defs.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def _run_opensta_impl(ctx):
3434
if default_liberty_file in additional_liberty_files:
3535
additional_liberty_files.remove(default_liberty_file)
3636

37-
(tool_inputs, input_manifests) = ctx.resolve_tools(tools = [ctx.attr._opensta])
3837
opensta_runfiles_dir = ctx.executable._opensta.path + ".runfiles"
3938

4039
sta_tcl = ctx.file.sta_tcl
@@ -51,11 +50,9 @@ def _run_opensta_impl(ctx):
5150

5251
ctx.actions.run(
5352
outputs = [sta_log],
54-
inputs = tool_inputs.to_list() + [default_liberty_file, sta_tcl, netlist] + additional_liberty_files,
53+
inputs = [default_liberty_file, sta_tcl, netlist] + additional_liberty_files,
5554
arguments = ["-exit", sta_tcl.path],
5655
executable = ctx.executable._opensta,
57-
tools = tool_inputs,
58-
input_manifests = input_manifests,
5956
env = env,
6057
mnemonic = "RunningSTA",
6158
toolchain = None,

synthesis/build_defs.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ def _synthesize_design_impl(ctx):
108108
inputs.append(default_liberty_file)
109109
inputs.extend(additional_liberty_files)
110110

111-
(tool_inputs, input_manifests) = ctx.resolve_tools(tools = [ctx.attr.yosys_tool])
112-
113111
yosys_runfiles_dir = ctx.executable.yosys_tool.path + ".runfiles"
114112

115113
log_file = ctx.actions.declare_file("{}_yosys_output.log".format(ctx.attr.name))
@@ -180,11 +178,9 @@ def _synthesize_design_impl(ctx):
180178

181179
ctx.actions.run(
182180
outputs = [output_file, log_file],
183-
inputs = inputs + tool_inputs.to_list(),
181+
inputs = inputs,
184182
arguments = [args],
185183
executable = ctx.executable.yosys_tool,
186-
tools = tool_inputs,
187-
input_manifests = input_manifests,
188184
env = env,
189185
mnemonic = "SynthesizingRTL",
190186
toolchain = None,

0 commit comments

Comments
 (0)