@@ -83,9 +83,9 @@ def emit_compilepkg(
83
83
if out_lib == None :
84
84
fail ("out_lib is a required parameter" )
85
85
86
- have_nogo = nogo != None
86
+ have_nogo = nogo != None and nogo . executable != None
87
87
if have_nogo != (out_facts != None ):
88
- fail ("nogo must be specified if and only if out_facts is specified" )
88
+ fail ("nogo must be specified if and only if out_facts is specified" , nogo )
89
89
if have_nogo != (out_nogo_log != None ):
90
90
fail ("nogo must be specified if and only if out_nogo_log is specified" )
91
91
if have_nogo != (out_nogo_validation != None ):
@@ -213,7 +213,7 @@ def emit_compilepkg(
213
213
execution_requirements = execution_requirements ,
214
214
)
215
215
216
- if nogo :
216
+ if have_nogo :
217
217
_run_nogo (
218
218
go ,
219
219
shared_args = shared_args ,
@@ -242,7 +242,7 @@ def _run_nogo(
242
242
"""Runs nogo on Go source files, including those generated by cgo."""
243
243
sdk = go .sdk
244
244
245
- inputs_direct = (sources + [nogo , sdk .package_list ] +
245
+ inputs_direct = (sources + [sdk .package_list ] +
246
246
[archive .data .facts_file for archive in archives if archive .data .facts_file ] +
247
247
[archive .data .export_file for archive in archives ])
248
248
inputs_transitive = [sdk .tools , sdk .headers , go .stdlib .libs ]
@@ -257,7 +257,7 @@ def _run_nogo(
257
257
nogo_args .add ("-out_facts" , out_facts )
258
258
nogo_args .add ("-out_log" , out_log )
259
259
nogo_args .add ("-out_fix" , out_fix )
260
- nogo_args .add ("-nogo" , nogo )
260
+ nogo_args .add ("-nogo" , nogo . executable )
261
261
262
262
# This action runs nogo and produces the facts files for downstream nogo actions.
263
263
# It is important that this action doesn't fail if nogo produces findings, which allows users
@@ -268,6 +268,7 @@ def _run_nogo(
268
268
# on findings to get the same debugging experience as with other failures.
269
269
go .actions .run (
270
270
inputs = depset (inputs_direct , transitive = inputs_transitive ),
271
+ tools = [nogo ],
271
272
outputs = outputs ,
272
273
mnemonic = "RunNogo" ,
273
274
executable = go .toolchain ._builder ,
0 commit comments