From 2dc6308732ceec7d05d33191f33a9baac226de19 Mon Sep 17 00:00:00 2001 From: Grzegorz Lukasik <32371993+hauserx@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:33:36 +0100 Subject: [PATCH] chore: removed some unused vars (#4175) Removed some unused vars pointed by https://github.com/cameron-martin/bazel-lsp (on not yet merged version). **What type of PR is this?** Cleanup --- go/private/rules/cross.bzl | 1 - go/private/rules/test.bzl | 1 - go/private/rules/transition.bzl | 2 -- go/private/sdk.bzl | 1 - proto/def.bzl | 2 -- tests/core/go_proto_library_importpath/BUILD.bazel | 2 +- 6 files changed, 1 insertion(+), 8 deletions(-) diff --git a/go/private/rules/cross.bzl b/go/private/rules/cross.bzl index ff7ef63c18..1d9e32a325 100644 --- a/go/private/rules/cross.bzl +++ b/go/private/rules/cross.bzl @@ -52,7 +52,6 @@ def _go_cross_impl(ctx): old_default_info = ctx.attr.target[DefaultInfo] old_executable = old_default_info.files_to_run.executable - new_default_info = None if old_executable: # Bazel requires executable rules to created the executable themselves, # so we create a symlink in this rule so that it appears this rule created its executable. diff --git a/go/private/rules/test.bzl b/go/private/rules/test.bzl index 744ec6062d..32b110f8d8 100644 --- a/go/private/rules/test.bzl +++ b/go/private/rules/test.bzl @@ -656,7 +656,6 @@ def _recompile_external_deps(go, external_source, internal_archive, library_labe i = 0 for label in dep_list: i += 1 - recompile_suffix = ".recompile%d" % i # If this library is the internal archive, use the recompiled version. if label == internal_archive.data.label: diff --git a/go/private/rules/transition.bzl b/go/private/rules/transition.bzl index e38245c95f..bd9f2d39ec 100644 --- a/go/private/rules/transition.bzl +++ b/go/private/rules/transition.bzl @@ -87,9 +87,7 @@ def _go_transition_impl(settings, attr): pure = "off" settings["//go/config:pure"] = False if pure == "on": - race = "off" settings["//go/config:race"] = False - msan = "off" settings["//go/config:msan"] = False cgo = pure == "off" diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl index 486919d7f0..5ec55a4768 100644 --- a/go/private/sdk.bzl +++ b/go/private/sdk.bzl @@ -546,7 +546,6 @@ def detect_host_platform(ctx): return goos, goarch def _detect_host_sdk(ctx): - root = "@invalid@" if "GOROOT" in ctx.os.environ: return ctx.os.environ["GOROOT"] res = ctx.execute([executable_path(ctx, "go"), "env", "GOROOT"]) diff --git a/proto/def.bzl b/proto/def.bzl index 531a46826c..0964c842ee 100644 --- a/proto/def.bzl +++ b/proto/def.bzl @@ -43,8 +43,6 @@ load( GoProtoImports = provider() def get_imports(attr, importpath): - proto_deps = [] - # ctx.attr.proto is a one-element array since there is a Starlark transition attached to it. if hasattr(attr, "proto") and attr.proto and types.is_list(attr.proto) and ProtoInfo in attr.proto[0]: proto_deps = [attr.proto[0]] diff --git a/tests/core/go_proto_library_importpath/BUILD.bazel b/tests/core/go_proto_library_importpath/BUILD.bazel index 90fdbfc7f6..2596e81530 100644 --- a/tests/core/go_proto_library_importpath/BUILD.bazel +++ b/tests/core/go_proto_library_importpath/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@io_bazel_rules_go//go:def.bzl", "go_test") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library")