treewide: replace workspace name with new canonical name style
When we completely migrate to bzlmod, the old workspace name is not available anymore. This replaces its usage early.
Change-Id: I976d40a71f56199f1f214f04aab0972ff51a7de3
Reviewed-on: https://review.monogon.dev/c/monogon/+/3228
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/build/toolbase/label.go b/build/toolbase/label.go
index b6e8fda..5d033b3 100644
--- a/build/toolbase/label.go
+++ b/build/toolbase/label.go
@@ -36,7 +36,7 @@
// nil is returned.
func ParseBazelLabel(s string) *BazelLabel {
res := BazelLabel{
- WorkspaceName: "dev_source_monogon",
+ WorkspaceName: "@",
}
// Split label into workspace name (if set) and a workspace root relative
diff --git a/build/toolbase/label_test.go b/build/toolbase/label_test.go
index 190c834..e16d88f 100644
--- a/build/toolbase/label_test.go
+++ b/build/toolbase/label_test.go
@@ -11,9 +11,9 @@
p string
t *BazelLabel
}{
- {"//foo/bar", &BazelLabel{"dev_source_monogon", []string{"foo", "bar"}, "bar"}},
- {"//foo/bar:baz", &BazelLabel{"dev_source_monogon", []string{"foo", "bar"}, "baz"}},
- {"//:foo", &BazelLabel{"dev_source_monogon", nil, "foo"}},
+ {"//foo/bar", &BazelLabel{"@", []string{"foo", "bar"}, "bar"}},
+ {"//foo/bar:baz", &BazelLabel{"@", []string{"foo", "bar"}, "baz"}},
+ {"//:foo", &BazelLabel{"@", nil, "foo"}},
{"@test//foo/bar", &BazelLabel{"test", []string{"foo", "bar"}, "bar"}},
{"@test//foo/bar:baz", &BazelLabel{"test", []string{"foo", "bar"}, "baz"}},
@@ -43,8 +43,8 @@
in string
want string
}{
- {"//foo/bar", "@dev_source_monogon//foo/bar:bar"},
- {"//foo:bar", "@dev_source_monogon//foo:bar"},
+ {"//foo/bar", "@@//foo/bar:bar"},
+ {"//foo:bar", "@@//foo:bar"},
{"@com_github_example//:run", "@com_github_example//:run"},
} {
l := ParseBazelLabel(te.in)
diff --git a/metropolis/handbook/defs.bzl b/metropolis/handbook/defs.bzl
index 8944e9a..ffd0b84 100644
--- a/metropolis/handbook/defs.bzl
+++ b/metropolis/handbook/defs.bzl
@@ -37,7 +37,7 @@
# root, which is where our SUMMARY.md path is itself rooted.
#
# For example, if book.toml lives in:
- # execroot/dev_source_monogon/bazel-out/k8-fastbuild/bin/metropolis/handbook/handbook_/book.toml
+ # execroot/_main/bazel-out/k8-fastbuild/bin/metropolis/handbook/handbook_/book.toml
# Then we will need to prepend:
# ../../../../../../../
# To get back to execroot/.
diff --git a/third_party/chrony/chrony.bzl b/third_party/chrony/chrony.bzl
index fd5c7e9..82b39aa 100644
--- a/third_party/chrony/chrony.bzl
+++ b/third_party/chrony/chrony.bzl
@@ -1,9 +1,9 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
-load("@dev_source_monogon//build/utils:template_file.bzl", "template_file")
+load("@@//build/utils:template_file.bzl", "template_file")
template_file(
name = "config.h",
- src = "@dev_source_monogon//third_party/chrony:config.h.in",
+ src = "@@//third_party/chrony:config.h.in",
substitutions = {
# ONCHANGE(//third_party/chrony:external.bzl): version needs to be kept in sync
"%CHRONY_VERSION%": "4.1-monogon",
diff --git a/third_party/dosfstools/dosfstools.bzl b/third_party/dosfstools/dosfstools.bzl
index 61b1ca2..b1984ee 100644
--- a/third_party/dosfstools/dosfstools.bzl
+++ b/third_party/dosfstools/dosfstools.bzl
@@ -1,5 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")
-load("@dev_source_monogon//build/utils:template_file.bzl", "template_file")
+load("@@//build/utils:template_file.bzl", "template_file")
cc_binary(
name = "fsck",
diff --git a/third_party/pixman/pixman.bzl b/third_party/pixman/pixman.bzl
index 8908dfe..e2da98a 100644
--- a/third_party/pixman/pixman.bzl
+++ b/third_party/pixman/pixman.bzl
@@ -15,7 +15,7 @@
# limitations under the License.
load("@rules_cc//cc:defs.bzl", "cc_library")
-load("@dev_source_monogon//build/utils:template_file.bzl", "template_file")
+load("@@//build/utils:template_file.bzl", "template_file")
template_file(
name = "pixman-version.h",
diff --git a/third_party/qemu/patches/bazel_support.patch b/third_party/qemu/patches/bazel_support.patch
index 6a1daff..4770db8 100644
--- a/third_party/qemu/patches/bazel_support.patch
+++ b/third_party/qemu/patches/bazel_support.patch
@@ -6,7 +6,7 @@
@@ -0,0 +1,1356 @@
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
+load("@rules_python//python:defs.bzl", "py_binary")
-+load("@dev_source_monogon//build/utils:template_file.bzl", "template_file")
++load("@@//build/utils:template_file.bzl", "template_file")
+load(":defs.bzl", "filter_label_suffix", "filter_label_contains")
+load("//:defs.bzl", "cc_qemu_keymaps")
+
@@ -1433,7 +1433,7 @@
+ cfg = "exec",
+ ),
+ "_savestdout": attr.label(
-+ default = Label("@dev_source_monogon//build/savestdout"),
++ default = Label("@@//build/savestdout"),
+ executable = True,
+ cfg = "exec",
+ ),
@@ -1724,7 +1724,7 @@
+ cfg = "exec",
+ ),
+ "_savestdout": attr.label(
-+ default = Label("@dev_source_monogon//build/savestdout"),
++ default = Label("@@//build/savestdout"),
+ executable = True,
+ cfg = "exec",
+ ),
diff --git a/third_party/seccomp/seccomp.bzl b/third_party/seccomp/seccomp.bzl
index 4280fc2..4f94aa6 100644
--- a/third_party/seccomp/seccomp.bzl
+++ b/third_party/seccomp/seccomp.bzl
@@ -15,7 +15,7 @@
# limitations under the License.
load("@rules_cc//cc:defs.bzl", "cc_library")
-load("@dev_source_monogon//build/utils:template_file.bzl", "template_file")
+load("@@//build/utils:template_file.bzl", "template_file")
genrule(
name = "config-h",
diff --git a/third_party/util-linux/util-linux.bzl b/third_party/util-linux/util-linux.bzl
index 9e64243..b0ebca6 100644
--- a/third_party/util-linux/util-linux.bzl
+++ b/third_party/util-linux/util-linux.bzl
@@ -15,7 +15,7 @@
# limitations under the License.
load("@rules_cc//cc:defs.bzl", "cc_library")
-load("@dev_source_monogon//build/utils:template_file.bzl", "template_file")
+load("@@//build/utils:template_file.bzl", "template_file")
# These are only for the headers of libcommon, which is a private dependency of libblkid and
# libuuid. Bazel doesn't support private dependencies and we want to avoid propagating these up
diff --git a/third_party/xfsprogs/xfsprogs.bzl b/third_party/xfsprogs/xfsprogs.bzl
index 7265e9f..074b23f 100644
--- a/third_party/xfsprogs/xfsprogs.bzl
+++ b/third_party/xfsprogs/xfsprogs.bzl
@@ -15,7 +15,7 @@
# limitations under the License.
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
-load("@dev_source_monogon//build/utils:template_file.bzl", "template_file")
+load("@@//build/utils:template_file.bzl", "template_file")
defs = [
"NDEBUG", # Doesn't compile without it because their assertions reference non-existent fields