treewide: add race-detector config

This also disables all `pure = "on"` attributes as they propagate too
far and break the race detector because rules_go contradicts itself by
forcing pure go even when CGO is required by the race detector. We build
everything for our node images static and pure via a transition anyway,
so this is actually fine.

Change-Id: I5cd3879fba4258caa94df4dbea5c6472867b7e34
Reviewed-on: https://review.monogon.dev/c/monogon/+/3725
Tested-by: Jenkins CI
Reviewed-by: Hendrik Hofstadt <hendrik@monogon.tech>
diff --git a/metropolis/cli/takeover/BUILD.bazel b/metropolis/cli/takeover/BUILD.bazel
index d43d307..08f4f19 100644
--- a/metropolis/cli/takeover/BUILD.bazel
+++ b/metropolis/cli/takeover/BUILD.bazel
@@ -1,6 +1,5 @@
 load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_binary")
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
 load("//osbase/build:def.bzl", "node_initramfs")
 
 node_initramfs(
@@ -52,7 +51,6 @@
 go_binary(
     name = "takeover_bin",
     embed = [":takeover_lib"],
-    pure = "on",
     visibility = ["//visibility:public"],
 )
 
diff --git a/metropolis/node/core/BUILD.bazel b/metropolis/node/core/BUILD.bazel
index b7d10af..4f15dea 100644
--- a/metropolis/node/core/BUILD.bazel
+++ b/metropolis/node/core/BUILD.bazel
@@ -61,6 +61,5 @@
 go_binary(
     name = "core",
     embed = [":core_lib"],
-    pure = "on",  # keep
     visibility = ["//metropolis/node:__pkg__"],
 )
diff --git a/metropolis/node/core/network/dhcp4c/BUILD.bazel b/metropolis/node/core/network/dhcp4c/BUILD.bazel
index 24dbe83..34f2a23 100644
--- a/metropolis/node/core/network/dhcp4c/BUILD.bazel
+++ b/metropolis/node/core/network/dhcp4c/BUILD.bazel
@@ -29,7 +29,6 @@
         "lease_test.go",
     ],
     embed = [":dhcp4c"],
-    pure = "on",
     deps = [
         "//metropolis/node/core/network/dhcp4c/transport",
         "@com_github_cenkalti_backoff_v4//:backoff",
diff --git a/metropolis/node/core/network/dhcp4c/callback/BUILD.bazel b/metropolis/node/core/network/dhcp4c/callback/BUILD.bazel
index 2091f6b..b6659ba 100644
--- a/metropolis/node/core/network/dhcp4c/callback/BUILD.bazel
+++ b/metropolis/node/core/network/dhcp4c/callback/BUILD.bazel
@@ -22,7 +22,6 @@
     name = "callback_test",
     srcs = ["callback_test.go"],
     embed = [":callback"],
-    pure = "on",
     deps = [
         "//metropolis/node/core/network/dhcp4c",
         "@com_github_google_go_cmp//cmp",
diff --git a/metropolis/node/kubernetes/hyperkube/BUILD.bazel b/metropolis/node/kubernetes/hyperkube/BUILD.bazel
index 3c4e31b..406ec7d 100644
--- a/metropolis/node/kubernetes/hyperkube/BUILD.bazel
+++ b/metropolis/node/kubernetes/hyperkube/BUILD.bazel
@@ -1,5 +1,5 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 load("@//third_party/go:kubernetes_version_def.bzl", "version_x_defs")
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 
 go_library(
     name = "hyperkube_lib",
@@ -21,7 +21,6 @@
 go_binary(
     name = "hyperkube",
     embed = [":hyperkube_lib"],
-    pure = "on",
     visibility = ["//metropolis/node:__pkg__"],
     x_defs = version_x_defs(),
 )
diff --git a/metropolis/test/e2e/httpserver/BUILD.bazel b/metropolis/test/e2e/httpserver/BUILD.bazel
index 9370eeb..d32e3de 100644
--- a/metropolis/test/e2e/httpserver/BUILD.bazel
+++ b/metropolis/test/e2e/httpserver/BUILD.bazel
@@ -12,7 +12,6 @@
 go_binary(
     name = "httpserver",
     embed = [":httpserver_lib"],
-    pure = "on",
     visibility = ["//visibility:private"],
 )
 
diff --git a/metropolis/test/e2e/persistentvolume/BUILD.bazel b/metropolis/test/e2e/persistentvolume/BUILD.bazel
index cf0917e..7c97c21 100644
--- a/metropolis/test/e2e/persistentvolume/BUILD.bazel
+++ b/metropolis/test/e2e/persistentvolume/BUILD.bazel
@@ -16,7 +16,6 @@
 go_binary(
     name = "persistentvolume",
     embed = [":persistentvolume_lib"],
-    pure = "on",
     visibility = ["//visibility:private"],
 )
 
diff --git a/metropolis/test/e2e/preseedtest/BUILD.bazel b/metropolis/test/e2e/preseedtest/BUILD.bazel
index 68f5717..ad43f78 100644
--- a/metropolis/test/e2e/preseedtest/BUILD.bazel
+++ b/metropolis/test/e2e/preseedtest/BUILD.bazel
@@ -12,7 +12,6 @@
 go_binary(
     name = "preseedtest",
     embed = [":preseedtest_lib"],
-    pure = "on",
     visibility = ["//visibility:private"],
 )
 
diff --git a/metropolis/test/e2e/selftest/BUILD.bazel b/metropolis/test/e2e/selftest/BUILD.bazel
index 23445a0..31754d6 100644
--- a/metropolis/test/e2e/selftest/BUILD.bazel
+++ b/metropolis/test/e2e/selftest/BUILD.bazel
@@ -12,7 +12,6 @@
 go_binary(
     name = "selftest",
     embed = [":selftest_lib"],
-    pure = "on",
     visibility = ["//visibility:private"],
 )
 
diff --git a/metropolis/test/nanoswitch/BUILD.bazel b/metropolis/test/nanoswitch/BUILD.bazel
index 323d53e..8e246ba 100644
--- a/metropolis/test/nanoswitch/BUILD.bazel
+++ b/metropolis/test/nanoswitch/BUILD.bazel
@@ -29,7 +29,6 @@
 go_binary(
     name = "nanoswitch",
     embed = [":nanoswitch_lib"],
-    pure = "on",
     visibility = ["//visibility:private"],
 )