From 9a96ec22122e8cc7c7fe5928d38a3584b253d96f Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Wed, 20 Nov 2024 13:15:17 +0100 Subject: [PATCH] Use implicit Verilator lint log name Internal-tag: [#68242] Signed-off-by: Maciej Kurc --- verilator/defs.bzl | 17 +++++------------ verilator/tests/BUILD | 1 - 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/verilator/defs.bzl b/verilator/defs.bzl index 018881ab..e3d3511b 100644 --- a/verilator/defs.bzl +++ b/verilator/defs.bzl @@ -543,18 +543,14 @@ def _verilator_lint(ctx): args, vlog_srcs, vlog_hdrs, runfiles = _verilator_args(ctx, srcs, vopts) # Capture stderr to the log file + log_file = ctx.actions.declare_file(ctx.label.name + ".log") + args.add("--stderr") - if ctx.outputs.log: - args.add(ctx.outputs.log.path) - outputs = [ctx.outputs.log] - else: - log_file = ctx.actions.declare_file(ctx.label.name + ".log") - args.add(log_file.path) - outputs = [log_file] + args.add(log_file.path) # Run ctx.actions.run( - outputs = outputs, + outputs = [log_file], inputs = vlog_srcs + vlog_hdrs, tools = [verilator_toolchain.all_files, ctx.executable._run_wrapper], env = _verilator_toolchain_env(verilator_toolchain), @@ -565,16 +561,13 @@ def _verilator_lint(ctx): ) return DefaultInfo( - files = depset(outputs), + files = depset([log_file]), runfiles = ctx.runfiles(files = vlog_srcs + vlog_hdrs), ) verilator_lint = rule( implementation = _verilator_lint, attrs = { - "log": attr.output( - doc = "Name of the output log file. Defaults to '.log'", - ), "module": attr.label( doc = "The top level module target to verilate.", providers = [VerilogInfo], diff --git a/verilator/tests/BUILD b/verilator/tests/BUILD index 72059a33..3d0f1d51 100644 --- a/verilator/tests/BUILD +++ b/verilator/tests/BUILD @@ -174,7 +174,6 @@ verilator_run( verilator_lint( name = "nested_module_2_verilator_lint", - log = "lint.log", module = ":nested_module_2", vopts = [ "-Wall",