WORKSPACE: bump rules_rust to 0.48.0

Change-Id: Ib2921a50e9c3273512444825054e386e57bd9ae7
Reviewed-on: https://review.monogon.dev/c/monogon/+/3304
Reviewed-by: Leopold Schabel <leo@monogon.tech>
Tested-by: Jenkins CI
diff --git a/.gitignore b/.gitignore
index 46e1a22..d39ce0d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,7 @@
 .bazelrc.user
 .bazelrc.sandbox
 .bazeldnf
-.direnv
\ No newline at end of file
+.direnv
+
+third_party/rust/target/*
+third_party/rust_efi/target/*
\ No newline at end of file
diff --git a/MODULE.bazel b/MODULE.bazel
index 450ffa4..b7ceed1 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -47,7 +47,7 @@
         "//third_party:rust-prost-nostd.patch",
         "//third_party:rust-reproducibility.patch",
     ],
-    version = "0.47.1",
+    version = "0.48.0",
 )
 
 bazel_dep(name = "zlib")
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
index d153d9e..cea9c64 100644
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -168,8 +168,8 @@
     "https://bcr.bazel.build/modules/rules_python/0.34.0/MODULE.bazel": "1d623d026e075b78c9fde483a889cda7996f5da4f36dffb24c246ab30f06513a",
     "https://bcr.bazel.build/modules/rules_python/0.34.0/source.json": "113116e287eec64a7d005a9db44865d810499fdc4f621e352aff58214f5ea2d8",
     "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c",
-    "https://bcr.bazel.build/modules/rules_rust/0.47.1/MODULE.bazel": "90af384db17e4582aceb53c7c016d90b98ad6f9cfdfb78235283b103d473cfaf",
-    "https://bcr.bazel.build/modules/rules_rust/0.47.1/source.json": "36dd5a2891d422559edad5fa19d3507b38987877cc8c2786b9eed6dc107479d5",
+    "https://bcr.bazel.build/modules/rules_rust/0.48.0/MODULE.bazel": "41ca45aa5fcf921852f0efacf4590106963c21aa1dcb8af0afaf39da63e229da",
+    "https://bcr.bazel.build/modules/rules_rust/0.48.0/source.json": "c54fae3ac627c1c9acb5c42bc0338249c4de6eeb36cc6cb92130a58afb26c6b4",
     "https://bcr.bazel.build/modules/rules_swift/1.18.0/MODULE.bazel": "a6aba73625d0dc64c7b4a1e831549b6e375fbddb9d2dde9d80c9de6ec45b24c9",
     "https://bcr.bazel.build/modules/rules_swift/1.18.0/source.json": "9e636cabd446f43444ea2662341a9cbb74ecd87ab0557225ae73f1127cb7ff52",
     "https://bcr.bazel.build/modules/stardoc/0.5.0/MODULE.bazel": "f9f1f46ba8d9c3362648eea571c6f9100680efc44913618811b58cc9c02cd678",
@@ -6081,8 +6081,8 @@
     },
     "@@rules_rust~//crate_universe/private/module_extensions:cargo_bazel_bootstrap.bzl%cargo_bazel_bootstrap": {
       "general": {
-        "bzlTransitiveDigest": "6IAn3jQfC0RVQmryCWbta17eKw84EOdicI3Cu7+onPU=",
-        "usagesDigest": "IqXYXij/h0aVrJj49KClecUVysWoCg3OD6L+SqwUnWw=",
+        "bzlTransitiveDigest": "VuPsUVfxJala8Xq0CqOhjdfJU4eox6LFRAQ0zq5GFAo=",
+        "usagesDigest": "mcPm2zFtJ7UYgE1bjOcK2MFjP2jqdHxG944RmYWriYQ=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
         "envVariables": {},
@@ -6174,8 +6174,8 @@
     },
     "@@rules_rust~//rust:extensions.bzl%rust": {
       "general": {
-        "bzlTransitiveDigest": "pvAgQan8vZNzzbtmKuuZgkRhnc8/jB+TuRMU8To4Kuw=",
-        "usagesDigest": "U94mEG4OIMOPnAWCS2dT4XEYnL8I9rK+dZVlsxsun7k=",
+        "bzlTransitiveDigest": "F736QBfeosO6muSg/6UBJDrGre+JgCF6nj6yeHwqtlY=",
+        "usagesDigest": "RHYkGQDr/GqMjUqjbnI7OqwHYl26YTr7ncQm20fjXgk=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
         "envVariables": {},
@@ -7369,8 +7369,8 @@
     },
     "@@rules_rust~//rust/private:extensions.bzl%i": {
       "general": {
-        "bzlTransitiveDigest": "cxD0L+oTGXDODhCSTtPUJqVLBet8mM2o6b5uNHzOxYk=",
-        "usagesDigest": "KU28o/npI2P84qcjs0fRR5zlBEZMLVxyani0kz0po50=",
+        "bzlTransitiveDigest": "lhW1Cjv8DAdYtxiMUSSzB1oYyfV8JCkh7dHNwPY3IhU=",
+        "usagesDigest": "8rxNHg4HjTBAPEiIdmi1v8o2l8IMjsu1iuZOGuvYmFQ=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
         "envVariables": {},
@@ -7466,6 +7466,15 @@
               "build_file": "@@rules_rust~//crate_universe/3rdparty/crates:BUILD.url-2.4.0.bazel"
             }
           },
+          "rules_python": {
+            "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
+            "ruleClassName": "http_archive",
+            "attributes": {
+              "sha256": "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
+              "strip_prefix": "rules_python-0.34.0",
+              "url": "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz"
+            }
+          },
           "cui__ryu-1.0.14": {
             "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
             "ruleClassName": "http_archive",
@@ -17736,7 +17745,8 @@
             "generated_inputs_in_external_repo",
             "libc",
             "rules_rust_toolchain_test_target_json",
-            "com_google_googleapis"
+            "com_google_googleapis",
+            "rules_python"
           ],
           "explicitRootModuleDirectDevDeps": [],
           "useAllRepos": "NO",
diff --git a/build/rust/BUILD.bazel b/build/rust/BUILD.bazel
index 7459c33..355b394 100644
--- a/build/rust/BUILD.bazel
+++ b/build/rust/BUILD.bazel
@@ -14,7 +14,6 @@
     prost_plugin = "@crate_index//:protoc-gen-prost__protoc-gen-prost",
     prost_runtime = ":prost_runtime_efi",
     prost_types = "@crate_index_efi//:prost-types",
-    proto_compiler = "@protobuf//:protoc",
     # This defaults to a non-empty value, which triggers an error that not all
     # tonic flags are set. We do not want tonic, so explicitly set this to
     # an empty string.
diff --git a/third_party/rust-prost-nostd.patch b/third_party/rust-prost-nostd.patch
index 2809877..dc30a23 100644
--- a/third_party/rust-prost-nostd.patch
+++ b/third_party/rust-prost-nostd.patch
@@ -1,7 +1,7 @@
-From 2aff5ddecae1bbbe85b07c047bc6cbfa2da5ba96 Mon Sep 17 00:00:00 2001
+From 8b464f085c9b255d81ee0e8501914ff7cb3cadd8 Mon Sep 17 00:00:00 2001
 From: Tim Windelschmidt <tim@monogon.tech>
 Date: Fri, 12 Jan 2024 15:41:50 +0100
-Subject: [PATCH] Support no_std in Prost toolchain
+Subject: [PATCH 1/2] Support no_std in Prost toolchain
 
 ---
  proto/prost/private/prost.bzl         |  8 ++++++++
@@ -9,10 +9,10 @@
  2 files changed, 22 insertions(+), 3 deletions(-)
 
 diff --git a/proto/prost/private/prost.bzl b/proto/prost/private/prost.bzl
-index 0a9f3500..e3e5e382 100644
+index c3a7d4e0..6f7449d0 100644
 --- a/proto/prost/private/prost.bzl
 +++ b/proto/prost/private/prost.bzl
-@@ -58,6 +58,9 @@ def _compile_proto(ctx, crate_name, proto_info, deps, prost_toolchain, rustfmt_t
+@@ -65,6 +65,9 @@ def _compile_proto(ctx, crate_name, proto_info, deps, prost_toolchain, rustfmt_t
      additional_args.add("--descriptor_set={}".format(proto_info.direct_descriptor_set.path))
      additional_args.add_all(prost_toolchain.prost_opts, format_each = "--prost_opt=%s")
 
@@ -22,7 +22,7 @@
      if prost_toolchain.tonic_plugin:
          tonic_plugin = prost_toolchain.tonic_plugin[DefaultInfo].files_to_run
          additional_args.add(prost_toolchain.tonic_plugin_flag % tonic_plugin.executable.path)
-@@ -335,6 +338,7 @@ def _rust_prost_toolchain_impl(ctx):
+@@ -372,6 +375,7 @@ def _rust_prost_toolchain_impl(ctx):
          tonic_plugin = ctx.attr.tonic_plugin,
          tonic_plugin_flag = ctx.attr.tonic_plugin_flag,
          tonic_runtime = ctx.attr.tonic_runtime,
@@ -30,7 +30,7 @@
      )]
 
  rust_prost_toolchain = rule(
-@@ -387,6 +391,10 @@ rust_prost_toolchain = rule(
+@@ -423,6 +427,10 @@ rust_prost_toolchain = rule(
              doc = "The Tonic runtime crates to use.",
              providers = [[rust_common.crate_info], [rust_common.crate_group_info]],
          ),
@@ -38,11 +38,11 @@
 +            doc = "If a no_std tag should be put into the generated code.",
 +            default = False,
 +        ),
-     },
- )
-
+     }, **proto_toolchains.if_legacy_toolchain({
+         "_legacy_proto_toolchain": attr.label(
+             default = "//proto/protobuf:legacy_proto_toolchain",
 diff --git a/proto/prost/private/protoc_wrapper.rs b/proto/prost/private/protoc_wrapper.rs
-index f8be6478..44f6ad8e 100644
+index 9c41892c..5d67640d 100644
 --- a/proto/prost/private/protoc_wrapper.rs
 +++ b/proto/prost/private/protoc_wrapper.rs
 @@ -117,7 +117,7 @@ struct Module {
@@ -119,5 +119,5 @@
          package_info_file,
          extern_paths
 --
-2.42.0
+2.44.1
 
diff --git a/third_party/rust/README.md b/third_party/rust/README.md
index de1ac4a..f0e2da3 100644
--- a/third_party/rust/README.md
+++ b/third_party/rust/README.md
@@ -1,17 +1,10 @@
 Rust dependency management
 ==========================
 
-You will need cargo-raze installed on your host operating system, as currently building cargo-raze with Bazel [seems to be broken](https://github.com/google/cargo-raze/issues/423) (and pulls in _a lot_ of transitive dependencies).
+Dependencies are defined in Cargo.toml. Dependency syncing and updating is done in the repository rule which means it’s done during the analysis phase of builds.
 
-    $ cargo install cargo-raze
+To render a new lock file:
 
-Dependencies are defined in Cargo.toml. Raze is used to lock these into concrete versions (in `//third_party/rust/cargo/Cargo.raze.lock`) and to generate BUILDfiles (in `//third_party/rust/cargo/remote/...` and `//third_party/rust/BUILD.bazel`).
+    $ CARGO_BAZEL_REPIN=1 bazel sync
 
-In contrast to Gazelle/go dependencies, the BUILD files for external packages are actually committed into the repository instead of being generated on demand during analysis phase. This makes Raze a bit more noisy in Git history, but vastly speeds up analysis phase, and doesn't rely on an early, pre-analysis Go toolchain that Gazelle relies on.
-
-To relock dependencies and regenerate BUILDfiles:
-
-    $ cd third_party/rust/
-    $ cargo raze
-
-For more information on the process, consult the official [cargo-raze documentation](https://github.com/google/cargo-raze).
+For more information on the process, consult the official [rules_rust/crate_universe documentation](https://bazelbuild.github.io/rules_rust/crate_universe.html).