Skip to content

Commit 5fe82a7

Browse files
authored
Rename out to out_diagnostics (#4341)
**What type of PR is this?** Refactor **What does this PR do? Why is it needed?** Follow-up to #4269 **Which issues(s) does this PR fix?** **Other notes for review**
1 parent fb90c46 commit 5fe82a7

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

go/private/actions/archive.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_d
6464
# nogo is a FilesToRunProvider and some targets don't have it, some have it but no executable.
6565
if nogo != None and nogo.executable != None:
6666
out_facts = go.declare_file(go, name = source.name, ext = pre_ext + ".facts")
67-
out_nogo = go.declare_directory(go, name = source.name, ext = pre_ext + "_nogo")
67+
out_diagnostics = go.declare_directory(go, name = source.name, ext = pre_ext + "_nogo")
6868
if validate_nogo(go):
6969
out_nogo_validation = go.declare_file(go, name = source.name, ext = pre_ext + ".nogo")
7070
else:
7171
out_nogo_validation = None
7272
else:
7373
out_facts = None
74-
out_nogo = None
74+
out_diagnostics = None
7575
out_nogo_validation = None
7676

7777
direct = source.deps
@@ -116,7 +116,7 @@ def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_d
116116
out_lib = out_lib,
117117
out_export = out_export,
118118
out_facts = out_facts,
119-
out_nogo = out_nogo,
119+
out_diagnostics = out_diagnostics,
120120
out_nogo_validation = out_nogo_validation,
121121
nogo = nogo,
122122
out_cgo_export_h = out_cgo_export_h,
@@ -145,7 +145,7 @@ def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_d
145145
out_lib = out_lib,
146146
out_export = out_export,
147147
out_facts = out_facts,
148-
out_nogo = out_nogo,
148+
out_diagnostics = out_diagnostics,
149149
out_nogo_validation = out_nogo_validation,
150150
nogo = nogo,
151151
gc_goopts = source.gc_goopts,
@@ -190,7 +190,7 @@ def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_d
190190
facts_file = out_facts,
191191
runfiles = source.runfiles,
192192
_validation_output = out_nogo_validation,
193-
_nogo_fix_output = out_nogo,
193+
_nogo_diagnostics = out_diagnostics,
194194
_cgo_deps = cgo_deps,
195195
)
196196
x_defs = dict(source.x_defs)

go/private/actions/compilepkg.bzl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def emit_compilepkg(
6868
out_lib = None,
6969
out_export = None,
7070
out_facts = None,
71-
out_nogo = None,
71+
out_diagnostics = None,
7272
out_nogo_validation = None,
7373
nogo = None,
7474
out_cgo_export_h = None,
@@ -85,8 +85,8 @@ def emit_compilepkg(
8585
have_nogo = nogo != None and nogo.executable != None
8686
if have_nogo != (out_facts != None):
8787
fail("nogo must be specified if and only if out_facts is specified", nogo)
88-
if have_nogo != (out_nogo != None):
89-
fail("nogo must be specified if and only if out_nogo is specified", nogo)
88+
if have_nogo != (out_diagnostics != None):
89+
fail("nogo must be specified if and only if out_diagnostics is specified", nogo)
9090

9191
if cover and go.coverdata:
9292
archives = archives + [go.coverdata]
@@ -215,7 +215,7 @@ def emit_compilepkg(
215215
sources = sources,
216216
cgo_go_srcs = cgo_go_srcs_for_nogo,
217217
archives = archives,
218-
out = out_nogo,
218+
out_diagnostics = out_diagnostics,
219219
out_facts = out_facts,
220220
out_validation = out_nogo_validation,
221221
nogo = nogo,
@@ -228,7 +228,7 @@ def _run_nogo(
228228
sources,
229229
cgo_go_srcs,
230230
archives,
231-
out,
231+
out_diagnostics,
232232
out_facts,
233233
out_validation,
234234
nogo):
@@ -239,7 +239,7 @@ def _run_nogo(
239239
[archive.data.facts_file for archive in archives if archive.data.facts_file] +
240240
[archive.data.export_file for archive in archives])
241241
inputs_transitive = [sdk.tools, sdk.headers, go.stdlib.libs]
242-
outputs = [out, out_facts]
242+
outputs = [out_diagnostics, out_facts]
243243

244244
nogo_args = go.tool_args(go)
245245
if cgo_go_srcs:
@@ -248,7 +248,7 @@ def _run_nogo(
248248

249249
nogo_args.add_all(archives, before_each = "-facts", map_each = _facts)
250250
nogo_args.add("-out_facts", out_facts)
251-
nogo_args.add_all("-out", [out], expand_directories = False)
251+
nogo_args.add_all("-out", [out_diagnostics], expand_directories = False)
252252
nogo_args.add("-nogo", nogo.executable)
253253

254254
# This action runs nogo and produces the facts files for downstream nogo actions.
@@ -278,10 +278,10 @@ def _run_nogo(
278278
validation_args = go.actions.args()
279279
validation_args.add("nogovalidation")
280280
validation_args.add(out_validation)
281-
validation_args.add_all([out], expand_directories = False)
281+
validation_args.add_all([out_diagnostics], expand_directories = False)
282282

283283
go.actions.run(
284-
inputs = [out],
284+
inputs = [out_diagnostics],
285285
outputs = [out_validation],
286286
mnemonic = "ValidateNogo",
287287
executable = go.toolchain._builder,

go/private/rules/binary.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ def _go_binary_impl(ctx):
152152
executable = executable,
153153
)
154154
validation_output = archive.data._validation_output
155-
nogo_fix_output = archive.data._nogo_fix_output
155+
nogo_diagnostics = archive.data._nogo_diagnostics
156156

157157
providers = [
158158
archive,
159159
OutputGroupInfo(
160160
cgo_exports = archive.cgo_exports,
161161
compilation_outputs = [archive.data.file],
162-
nogo_fix = [nogo_fix_output] if nogo_fix_output else [],
162+
nogo_fix = [nogo_diagnostics] if nogo_diagnostics else [],
163163
_validation = [validation_output] if validation_output else [],
164164
),
165165
]

go/private/rules/library.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _go_library_impl(ctx):
4949
go_info = new_go_info(go, ctx.attr)
5050
archive = go.archive(go, go_info)
5151
validation_output = archive.data._validation_output
52-
nogo_fix_output = archive.data._nogo_fix_output
52+
nogo_diagnostics = archive.data._nogo_diagnostics
5353

5454
return [
5555
go_info,
@@ -66,7 +66,7 @@ def _go_library_impl(ctx):
6666
OutputGroupInfo(
6767
cgo_exports = archive.cgo_exports,
6868
compilation_outputs = [archive.data.file],
69-
nogo_fix = [nogo_fix_output] if nogo_fix_output else [],
69+
nogo_fix = [nogo_diagnostics] if nogo_diagnostics else [],
7070
_validation = [validation_output] if validation_output else [],
7171
),
7272
]

go/private/rules/test.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _go_test_impl(ctx):
6969
)
7070

7171
validation_outputs = []
72-
nogo_fix_outputs = []
72+
nogo_diagnosticss = []
7373

7474
# Compile the library to test with internal white box tests
7575
internal_go_info = new_go_info(
@@ -80,8 +80,8 @@ def _go_test_impl(ctx):
8080
internal_archive = go.archive(go, internal_go_info)
8181
if internal_archive.data._validation_output:
8282
validation_outputs.append(internal_archive.data._validation_output)
83-
if internal_archive.data._nogo_fix_output:
84-
nogo_fix_outputs.append(internal_archive.data._nogo_fix_output)
83+
if internal_archive.data._nogo_diagnostics:
84+
nogo_diagnosticss.append(internal_archive.data._nogo_diagnostics)
8585
go_srcs = [src for src in internal_go_info.srcs if src.extension == "go"]
8686

8787
# Compile the library with the external black box tests
@@ -102,8 +102,8 @@ def _go_test_impl(ctx):
102102
external_archive = go.archive(go, external_go_info, is_external_pkg = True)
103103
if external_archive.data._validation_output:
104104
validation_outputs.append(external_archive.data._validation_output)
105-
if external_archive.data._nogo_fix_output:
106-
nogo_fix_outputs.append(external_archive.data._nogo_fix_output)
105+
if external_archive.data._nogo_diagnostics:
106+
nogo_diagnosticss.append(external_archive.data._nogo_diagnostics)
107107

108108
# now generate the main function
109109
repo_relative_rundir = ctx.attr.rundir or ctx.label.package or "."
@@ -218,7 +218,7 @@ def _go_test_impl(ctx):
218218
),
219219
OutputGroupInfo(
220220
compilation_outputs = [internal_archive.data.file],
221-
nogo_fix = nogo_fix_outputs,
221+
nogo_fix = nogo_diagnosticss,
222222
_validation = validation_outputs,
223223
),
224224
coverage_common.instrumented_files_info(

0 commit comments

Comments
 (0)