treewide: replace hardcoded runfiles paths

We hardcoded some of the runfiles paths to find specific files. This replaces the hardcoded paths by a call to rlocationpath. This prevents running a target without the correct dependencies at build time instead of at runtime

Change-Id: I7ce56935ac80be6b28b824ccb0781ab401bd6521
Reviewed-on: https://review.monogon.dev/c/monogon/+/3301
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/test/launch/BUILD.bazel b/metropolis/test/launch/BUILD.bazel
index 1b7ee4d..d494a6b 100644
--- a/metropolis/test/launch/BUILD.bazel
+++ b/metropolis/test/launch/BUILD.bazel
@@ -5,24 +5,39 @@
     srcs = [
         "cluster.go",
         "insecure_key.go",
+        "launch.go",
         "metroctl.go",
         "prefixed_stdio.go",
         "swtpm.go",
     ],
     data = [
+        "//metropolis/cli/metroctl",
         "//metropolis/node:image",
         "//metropolis/test/nanoswitch:initramfs",
         "//metropolis/test/swtpm/certtool",
         "//metropolis/test/swtpm/swtpm_cert",
         "//osbase/test/ktest:linux-testing",
-        "//third_party/edk2:firmware",
-        "@com_github_bonzini_qboot//:qboot-bin",
+        "//third_party/edk2:OVMF_CODE.fd",
+        "//third_party/edk2:OVMF_VARS.fd",
         "@swtpm",
         "@swtpm//:swtpm_localca",
         "@swtpm//:swtpm_setup",
     ],
     importpath = "source.monogon.dev/metropolis/test/launch",
     visibility = ["//visibility:public"],
+    x_defs = {
+        "xSwtpmPath": "$(rlocationpath @swtpm )",
+        "xSwtpmSetupPath": "$(rlocationpath @swtpm//:swtpm_setup )",
+        "xSwtpmLocalCAPath": "$(rlocationpath @swtpm//:swtpm_localca )",
+        "xSwtpmCertPath": "$(rlocationpath //metropolis/test/swtpm/swtpm_cert )",
+        "xCerttoolPath": "$(rlocationpath //metropolis/test/swtpm/certtool )",
+        "xMetroctlPath": "$(rlocationpath //metropolis/cli/metroctl )",
+        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
+        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
+        "xKernelPath": "$(rlocationpath //osbase/test/ktest:linux-testing )",
+        "xInitramfsPath": "$(rlocationpath //metropolis/test/nanoswitch:initramfs )",
+        "xNodeImagePath": "$(rlocationpath //metropolis/node:image )",
+    },
     deps = [
         "//go/qcow2",
         "//metropolis/cli/metroctl/core",