Skip to content

Commit

Permalink
Tweak nogo archive handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky committed Aug 10, 2024
1 parent dfbf8b1 commit 4e57bc9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions go/private/rules/nogo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ load(
"EXPORT_PATH",
"GoArchive",
"GoLibrary",
"get_archive",
)
load(
"//go/private/rules:transition.bzl",
Expand All @@ -47,9 +46,8 @@ def _nogo_impl(ctx):
if ctx.attr.debug:
nogo_args.add("-debug")
nogo_inputs = []
analyzer_archives = [get_archive(dep) for dep in ctx.attr.deps]
analyzer_importpaths = [archive.data.importpath for archive in analyzer_archives]
nogo_args.add_all(analyzer_importpaths, before_each = "-analyzer_importpath")
for dep in ctx.attr.deps:
nogo_args.add("-analyzer_importpath", dep[GoArchive].data.importpath)
if ctx.file.config:
nogo_args.add("-config", ctx.file.config)
nogo_inputs.append(ctx.file.config)
Expand All @@ -76,7 +74,7 @@ def _nogo_impl(ctx):
nogo_source = go.library_to_source(go, struct(
srcs = [struct(files = [nogo_main])],
embed = [ctx.attr._nogo_srcs],
deps = analyzer_archives,
deps = ctx.attr.deps,
), nogo_library, False)
_, executable, runfiles = go.binary(
go,
Expand Down

0 comments on commit 4e57bc9

Please sign in to comment.