cli/metroctl: add metroctl_lite for use in tests
It is the same target just without any data dependencies to ensure we
dont have large dependency tree when running tests.
Change-Id: Iebd0fbd880de07bbd853ea8dce8e9fbb193506af
Reviewed-on: https://review.monogon.dev/c/monogon/+/3372
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/cli/metroctl/BUILD.bazel b/metropolis/cli/metroctl/BUILD.bazel
index eed93c2..2b53acf 100644
--- a/metropolis/cli/metroctl/BUILD.bazel
+++ b/metropolis/cli/metroctl/BUILD.bazel
@@ -32,13 +32,6 @@
"rpc.go",
"table_node.go",
],
- data = select({
- ":buildkind_lite": [],
- "//conditions:default": [
- "//metropolis/installer:kernel",
- "//metropolis/node:bundle",
- ],
- }),
importpath = "source.monogon.dev/metropolis/cli/metroctl",
visibility = ["//visibility:private"],
deps = [
@@ -69,6 +62,22 @@
go_binary(
name = "metroctl",
+ data = select({
+ ":buildkind_lite": [],
+ "//conditions:default": [
+ "//metropolis/installer:kernel",
+ "//metropolis/node:bundle",
+ ],
+ }),
embed = [":metroctl_lib"],
visibility = ["//visibility:public"],
)
+
+# metroctl_lite is the same binary as normal metroctl, but without any data
+# dependencies.
+go_binary(
+ name = "metroctl_lite",
+ data = [],
+ embed = [":metroctl_lib"],
+ visibility = ["//metropolis:__subpackages__"],
+)
diff --git a/metropolis/test/launch/BUILD.bazel b/metropolis/test/launch/BUILD.bazel
index d494a6b..c217b35 100644
--- a/metropolis/test/launch/BUILD.bazel
+++ b/metropolis/test/launch/BUILD.bazel
@@ -11,7 +11,7 @@
"swtpm.go",
],
data = [
- "//metropolis/cli/metroctl",
+ "//metropolis/cli/metroctl:metroctl_lite",
"//metropolis/node:image",
"//metropolis/test/nanoswitch:initramfs",
"//metropolis/test/swtpm/certtool",
@@ -31,7 +31,7 @@
"xSwtpmLocalCAPath": "$(rlocationpath @swtpm//:swtpm_localca )",
"xSwtpmCertPath": "$(rlocationpath //metropolis/test/swtpm/swtpm_cert )",
"xCerttoolPath": "$(rlocationpath //metropolis/test/swtpm/certtool )",
- "xMetroctlPath": "$(rlocationpath //metropolis/cli/metroctl )",
+ "xMetroctlPath": "$(rlocationpath //metropolis/cli/metroctl:metroctl_lite )",
"xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
"xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
"xKernelPath": "$(rlocationpath //osbase/test/ktest:linux-testing )",