treewide: update rules_rust to v0.53.0
This updated our patches for rules_rust, removes a transition as it can
be replaced with the "platform" field in the rust_binary rule. This then
allows us to correctly reference it in all targets that depend on it.
Additionally the -target parameter is replaced inside the llvm-efi
toolchain with --target=.
Change-Id: Ie98753e505736c9ef28ff92fa1c5aa5b3612aec3
Reviewed-on: https://review.monogon.dev/c/monogon/+/3473
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/cli/takeover/install.go b/metropolis/cli/takeover/install.go
index 50679d0..b0c56d0 100644
--- a/metropolis/cli/takeover/install.go
+++ b/metropolis/cli/takeover/install.go
@@ -15,7 +15,7 @@
"source.monogon.dev/osbase/efivarfs"
)
-//go:embed metropolis/node/core/abloader/abloader_bin.efi
+//go:embed metropolis/node/core/abloader/abloader.efi
var abloader []byte
// FileSizedReader is a small adapter from fs.File to fs.SizedReader
@@ -40,7 +40,7 @@
func installMetropolis(l logging.Leveled) error {
// Validate we are running via EFI.
if _, err := os.Stat("/sys/firmware/efi"); os.IsNotExist(err) {
- //nolint:ST1005
+ // nolint:ST1005
return fmt.Errorf("Monogon OS can only be installed on EFI-booted machines, this one is not")
}
diff --git a/metropolis/installer/main.go b/metropolis/installer/main.go
index 16de51a..cc640bf 100644
--- a/metropolis/installer/main.go
+++ b/metropolis/installer/main.go
@@ -42,7 +42,7 @@
"source.monogon.dev/osbase/sysfs"
)
-//go:embed metropolis/node/core/abloader/abloader_bin.efi
+//go:embed metropolis/node/core/abloader/abloader.efi
var abloader []byte
const mib = 1024 * 1024
@@ -145,7 +145,7 @@
// Validate we are running via EFI.
if _, err := os.Stat("/sys/firmware/efi"); os.IsNotExist(err) {
- //nolint:ST1005
+ // nolint:ST1005
return errors.New("Monogon OS can only be installed on EFI-booted machines, this one is not")
}
diff --git a/metropolis/node/core/abloader/BUILD.bazel b/metropolis/node/core/abloader/BUILD.bazel
index e8c49ac..ee7b69f 100644
--- a/metropolis/node/core/abloader/BUILD.bazel
+++ b/metropolis/node/core/abloader/BUILD.bazel
@@ -1,13 +1,14 @@
load("@rules_rust//rust:defs.bzl", "rust_binary")
-load("//osbase/build:def.bzl", "platform_transition_binary")
rust_binary(
- name = "abloader_bin",
+ name = "abloader",
srcs = ["main.rs"],
edition = "2021",
+ platform = "//build/platforms:efi_amd64",
target_compatible_with = [
"@platforms//os:uefi",
],
+ visibility = ["//visibility:public"],
deps = [
"//metropolis/node/core/abloader/spec:abloader_proto_rs",
"@crate_index_efi//:prost",
@@ -15,10 +16,3 @@
"@crate_index_efi//:uefi-services",
],
)
-
-platform_transition_binary(
- name = "abloader",
- binary = ":abloader_bin",
- target_platform = "//build/platforms:efi_amd64",
- visibility = ["//visibility:public"],
-)
diff --git a/metropolis/node/core/update/e2e/BUILD.bazel b/metropolis/node/core/update/e2e/BUILD.bazel
index 3443ecf..71be003 100644
--- a/metropolis/node/core/update/e2e/BUILD.bazel
+++ b/metropolis/node/core/update/e2e/BUILD.bazel
@@ -22,8 +22,7 @@
"xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
"xBootPath": "$(rlocationpath //metropolis/node/core/update/e2e/testos:kernel_efi_x )",
"xSystemXPath": "$(rlocationpath //metropolis/node/core/update/e2e/testos:verity_rootfs_x )",
- # TODO(tim): Hardcoded because of https://github.com/monogon-dev/monogon/issues/316
- "xAbloaderPath": "_main/metropolis/node/core/abloader/abloader_bin.efi",
+ "xAbloaderPath": "$(rlocationpath //metropolis/node/core/abloader )",
},
deps = [
"//osbase/blkio",
diff --git a/metropolis/node/core/update/update.go b/metropolis/node/core/update/update.go
index 51dc737..b4183ad 100644
--- a/metropolis/node/core/update/update.go
+++ b/metropolis/node/core/update/update.go
@@ -419,7 +419,7 @@
return nil
}
-//go:embed metropolis/node/core/abloader/abloader_bin.efi
+//go:embed metropolis/node/core/abloader/abloader.efi
var abloader []byte
func (s *Service) fixupPreloader() error {