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/vm/smoketest/BUILD.bazel b/metropolis/vm/smoketest/BUILD.bazel
index 3c01a4a..7d075d8 100644
--- a/metropolis/vm/smoketest/BUILD.bazel
+++ b/metropolis/vm/smoketest/BUILD.bazel
@@ -4,8 +4,14 @@
go_library(
name = "smoketest_lib",
srcs = ["main.go"],
+ data = [
+ "@qemu//:qemu-x86_64-softmmu",
+ ],
importpath = "source.monogon.dev/metropolis/vm/smoketest",
visibility = ["//visibility:private"],
+ x_defs = {
+ "xQemuPath": "$(rlocationpath @qemu//:qemu-x86_64-softmmu )",
+ },
deps = ["@io_bazel_rules_go//go/runfiles:go_default_library"],
)
@@ -21,11 +27,6 @@
go_binary(
name = "smoketest",
- data = [
- ":initramfs",
- "//osbase/test/ktest:linux-testing",
- "@qemu//:qemu-x86_64-softmmu",
- ],
embed = [":smoketest_lib"],
pure = "on",
visibility = ["//visibility:private"],