Skip to content

Commit e8692c7

Browse files
committed
Preserve nogo runfiles
1 parent 54ba841 commit e8692c7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

go/private/actions/compilepkg.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

go/private/context.bzl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,10 @@ def _go_context_data_impl(ctx):
661661
print("WARNING: --features=race is no longer supported. Use --@io_bazel_rules_go//go/config:race instead.")
662662
if "msan" in ctx.features:
663663
print("WARNING: --features=msan is no longer supported. Use --@io_bazel_rules_go//go/config:msan instead.")
664-
nogo = ctx.files.nogo[0] if ctx.files.nogo else None
665664
providers = [
666665
GoContextInfo(
667666
coverdata = ctx.attr.coverdata[0][GoArchive],
668-
nogo = nogo,
667+
nogo = ctx.attr.nogo[DefaultInfo].files_to_run,
669668
),
670669
ctx.attr.stdlib[GoStdLib],
671670
ctx.attr.go_config[GoConfigInfo],

0 commit comments

Comments
 (0)