-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMODULE.bazel
More file actions
124 lines (109 loc) · 4.76 KB
/
MODULE.bazel
File metadata and controls
124 lines (109 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Licensed under the Apache-2.0 license
# SPDX-License-Identifier: Apache-2.0
module(
name = "openprot",
version = "0.0.1",
)
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "pigweed")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_rust", version = "0.68.1")
bazel_dep(name = "rules_rust_mdbook", version = "0.68.1")
bazel_dep(name = "rules_platform", version = "0.1.0")
bazel_dep(name = "rules_python", version = "1.8.3")
bazel_dep(name = "ureg")
bazel_dep(name = "caliptra_deps", version = "0.0.0")
local_path_override(
module_name = "caliptra_deps",
path = "third_party/caliptra",
)
git_override(
module_name = "pigweed",
commit = "67563b40f2c19aec4f899afd13c00e48baf790b2",
patch_args = ["-p1"],
patches = [
"//third_party/pigweed:veer_pic_generic_type.patch",
# Allow integration_tests to build for armv7-m / armv7e-m so the
# AST10x0 unittest_runner can use it.
"//third_party/pigweed:integration_tests_armv7m.patch",
],
remote = "https://pigweed.googlesource.com/pigweed/pigweed",
)
git_override(
module_name = "ureg",
commit = "4762ed5eef323a4267720a6b6da287c88738f901",
remote = "https://github.com/chipsalliance/caliptra-ureg",
)
pw_rust = use_extension("@pigweed//pw_toolchain/rust:extensions.bzl", "pw_rust")
pw_rust.toolchain(cipd_tag = "git_revisions:fe5c95d4ae33ec9d7831921e448e2daf8264ea42,7b074fc9362a4a6a5f172dd8936a22fb25eff96b")
use_repo(pw_rust, "pw_rust_toolchains")
register_toolchains(
"@pigweed//pw_toolchain/host_clang:host_cc_toolchain_linux",
"@pigweed//pw_toolchain/host_clang:host_cc_toolchain_macos",
"@pigweed//pw_toolchain/arm_clang:arm_clang_cc_toolchain_cortex-m4",
"@pigweed//pw_toolchain/riscv_clang:riscv_clang_cc_toolchain_rv32imc",
"@pw_rust_toolchains//:all",
)
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.from_cargo(
name = "rust_crates",
cargo_lockfile = "//third_party/crates_io:Cargo.lock",
manifests = ["//third_party/crates_io:Cargo.toml"],
# crate_universe's defaults do not include some embedded triples so the
# triples are listed explicitly.
supported_platform_triples = [
# Host platforms
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
"aarch64-apple-darwin",
"x86_64-apple-darwin",
# Target platforms
"riscv32imc-unknown-none-elf",
"thumbv7em-none-eabi",
],
)
use_repo(crate, "rust_caliptra_crates", "rust_caliptra_crates_host", "rust_crates")
pw_rust_crates_ext = use_extension("@pigweed//pw_build:pw_rust_crates_extension.bzl", "pw_rust_crates_extension")
# Ideally, we shouldn't need to override the pigweed `rust_crates` repo as it
# requires the downstream (openprot) repo adding pigweed cargo deps to its own
# Cargo.toml. This is currently needed to work around a limitation in
# rules_rust and unsupported target triples.
#
# TODO(cfrantz): Remove this override and non-directly referenced crates
# once pigweed has adopted a version of rules_rust that fixes the limitation.
override_repo(
pw_rust_crates_ext,
rust_crates = "rust_crates",
)
bazel_dep(name = "opentitan_devbundle")
archive_override(
module_name = "opentitan_devbundle",
integrity = "sha256-GP3ysylvAFBUKyDHu1al2swa2CA2Od2GGMgJLcoOZTY=",
url = "https://storage.googleapis.com/artifacts.opentitan.org/dev_bundle/devbundle-20260401.tar.xz",
)
# Caliptra source repositories — declared via a module_extension in
# third_party/caliptra/extensions.bzl so the git_repository commits
# can be driven by versions.bzl at BUILD load time. bzlmod forbids
# `load()` in MODULE.bazel files directly, but allows it in .bzl
# files that back module extensions — that is how CALIPTRA_VERSIONS
# gets threaded from versions.bzl to the git_repository commits
# here.
#
# A previous attempt to move these declarations via `use_repo_rule`
# from the nested caliptra_deps module rolled back (Task 1.1 of
# cargo_universe.md) because the repos ended up in the nested
# module's namespace, invisible to the overlay BUILD files at
# //third_party/caliptra/caliptra-*:overlay.BUILD. The module
# extension pattern sidesteps that trap: `use_repo` below lifts the
# extension's repos into the root module's namespace, so every
# downstream target sees @caliptra_sw / @caliptra_mcu_sw exactly as
# they did when the declarations were inline.
caliptra_repos_ext = use_extension(
"//third_party/caliptra:extensions.bzl",
"caliptra_repos",
)
use_repo(caliptra_repos_ext, "caliptra_mcu_sw", "caliptra_sw")
nonhermetic_repo = use_repo_rule("//target/earlgrey/tooling/signing:nonhermetic.bzl", "nonhermetic_repo")
nonhermetic_repo(name = "nonhermetic")
hsm = use_extension("//third_party/hsm:extensions.bzl", "hsm")
use_repo(hsm, "cloud_kms_hsm")