@@ -83,9 +83,9 @@ def emit_compilepkg(
8383 if out_lib == None :
8484 fail ("out_lib is a required parameter" )
8585
86- have_nogo = nogo != None
86+ have_nogo = nogo != None and nogo . executable != None
8787 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 )
8989 if have_nogo != (out_nogo_log != None ):
9090 fail ("nogo must be specified if and only if out_nogo_log is specified" )
9191 if have_nogo != (out_nogo_validation != None ):
@@ -213,7 +213,7 @@ def emit_compilepkg(
213213 execution_requirements = execution_requirements ,
214214 )
215215
216- if nogo :
216+ if have_nogo :
217217 _run_nogo (
218218 go ,
219219 shared_args = shared_args ,
@@ -242,7 +242,7 @@ def _run_nogo(
242242 """Runs nogo on Go source files, including those generated by cgo."""
243243 sdk = go .sdk
244244
245- inputs_direct = (sources + [nogo , sdk .package_list ] +
245+ inputs_direct = (sources + [sdk .package_list ] +
246246 [archive .data .facts_file for archive in archives if archive .data .facts_file ] +
247247 [archive .data .export_file for archive in archives ])
248248 inputs_transitive = [sdk .tools , sdk .headers , go .stdlib .libs ]
@@ -257,7 +257,7 @@ def _run_nogo(
257257 nogo_args .add ("-out_facts" , out_facts )
258258 nogo_args .add ("-out_log" , out_log )
259259 nogo_args .add ("-out_fix" , out_fix )
260- nogo_args .add ("-nogo" , nogo )
260+ nogo_args .add ("-nogo" , nogo . executable )
261261
262262 # This action runs nogo and produces the facts files for downstream nogo actions.
263263 # It is important that this action doesn't fail if nogo produces findings, which allows users
@@ -268,6 +268,7 @@ def _run_nogo(
268268 # on findings to get the same debugging experience as with other failures.
269269 go .actions .run (
270270 inputs = depset (inputs_direct , transitive = inputs_transitive ),
271+ tools = [nogo ],
271272 outputs = outputs ,
272273 mnemonic = "RunNogo" ,
273274 executable = go .toolchain ._builder ,
0 commit comments