build/binary_tarball: rename from static_binary_tarball

The static_binary_tarball rule no longer has a transition to build
statically, so the "static" part of the name is not meaningful anymore.

Change-Id: Ifaecf2f7846a963d957d4bfcc89a3d9e7e911f5c
Reviewed-on: https://review.monogon.dev/c/monogon/+/4415
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/build/binary_tarball/BUILD.bazel b/build/binary_tarball/BUILD.bazel
new file mode 100644
index 0000000..567c572
--- /dev/null
+++ b/build/binary_tarball/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "binary_tarball_lib",
+    srcs = ["main.go"],
+    importpath = "source.monogon.dev/build/binary_tarball",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//build/binary_tarball/spec",
+        "@org_golang_google_protobuf//encoding/prototext",
+    ],
+)
+
+go_binary(
+    name = "binary_tarball",
+    embed = [":binary_tarball_lib"],
+    visibility = ["//visibility:public"],
+)
diff --git a/build/static_binary_tarball/def.bzl b/build/binary_tarball/def.bzl
similarity index 92%
rename from build/static_binary_tarball/def.bzl
rename to build/binary_tarball/def.bzl
index 8ec1164..c3dbf85 100644
--- a/build/static_binary_tarball/def.bzl
+++ b/build/binary_tarball/def.bzl
@@ -14,7 +14,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-def _static_binary_tarball_impl(ctx):
+def _binary_tarball_impl(ctx):
     layer_spec = ctx.actions.declare_file(ctx.label.name + ".prototxt")
     executable = ctx.attr.executable[DefaultInfo].files_to_run.executable
     runfiles = ctx.attr.executable[DefaultInfo].default_runfiles
@@ -42,8 +42,8 @@
 
     return [DefaultInfo(files = depset([layer_out]), runfiles = ctx.runfiles(files = [layer_out]))]
 
-static_binary_tarball = rule(
-    implementation = _static_binary_tarball_impl,
+binary_tarball = rule(
+    implementation = _binary_tarball_impl,
     doc = """
         Build a tarball from a binary given in `executable` and its runfiles. Everything will be put under
         /app with the same filesystem layout as if run under `bazel run`. So if your executable works under bazel run,
@@ -58,7 +58,7 @@
             cfg = "target",
         ),
         "_container_binary": attr.label(
-            default = Label("//build/static_binary_tarball"),
+            default = Label("//build/binary_tarball"),
             cfg = "exec",
             executable = True,
             allow_files = True,
diff --git a/build/static_binary_tarball/main.go b/build/binary_tarball/main.go
similarity index 96%
rename from build/static_binary_tarball/main.go
rename to build/binary_tarball/main.go
index f2f7067..88f4cc3 100644
--- a/build/static_binary_tarball/main.go
+++ b/build/binary_tarball/main.go
@@ -14,7 +14,7 @@
 
 	"google.golang.org/protobuf/encoding/prototext"
 
-	"source.monogon.dev/build/static_binary_tarball/spec"
+	"source.monogon.dev/build/binary_tarball/spec"
 )
 
 var (
diff --git a/build/static_binary_tarball/spec/BUILD.bazel b/build/binary_tarball/spec/BUILD.bazel
similarity index 84%
rename from build/static_binary_tarball/spec/BUILD.bazel
rename to build/binary_tarball/spec/BUILD.bazel
index e3b4bc8..bd02812 100644
--- a/build/static_binary_tarball/spec/BUILD.bazel
+++ b/build/binary_tarball/spec/BUILD.bazel
@@ -23,7 +23,7 @@
 
 go_proto_library(
     name = "spec_go_proto",
-    importpath = "source.monogon.dev/build/static_binary_tarball/spec",
+    importpath = "source.monogon.dev/build/binary_tarball/spec",
     proto = ":spec_proto",
     visibility = ["//visibility:public"],
 )
@@ -31,6 +31,6 @@
 go_library(
     name = "spec",
     embed = [":spec_go_proto"],
-    importpath = "source.monogon.dev/build/static_binary_tarball/spec",
+    importpath = "source.monogon.dev/build/binary_tarball/spec",
     visibility = ["//visibility:public"],
 )
diff --git a/build/static_binary_tarball/spec/gomod-generated-placeholder.go b/build/binary_tarball/spec/gomod-generated-placeholder.go
similarity index 100%
rename from build/static_binary_tarball/spec/gomod-generated-placeholder.go
rename to build/binary_tarball/spec/gomod-generated-placeholder.go
diff --git a/build/static_binary_tarball/spec/spec.proto b/build/binary_tarball/spec/spec.proto
similarity index 89%
rename from build/static_binary_tarball/spec/spec.proto
rename to build/binary_tarball/spec/spec.proto
index 8e758d7..1e2e17e 100644
--- a/build/static_binary_tarball/spec/spec.proto
+++ b/build/binary_tarball/spec/spec.proto
@@ -16,9 +16,9 @@
 
 syntax = "proto3";
 
-package build.static_binary_tarball.spec;
+package build.binary_tarball.spec;
 
-// Spec is a spec of what goes into a static_binary_tarball
+// Spec is a spec of what goes into a binary_tarball
 message Spec {
   repeated File file = 1;
 }
@@ -29,4 +29,4 @@
   string src = 1;
   // path contains the path in the tarball
   string path = 2;
-}
\ No newline at end of file
+}
diff --git a/build/mirror_proxy/BUILD.bazel b/build/mirror_proxy/BUILD.bazel
index cda06f8..2c9a5cd 100644
--- a/build/mirror_proxy/BUILD.bazel
+++ b/build/mirror_proxy/BUILD.bazel
@@ -1,6 +1,6 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 
 go_library(
     name = "mirror_proxy_lib",
@@ -19,7 +19,7 @@
     visibility = ["//visibility:public"],
 )
 
-static_binary_tarball(
+binary_tarball(
     name = "mirror_proxy_layer",
     executable = ":mirror_proxy",
     visibility = ["//visibility:private"],
diff --git a/build/static_binary_tarball/BUILD.bazel b/build/static_binary_tarball/BUILD.bazel
deleted file mode 100644
index c5e1511..0000000
--- a/build/static_binary_tarball/BUILD.bazel
+++ /dev/null
@@ -1,18 +0,0 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
-
-go_library(
-    name = "static_binary_tarball_lib",
-    srcs = ["main.go"],
-    importpath = "source.monogon.dev/build/static_binary_tarball",
-    visibility = ["//visibility:private"],
-    deps = [
-        "//build/static_binary_tarball/spec",
-        "@org_golang_google_protobuf//encoding/prototext",
-    ],
-)
-
-go_binary(
-    name = "static_binary_tarball",
-    embed = [":static_binary_tarball_lib"],
-    visibility = ["//visibility:public"],
-)
diff --git a/cloud/agent/takeover/BUILD.bazel b/cloud/agent/takeover/BUILD.bazel
index e1ba2a6..ff81abe 100644
--- a/cloud/agent/takeover/BUILD.bazel
+++ b/cloud/agent/takeover/BUILD.bazel
@@ -1,5 +1,5 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 load("//osbase/build/genproductinfo:defs.bzl", "product_info")
 load("//osbase/build/mkcpio:def.bzl", "node_initramfs")
 
@@ -32,8 +32,7 @@
     visibility = ["//visibility:public"],
 )
 
-# Used by container_images, forces a static build
-static_binary_tarball(
+binary_tarball(
     name = "takeover_layer",
     executable = ":takeover",
     visibility = ["//visibility:public"],
diff --git a/metropolis/node/kubernetes/pause/BUILD.bazel b/metropolis/node/kubernetes/pause/BUILD.bazel
index 69529b1..45bf614 100644
--- a/metropolis/node/kubernetes/pause/BUILD.bazel
+++ b/metropolis/node/kubernetes/pause/BUILD.bazel
@@ -1,6 +1,6 @@
 load("@rules_cc//cc:defs.bzl", "cc_binary")
 load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 
 cc_binary(
     name = "pause",
@@ -12,7 +12,7 @@
     ],
 )
 
-static_binary_tarball(
+binary_tarball(
     name = "pause_layer",
     executable = ":pause",
     visibility = ["//visibility:private"],
diff --git a/metropolis/test/e2e/connectivity/agent/BUILD.bazel b/metropolis/test/e2e/connectivity/agent/BUILD.bazel
index b9db83c..fd11006 100644
--- a/metropolis/test/e2e/connectivity/agent/BUILD.bazel
+++ b/metropolis/test/e2e/connectivity/agent/BUILD.bazel
@@ -1,6 +1,6 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 load("@rules_oci//oci:defs.bzl", "oci_image")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 
 go_library(
     name = "agent_lib",
@@ -19,7 +19,7 @@
     visibility = ["//visibility:private"],
 )
 
-static_binary_tarball(
+binary_tarball(
     name = "agent_layer",
     executable = ":agent",
     visibility = ["//visibility:private"],
diff --git a/metropolis/test/e2e/httpserver/BUILD.bazel b/metropolis/test/e2e/httpserver/BUILD.bazel
index d32e3de..8535ece 100644
--- a/metropolis/test/e2e/httpserver/BUILD.bazel
+++ b/metropolis/test/e2e/httpserver/BUILD.bazel
@@ -1,6 +1,6 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 load("@rules_oci//oci:defs.bzl", "oci_image")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 
 go_library(
     name = "httpserver_lib",
@@ -15,7 +15,7 @@
     visibility = ["//visibility:private"],
 )
 
-static_binary_tarball(
+binary_tarball(
     name = "httpserver_layer",
     executable = ":httpserver",
     visibility = ["//visibility:private"],
diff --git a/metropolis/test/e2e/persistentvolume/BUILD.bazel b/metropolis/test/e2e/persistentvolume/BUILD.bazel
index 7c97c21..678c86f 100644
--- a/metropolis/test/e2e/persistentvolume/BUILD.bazel
+++ b/metropolis/test/e2e/persistentvolume/BUILD.bazel
@@ -1,6 +1,6 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 load("@rules_oci//oci:defs.bzl", "oci_image")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 
 go_library(
     name = "persistentvolume_lib",
@@ -19,7 +19,7 @@
     visibility = ["//visibility:private"],
 )
 
-static_binary_tarball(
+binary_tarball(
     name = "persistentvolume_layer",
     executable = ":persistentvolume",
     visibility = ["//visibility:private"],
diff --git a/metropolis/test/e2e/preseedtest/BUILD.bazel b/metropolis/test/e2e/preseedtest/BUILD.bazel
index ad43f78..c1c756b 100644
--- a/metropolis/test/e2e/preseedtest/BUILD.bazel
+++ b/metropolis/test/e2e/preseedtest/BUILD.bazel
@@ -1,6 +1,6 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 
 go_library(
     name = "preseedtest_lib",
@@ -15,7 +15,7 @@
     visibility = ["//visibility:private"],
 )
 
-static_binary_tarball(
+binary_tarball(
     name = "preseedtest_layer",
     executable = ":preseedtest",
     visibility = ["//visibility:private"],
diff --git a/metropolis/test/e2e/selftest/BUILD.bazel b/metropolis/test/e2e/selftest/BUILD.bazel
index 31754d6..fa2c09a 100644
--- a/metropolis/test/e2e/selftest/BUILD.bazel
+++ b/metropolis/test/e2e/selftest/BUILD.bazel
@@ -1,6 +1,6 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
 load("@rules_oci//oci:defs.bzl", "oci_image")
-load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
+load("//build/binary_tarball:def.bzl", "binary_tarball")
 
 go_library(
     name = "selftest_lib",
@@ -15,7 +15,7 @@
     visibility = ["//visibility:private"],
 )
 
-static_binary_tarball(
+binary_tarball(
     name = "selftest_layer",
     executable = ":selftest",
     visibility = ["//visibility:private"],