| Jan Schär | 22bea75 | 2025-07-03 07:17:11 +0000 | [diff] [blame] | 1 | RUSTC_EFI_FLAGS = [ |
| 2 | # Disable generation of PDB file to make build reproducible. Otherwise, |
| 3 | # the PDB file contains a non-deterministic path like |
| 4 | # /tmp/rustc0VgeF3/symbols.o, and the binary contains a hash of the PDB |
| 5 | # file. See https://github.com/rust-lang/rust/issues/112587 |
| 6 | "-Clink-arg=/DEBUG:none", |
| 7 | ] |
| 8 | |
| Tim Windelschmidt | e5e90a8 | 2024-07-17 23:46:22 +0200 | [diff] [blame] | 9 | rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") |
| 10 | rust.toolchain( |
| Tim Windelschmidt | b46dceb | 2025-08-19 15:11:24 +0200 | [diff] [blame^] | 11 | edition = "2024", |
| Jan Schär | 22bea75 | 2025-07-03 07:17:11 +0000 | [diff] [blame] | 12 | extra_rustc_flags_triples = { |
| 13 | "x86_64-unknown-uefi": RUSTC_EFI_FLAGS, |
| 14 | "aarch64-unknown-uefi": RUSTC_EFI_FLAGS, |
| 15 | }, |
| Tim Windelschmidt | e5e90a8 | 2024-07-17 23:46:22 +0200 | [diff] [blame] | 16 | extra_target_triples = [ |
| 17 | "x86_64-unknown-uefi", |
| Jan Schär | 56248c1 | 2025-05-05 13:34:18 +0000 | [diff] [blame] | 18 | "aarch64-unknown-uefi", |
| Tim Windelschmidt | e5e90a8 | 2024-07-17 23:46:22 +0200 | [diff] [blame] | 19 | ], |
| Tim Windelschmidt | b46dceb | 2025-08-19 15:11:24 +0200 | [diff] [blame^] | 20 | # Newer versions are currently not usable, because of mangled symbols. |
| 21 | # https://github.com/bazelbuild/rules_rust/issues/3459 |
| 22 | versions = ["1.87.0"], |
| Tim Windelschmidt | e5e90a8 | 2024-07-17 23:46:22 +0200 | [diff] [blame] | 23 | ) |
| 24 | use_repo(rust, "rust_toolchains") |
| 25 | |
| 26 | crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate") |
| 27 | crate.from_cargo( |
| 28 | name = "crate_index", |
| 29 | cargo_lockfile = "//third_party/rust:Cargo.lock", |
| 30 | generate_binaries = True, |
| 31 | manifests = ["//third_party/rust:Cargo.toml"], |
| Tim Windelschmidt | 74a2331 | 2025-02-10 23:12:24 +0100 | [diff] [blame] | 32 | supported_platform_triples = [ |
| 33 | "x86_64-unknown-linux-gnu", |
| 34 | ], |
| Tim Windelschmidt | e5e90a8 | 2024-07-17 23:46:22 +0200 | [diff] [blame] | 35 | ) |
| 36 | crate.from_cargo( |
| 37 | name = "crate_index_efi", |
| 38 | cargo_lockfile = "//third_party/rust_efi:Cargo.lock", |
| 39 | generate_binaries = True, |
| 40 | manifests = ["//third_party/rust_efi:Cargo.toml"], |
| 41 | supported_platform_triples = [ |
| 42 | "x86_64-unknown-linux-gnu", |
| 43 | "x86_64-unknown-uefi", |
| Jan Schär | 56248c1 | 2025-05-05 13:34:18 +0000 | [diff] [blame] | 44 | "aarch64-unknown-uefi", |
| Tim Windelschmidt | e5e90a8 | 2024-07-17 23:46:22 +0200 | [diff] [blame] | 45 | ], |
| 46 | ) |
| Tim Windelschmidt | 74a2331 | 2025-02-10 23:12:24 +0100 | [diff] [blame] | 47 | use_repo( |
| 48 | crate, |
| 49 | "crate_index", |
| 50 | "crate_index_efi", |
| 51 | ) |