From 7ea20140f56d1c6a4fddf7b676acc5a930330abc Mon Sep 17 00:00:00 2001 From: yasiribmcon <107119183+yasiribmcon@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:26:01 +0530 Subject: [PATCH 1/2] Include grunning for s390x. PR https://github.com/cockroachdb/cockroach/pull/95291 excluded grunning from s390x as patched Go runtime was not available. Since we can refer go patch at https://github.com/cockroachdb/cockroach/blob/master/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch, we can manually patch go runtime for s390x so that grunning works for s390x. Hence enabling back this library for s390x. --- pkg/util/grunning/BUILD.bazel | 2 ++ pkg/util/grunning/disabled.go | 4 ++-- pkg/util/grunning/disabled_test.go | 4 ++-- pkg/util/grunning/enabled.go | 3 +-- pkg/util/grunning/enabled_test.go | 3 +-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/util/grunning/BUILD.bazel b/pkg/util/grunning/BUILD.bazel index a3f56d7f2255..a4c6f0cae5e2 100644 --- a/pkg/util/grunning/BUILD.bazel +++ b/pkg/util/grunning/BUILD.bazel @@ -194,6 +194,8 @@ go_test( ], "@io_bazel_rules_go//go/platform:linux_s390x": [ ":grunning", + "//pkg/testutils/skip", + "//pkg/util/syncutil", "@com_github_stretchr_testify//require", ], "@io_bazel_rules_go//go/platform:netbsd_386": [ diff --git a/pkg/util/grunning/disabled.go b/pkg/util/grunning/disabled.go index f175eb28af82..3db06438f689 100644 --- a/pkg/util/grunning/disabled.go +++ b/pkg/util/grunning/disabled.go @@ -10,8 +10,8 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build (linux && s390x) || !bazel -// +build linux,s390x !bazel +//go:build !bazel +// +build !bazel package grunning diff --git a/pkg/util/grunning/disabled_test.go b/pkg/util/grunning/disabled_test.go index d434762c27c3..a34ae391108c 100644 --- a/pkg/util/grunning/disabled_test.go +++ b/pkg/util/grunning/disabled_test.go @@ -10,8 +10,8 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build (linux && s390x) || !bazel -// +build linux,s390x !bazel +//go:build !bazel +// +build !bazel package grunning_test diff --git a/pkg/util/grunning/enabled.go b/pkg/util/grunning/enabled.go index f8cd1b5b13db..d41da7893d46 100644 --- a/pkg/util/grunning/enabled.go +++ b/pkg/util/grunning/enabled.go @@ -10,8 +10,7 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build !((linux && s390x) || !bazel) -// +build !linux !s390x +//go:build bazel // +build bazel package grunning diff --git a/pkg/util/grunning/enabled_test.go b/pkg/util/grunning/enabled_test.go index 89076af80c2b..dbc766cdb758 100644 --- a/pkg/util/grunning/enabled_test.go +++ b/pkg/util/grunning/enabled_test.go @@ -10,8 +10,7 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build !((linux && s390x) || !bazel) -// +build !linux !s390x +//go:build bazel // +build bazel package grunning_test From 0b3a803d398ddd0364a87e46ceae4285f88a3464 Mon Sep 17 00:00:00 2001 From: yasiribmcon Date: Sat, 27 Jul 2024 08:28:53 +0000 Subject: [PATCH 2/2] Cleanup of grunning BUILD.bazel Ran "bazel run :gazelle" command after which "pkg/util/grunning/BUILD.bazel" got updated. --- pkg/util/grunning/BUILD.bazel | 289 +--------------------------------- 1 file changed, 6 insertions(+), 283 deletions(-) diff --git a/pkg/util/grunning/BUILD.bazel b/pkg/util/grunning/BUILD.bazel index a4c6f0cae5e2..86eb3ed85ee1 100644 --- a/pkg/util/grunning/BUILD.bazel +++ b/pkg/util/grunning/BUILD.bazel @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "grunning", srcs = [ - "disabled.go", "enabled.go", "grunning.go", ], @@ -13,287 +12,11 @@ go_library( go_test( name = "grunning_test", - srcs = [ - "disabled_test.go", - "enabled_test.go", + srcs = ["enabled_test.go"], + deps = [ + ":grunning", + "//pkg/testutils/skip", + "//pkg/util/syncutil", + "@com_github_stretchr_testify//require", ], - deps = select({ - "@io_bazel_rules_go//go/platform:aix_ppc64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:android_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:android_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:android_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:android_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:darwin_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:darwin_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:darwin_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:darwin_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:dragonfly_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:freebsd_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:freebsd_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:freebsd_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:freebsd_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:illumos_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:ios_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:ios_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:js_wasm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_mips": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_mips64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_mips64le": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_mipsle": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_ppc64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_ppc64le": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_riscv64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:linux_s390x": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:netbsd_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:netbsd_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:netbsd_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:netbsd_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:openbsd_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:openbsd_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:openbsd_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:openbsd_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:plan9_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:plan9_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:plan9_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:solaris_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:windows_386": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:windows_amd64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:windows_arm": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "@io_bazel_rules_go//go/platform:windows_arm64": [ - ":grunning", - "//pkg/testutils/skip", - "//pkg/util/syncutil", - "@com_github_stretchr_testify//require", - ], - "//conditions:default": [], - }), )