-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWORKSPACE
More file actions
172 lines (143 loc) · 5.65 KB
/
WORKSPACE
File metadata and controls
172 lines (143 loc) · 5.65 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
workspace(name = "spool_firmware")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# RUST
local_repository(
name = "rules_rust",
path = "rules_rust",
)
# http_archive(
# name = "rules_rust",
# sha256 = "b4e622a36904b5dd2d2211e40008fc473421c8b51c9efca746ab2ecf11dca08e",
# urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.19.1/rules_rust-v0.19.1.tar.gz"],
# )
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_analyzer_toolchain_repository", "rust_register_toolchains")
rules_rust_dependencies()
rust_register_toolchains()
load("//toolchain:rust_setup.bzl", "register_rust_toolchains")
host_triples = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin"]
rust_target_triples = [
"thumbv7m-none-eabi",
"thumbv7em-none-eabi",
"thumbv7em-none-eabihf",
"thumbv6m-none-eabi",
]
rust_version = "1.68.0"
register_rust_toolchains(host_triples, rust_target_triples, rust_version)
register_toolchains(rust_analyzer_toolchain_repository(
name = "rust_analyzer_toolchain",
# This should match the currently registered toolchain.
version = rust_version,
))
load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies")
rust_analyzer_dependencies()
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
crate_universe_dependencies(bootstrap=True, rust_version=rust_version)
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
crates_repository(
name = "planner_crate_index",
cargo_lockfile = "//spool/lib/planner:Cargo.lock",
lockfile = "//spool/lib/planner:Cargo.Bazel.lock",
# `generator` is not necessary in official releases.
# See load satement for `cargo_bazel_bootstrap`.
generator = "@cargo_bazel_bootstrap//:cargo-bazel",
packages = {
"fixed": crate.spec(
version = "1.23",
),
"fixed-sqrt": crate.spec(
version = "0.2.5",
),
"gcode": crate.spec(
version = "0.6.1",
),
"clap": crate.spec(
version = "4.2.1",
),
"arraydeque": crate.spec(
version = "0.5",
default_features = False,
),
"log": crate.spec(
version = "0.4",
),
"cordic": crate.spec(
version = "0.1",
),
"lazy_static": crate.spec(
version = "1.4",
features = ["spin_no_std"],
),
"itertools": crate.spec(
version = "0.10.5",
default_features = False,
),
},
rust_version=rust_version,
supported_platform_triples=rust_target_triples + host_triples,
)
load("@planner_crate_index//:defs.bzl", "crate_repositories")
crate_repositories()
http_archive(
name = "bazel_skylib",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
],
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
)
# Python
http_archive(
name = "rules_python",
sha256 = "48a838a6e1983e4884b26812b2c748a35ad284fd339eb8e2a6f3adf95307fbcd",
strip_prefix = "rules_python-0.16.2",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.16.2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
python_register_toolchains(
name = "python3_9",
# Available versions are listed in @rules_python//python:versions.bzl.
# We recommend using the same version your team is already standardized on.
python_version = "3.9",
)
load("@python3_9//:defs.bzl", "interpreter")
load("@rules_python//python:pip.bzl", "pip_parse")
# Create a central repo that knows about the dependencies needed from
# requirements_lock.txt.
pip_parse(
name = "svdpatch_deps",
python_interpreter_target = interpreter,
requirements_lock = "//tools/svd2drf:requirements.txt",
)
# Load the starlark macro which will define your dependencies.
load("@svdpatch_deps//:requirements.bzl", "install_deps")
# Call it to define repos for your requirements.
install_deps()
# Bazel Embedded (ARM GCC)
local_repository(
name = "bazel_embedded",
path = "bazel-embedded",
)
load("@bazel_embedded//:bazel_embedded_deps.bzl", "bazel_embedded_deps")
bazel_embedded_deps()
load("@bazel_embedded//platforms:execution_platforms.bzl", "register_platforms")
register_platforms()
load(
"@bazel_embedded//toolchains/compilers/gcc_arm_none_eabi:gcc_arm_none_repository.bzl",
"gcc_arm_none_compiler",
)
gcc_arm_none_compiler()
load("@bazel_embedded//toolchains/gcc_arm_none_eabi:gcc_arm_none_toolchain.bzl", "register_gcc_arm_none_toolchain")
register_gcc_arm_none_toolchain()
# compile_commands.json
# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
# https://github.com/SpoolFirmware/bazel-compile-commands-extractor with -mfpu=auto removal
http_archive(
name = "hedron_compile_commands",
# Replace the commit hash in both places (below) with the latest
url = "https://github.com/SpoolFirmware/bazel-compile-commands-extractor/archive/efefb12d54cfeedc0d6b705f2346496c69955fd5.tar.gz",
strip_prefix = "bazel-compile-commands-extractor-efefb12d54cfeedc0d6b705f2346496c69955fd5",
# When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'hedron_compile_commands' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
)
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
hedron_compile_commands_setup()