-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMODULE.bazel
More file actions
583 lines (540 loc) · 23.3 KB
/
Copy pathMODULE.bazel
File metadata and controls
583 lines (540 loc) · 23.3 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# Update via
# bazel mod deps --lockfile_mode=update
# --lockfile_mode=refresh refreshes mutable fields
# Test via
# bazel mod deps --lockfile_mode=error
#
# See https://bazel.build/external/lockfile for more info
#
# File structure:
# - Module Definition
# - bazel_dep Listing
# - bazel_dep Notes
# - bazel_dep Overrides
# - bazel_dep Configuration
# - non-dep Changes
#
# Notes on this structure:
# - separated to keep the listing minimal
# - keep the dependencies sorted alphabetically
##########################################
# Module Definition
##########################################
##########################################
module(
name = "mchristen",
version = "",
)
##########################################
# bazel_dep Listing
##########################################
##########################################
# REMINDER: When adding dependencies, update the Notes section below and keep
# any overrides / configuration in their respective sections ordered alphabetically
# [BCR](https://registry.bazel.build/)
bazel_dep(name = "aspect_bazel_lib", version = "2.21.2")
bazel_dep(name = "aspect_rules_js", version = "3.2.3")
bazel_dep(name = "aspect_rules_lint", version = "2.7.2")
bazel_dep(name = "aspect_rules_py", version = "1.11.1")
bazel_dep(name = "bazel_env.bzl", version = "0.5.0")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.8.2")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1")
bazel_dep(name = "build_stack_rules_proto", version = "4.1.2")
bazel_dep(name = "emboss", version = "2026.0212.185041", repo_name = "com_google_emboss")
bazel_dep(name = "freertos", version = "11.1.0.bcr.3")
bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle")
bazel_dep(name = "gazelle_cc", version = "0.5.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "grpc", version = "1.83.0", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "hedron_compile_commands")
bazel_dep(name = "nanopb", version = "0.4.9.1", repo_name = "com_github_nanopb_nanopb")
bazel_dep(name = "pico-sdk")
bazel_dep(name = "pigweed")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "protobuf", version = "35.1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_multirun", version = "0.13.0")
bazel_dep(name = "rules_multitool", version = "1.11.1")
bazel_dep(name = "rules_mypy", version = "0.41.0")
bazel_dep(name = "rules_nodejs", version = "6.7.4")
bazel_dep(name = "rules_oci", version = "2.2.6")
bazel_dep(name = "rules_jvm_external", version = "7.1")
bazel_dep(name = "rules_platform", version = "0.1.0")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_python_gazelle_plugin", version = "2.2.0")
bazel_dep(name = "rules_python", version = "2.2.0")
bazel_dep(name = "rules_go", version = "0.60.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_rust", version = "0.70.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_uv", version = "0.88.0")
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
##########################################
# bazel_dep Notes
##########################################
##########################################
# (NOTE: We don't put the follow "Repo Notes" inline with the bazel_deps in
# order to keep them clean / immediately viewable)
# Repo Notes:
# - aspect_bazel_lib: https://registry.bazel.build/modules/aspect_bazel_lib
# - aspect_rules_js: https://registry.bazel.build/modules/aspect_rules_js
# - NOTE: We don't really use/support JS in this repo, and if you need to
# you'll have some more config to do, but we register rules_js here so we can
# use it to pull a few javascript packages used for repo tooling, like
# prettier for linting.
# - OPTIONAL: Customize Node.js version #########
# By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
# Optionally you can pin a different node version:
# bazel_dep(name = "rules_nodejs", version = "5.8.2")
# node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
# node.toolchain(node_version = "16.14.2")
# - aspect_rules_lint: https://registry.bazel.build/modules/aspect_rules_lint
# - Next, follow the install instructions for
# - linting: https://github.com/aspect-build/rules_lint/blob/v1.0.3/docs/linting.md
# - formatting: https://github.com/aspect-build/rules_lint/blob/v1.0.3/docs/formatting.md
# - aspect_rules_py: https://registry.bazel.build/modules/aspect_rules_py
# - bazel_env: https://registry.bazel.build/modules/bazel_env.bzl
# - recommended approach for tools in https://blog.aspect.build/bazel-devenv
# - bazel_skylib_gazelle_plugin: https://registry.bazel.build/modules/bazel_skylib_gazelle_plugin
# - bazel_skylib: https://registry.bazel.build/modules/bazel_skylib
# - Bazel rule helpers, including testing
# - buildifier_prebuilt:
# https://registry.bazel.build/modules/buildifier_prebuilt
# - Set up hermetic Buildifier tools
# - This is helpful because the old version used an http_archive to fetch the buildtools
# WORKSPACE, but it is incompatible with bzlmod Go toolchains. Instead let's just use
# a prebuilt version.
# - build_stack_rules_proto: https://registry.bazel.build/modules/build_stack_rules_proto
# - emboss: https://pigweed.googlesource.com/third_party/github/google/emboss
# - freertos
# - gazelle: https://github.com/bazel-contrib/bazel-gazelle
# - gazelle_cc: https://github.com/EngFlow/gazelle_cc
# - googletest: https://registry.bazel.build/modules/googletest
# - C++ test framework (Google Test + Google Mock)
# - https://google.github.io/googletest/
# - Use @googletest//:gtest_main for test binaries (provides main())
# - pw_unit_test uses the same gtest API, so syntax is uniform across host and embedded tests
# - grpc: https://registry.bazel.build/modules/grpc
# - repo_name = "com_github_grpc_grpc" to match what build_stack_rules_proto
# uses internally, so generated grpc_cc_library targets resolve from root
# - See https://github.com/michael-christen/toolbox/issues/40
# - hedron_compile_commands
# - nanopb
# - pico-sdk
# - pigweed: https://pigweed.dev/get_started/bazel_integration/setup.html
# - Example repo: https://cs.opensource.google/pigweed/quickstart/bazel
# - Not available in bcr at the moment
# - This is a LARGE framework, which does a lot of heavy lifting for us, but
# also buys us into several other dependencies, etc. and establishes limits
# on settings we take, eg) there is currently a [C++17
# limitation](https://pigweed.dev/style/cpp.html#c-standard)
# - Causes us to pull in several other dependencies (we've chosen the
# versions to match what pigweed uses)
# - freertos
# - nanopb
# - pico-sdk
# - platforms
# - rules_platform
# - There are others, which we use separately:
# - bazel_skylib
# - hedron_compile_commands
# - rules_cc
# - rules_mypy
# - rules_python
# - See
# https://cs.opensource.google/pigweed/quickstart/bazel/+/main:MODULE.bazel
# for recommendations on sub-dependencies
# - platforms: https://registry.bazel.build/modules/platforms
# - protobuf: https://registry.bazel.build/modules/protobuf
# - rules_cc: https://registry.bazel.build/modules/rules_cc
# - rules_multirun: https://registry.bazel.build/modules/rules_multirun
# - allow parallel invocations (see lint.sh)
# - rules_multitool: https://registry.bazel.build/modules/rules_multitool
# - rules_mypy: https://registry.bazel.build/modules/rules_mypy
# - rules_oci: https://registry.bazel.build/modules/rules_oci
# - rules_platform: https://registry.bazel.build/modules/rules_platform
# - Allow platform transitions
# - rules_proto: https://registry.bazel.build/modules/rules_proto
# - https://github.com/stackb/rules_proto
# - rules_python_gazelle_plugin: https://registry.bazel.build/modules/rules_python_gazelle_plugin
# - Note this is a sub-directory of the rules_python repo
# - rules_python: https://registry.bazel.build/modules/rules_python
# - https://github.com/bazelbuild/rules_python
# - See #55
# - rules_rust: https://registry.bazel.build/modules/rules_rust
# - rules_shell: https://registry.bazel.build/modules/rules_shell
# - rules_uv: https://registry.bazel.build/modules/rules_uv
# - toolchains_llvm: https://registry.bazel.build/modules/toolchains_llvm
# Considerations for the future
#
# TODO: Should add buf too
#
# TODO(#78): Consider re-enabling
# Alternative to gcc-toolchain: https://github.com/uber/hermetic_cc_toolchain
# http_archive(
# name = "aspect_gcc_toolchain",
# integrity = "sha256-iqcSkkfwbhKrNWeX957qE/I4fzKuj3GEB06OZAJ5Apk=",
# strip_prefix = "gcc-toolchain-0.6.0",
# urls = [
# "https://github.com/f0rmiga/gcc-toolchain/archive/refs/tags/0.6.0.tar.gz",
# ],
# )
#
# load("@aspect_gcc_toolchain//toolchain:repositories.bzl", "gcc_toolchain_dependencies")
#
# gcc_toolchain_dependencies()
#
# load("@aspect_gcc_toolchain//toolchain:defs.bzl", "ARCHS", "gcc_register_toolchain")
#
# gcc_register_toolchain(
# name = "gcc_toolchain_x86_64",
# target_arch = ARCHS.x86_64,
# )
##########################################
# bazel_dep Overrides
##########################################
##########################################
# (NOTE: We don't put the overrides in-line with the bazel_dep for readability)
# order to keep them clean / immediately viewable)
# Pigweed transitively pulls in flatbuffers, whose npm_translate_lock() call
# still passes the `root_package` attribute, which aspect_rules_js dropped in
# its 3.x line (we pin 3.2.3 for our own JS tooling). Patch it out; the
# pnpm_lock label's package ("ts") is inferred as the root by rules_js 3.x's
# workspace auto-discovery, so behavior is unchanged.
single_version_override(
module_name = "flatbuffers",
patch_strip = 1,
patches = ["//third_party/flatbuffers:flatbuffers_root_package.patch"],
version = "25.12.19",
)
# grpc (transitively, via envoy_api) pulls in googleapis, whose BCR overlay
# ships a no-op `switched_rules` extension (its own MODULE.bazel comment:
# "This extension is no longer used, but provided for compatibility").
# envoy_api's pin still does use_repo(switched_rules, "com_google_googleapis_imports")
# on it, which `bazel mod deps`/`bazel mod graph` fail to resolve since the
# no-op impl generates nothing (real builds never touch that repo, so this
# only breaks the lockfile-update workflow, not actual builds). Drop the
# dead use_repo call.
single_version_override(
module_name = "envoy_api",
patch_strip = 1,
patches = ["//third_party/envoy_api:drop_switched_rules_use_repo.patch"],
version = "0.0.0-20251216-6ef568c",
)
# build_stack_rules_proto (transitively, for its unused scalafmt toolchain)
# pulls in rules_scala 7.0.0, which references the native JavaInfo global
# removed in Bazel 9. 7.2.6 loads JavaInfo explicitly from rules_java.
single_version_override(
module_name = "rules_scala",
version = "7.2.6",
)
# emboss is now available in the BCR (pigweed switched to it in
# c98647dba, "bazel: Roll picotool, emboss for Bazel 9 compat") with the
# Bazel 9 CcInfo fix bundled, so no override is needed anymore; pigweed's
# own bazel_dep declaration resolves it via MVS.
# ================
# TODO: https://pwbug.dev/349880767 - Point this back to the upstream repo once this PR is merged.
archive_override(
module_name = "hedron_compile_commands",
integrity = "sha256-twHI8300PvX9eTiGi14d5+qtNaJ1xF0jW/6SSg1D738=",
strip_prefix = "bazel-compile-commands-extractor-163521345aa6366fd1ed801b989b668b5c806f69",
urls = ["https://github.com/chadnorvell/bazel-compile-commands-extractor/archive/163521345aa6366fd1ed801b989b668b5c806f69.tar.gz"],
)
git_override(
module_name = "pigweed",
# ROLL: Warning: this entry is automatically updated by
# ROLL: https://cr-buildbucket.appspot.com/builder/pigweed/quickstart.roll/pigweed-quickstart-bazel-roller
commit = "62bd30d9d8a0f9098fc57910c67fe89acf65c286",
remote = "https://pigweed.googlesource.com/pigweed/pigweed",
)
# pico-sdk 2.3.0's BCR module is broken: src/rp2_common/pico_stdio_usb/BUILD.bazel
# references //src/rp2_common/pico_usb_reset_interface, but that package has no
# BUILD.bazel in the 2.3.0 release (see #395). RyanDraves/pico-sdk's
# bazel-2.3.0-patch branch is 2.3.0 plus exactly that fix (drops the dead
# reference). Revert to a BCR-hosted version once upstream/BCR carries the fix.
#
# Separately, sections.h uses PICO_COMBINED_DOCS/PICO_XIP_RAM/LIB_PICO_LOW_POWER
# in #if/#elif without ever giving them a default definition anywhere in the
# SDK (unlike PICO_USE_XIP_CACHE_AS_RAM, which does get one) -- confirmed still
# present on pico-sdk's main branch too, so this is a genuine, separate
# upstream oversight, not something the fork above addresses. Patch in the
# same #ifndef/#define 0 guard pattern the SDK already uses elsewhere.
git_override(
module_name = "pico-sdk",
commit = "ef9ddf906bdee7de0ffe62bdab7d74cc67ae9c5d",
patch_strip = 1,
patches = ["//third_party/pico-sdk:undef_macro_guards.patch"],
remote = "https://github.com/RyanDraves/pico-sdk",
)
# `python.toolchain(python_version = "3.12.12", configure_coverage_tool = True)`
# below silently loses that coverage config: multiple deps (grpc, pigweed)
# also register unpinned `python_version = "3.12"` toolchains, which
# rules_python's MINOR_MAPPING resolves to the same "3.12.12", and
# rules_python keeps only the *first*-registered module's
# configure_coverage_tool value for a given resolved version (grpc's, which
# is False) -- see python/private/python.bzl's "first in the dependency
# graph wins" comment. The documented workaround,
# `single_version_platform_override(coverage_tool = ...)`, bypasses that
# precedence fight entirely, but it has its own bug: the tag's
# `coverage_tool` attr is typed `attr.label`, while `python_repository`'s
# `coverage_tool` attr expects a plain string, so passing the label through
# unconverted fails with a "expected value of type 'string'" error. Patch
# the one line that's missing str(...).
single_version_override(
module_name = "rules_python",
patch_strip = 1,
patches = ["//third_party/patches:rules_python_coverage_tool_override_str.patch"],
version = "2.2.0",
)
##########################################
# bazel_dep Configuration
##########################################
##########################################
##########
# pigweed
##########
# Register Pigweed's C++ toolchains.
register_toolchains(
"@pigweed//pw_toolchain:cc_toolchain_cortex-m0",
"@pigweed//pw_toolchain:cc_toolchain_cortex-m33",
"@pigweed//pw_toolchain/host_clang:host_cc_toolchain_linux",
"@pigweed//pw_toolchain/host_clang:host_cc_toolchain_macos",
dev_dependency = True,
)
#########
# maven
#########
# build_stack_rules_proto, grpc-java, protobuf, and bazel_worker_java all
# contribute their own maven.install() to the shared "maven" repo name,
# each with a different lock_file - this crashes `bazel mod deps`/`bazel
# mod tidy` (rules_jvm_external#issue: "There can only be one lock file
# for the repo maven"). Per rules_jvm_external's maven.bzl, "the root
# module always wins", so declaring our own here (matching
# build_stack_rules_proto's disambiguation-only artifact list) resolves
# the ambiguity. See #398.
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "maven",
artifacts = [
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.code.gson:gson:2.11.0",
"com.google.errorprone:error_prone_annotations:2.30.0",
"com.google.guava:guava:32.0.1-jre",
],
known_contributing_modules = [
"bazel_worker_java",
"build_stack_rules_proto",
"grpc-java",
"protobuf",
],
lock_file = "//:maven_install.json",
)
use_repo(maven, "maven")
###########
# rules_js
###########
# rules_js's default hermetic Node (from DEFAULT_NODE_VERSION in
# @rules_nodejs//nodejs:repositories.bzl) is too old to run current
# Renovate releases (tools/renovate:renovate needs >=24.11.0); pin to the
# same major version CI's actions/setup-node resolves to.
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "24.14.1")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
use_repo(pnpm, "pnpm")
##################
# rules_multitool
##################
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
multitool.hub(lockfile = "//:multitool.lock.json")
use_repo(multitool, "multitool")
#############
# rules_mypy
#############
types = use_extension("@rules_mypy//mypy:types.bzl", "types")
types.requirements(
name = "pip_types",
# `@toolbox_pip` in the next line corresponds to the `hub_name` when
# using rules_python's `pip.parse(...)`.
pip_requirements = "@toolbox_pip//:requirements.bzl",
# also legal to pass a `requirements.in` here
requirements_txt = "//:requirements_lock.txt",
)
use_repo(types, "pip_types")
############
# rules_oci
############
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
# tag = "latest",
digest = "sha256:f4a335ca209e1d2ee873102c17c389ad0142e3d5b21aee2817e9cc9c01d87d20",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64/v8",
],
)
oci.pull(
name = "ubuntu_base",
# tag = "24.04",
digest = "sha256:3131b4cc82a783df6c9df078f86e01819a13594b865c2cad47bd1bca2b7063bb",
image = "ubuntu",
platforms = [
"linux/amd64",
"linux/arm64/v8",
],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base", "distroless_base_linux_amd64", "distroless_base_linux_arm64_v8", "ubuntu_base", "ubuntu_base_linux_amd64", "ubuntu_base_linux_arm64_v8")
############
# rules_go
############
# gazelle's own bootstrap tooling (bazel_gazelle_go_repository_tools) requires
# a Go >= 1.24.12 toolchain as of gazelle 0.48.0 (pulled in transitively by
# pigweed). Register a matching SDK explicitly; the default resolved by
# rules_go alone was still 1.23.1.
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.24.12")
###############
# rules_python
###############
# Minimum version needs:
# feat: add interpreter_version_info to py_runtime by @mattem in #1671
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
# Must match interpreter_version in .bazelrc
# & mypy_cli in //:BUILD
# LINK(7e463bc3_e4d9_4464_ba39_3217c4a86004)
PYTHON_VERSION = "3.12.12"
python.toolchain(
configure_coverage_tool = True,
python_version = PYTHON_VERSION,
)
# See the `single_version_override(module_name = "rules_python", ...)` comment
# above for why this is needed: grpc's own unpinned `python_version = "3.12"`
# toolchain registration resolves to this same "3.12.12" and otherwise wins
# the race for which module's configure_coverage_tool value applies, so
# coverage silently never gets wired up for our toolchain. Explicitly
# providing coverage_tool here bypasses that precedence fight. This is the
# same coverage.py wheel rules_python's own coverage_deps.bzl would have
# used for cp312/x86_64-unknown-linux-gnu.
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "toolbox_py312_linux_x86_64_coverage",
build_file_content = """
filegroup(
name = "coverage",
srcs = ["coverage/__main__.py"],
data = glob(["coverage/*.py", "coverage/**/*.py", "coverage/*.so"]),
visibility = ["//visibility:public"],
)
""",
patch_args = ["-p1"],
patches = ["@rules_python//python/private:coverage.patch"],
sha256 = "c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca",
type = "zip",
urls = ["https://files.pythonhosted.org/packages/1f/0f/c890339dd605f3ebc269543247bdd43b703cce6825b5ed42ff5f2d6122c7/coverage-7.6.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl"],
)
python.single_version_platform_override(
coverage_tool = "@toolbox_py312_linux_x86_64_coverage//:coverage",
platform = "x86_64-unknown-linux-gnu",
python_version = PYTHON_VERSION,
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
# NOTE: hub_name is "toolbox_pip" rather than the more obvious "pip" because
# pip hub names must be unique across the whole module graph, and some
# dependencies (e.g. newer emboss releases) declare their own "pip" hub --
# see #402.
pip.parse(
# TODO(#209)
# Avoid building wheels with system compiler
# - pygraphviz
# download_only = True,
# Could put --extra-index-url here to grab my own wheels
# "--prefer-binary",
# "--only-binary=pygraphviz",
# extra_pip_args = [],
# TODO(#209): clang may not be available when building wheels, use clang
# instead (fix by not building here)
environment = {"CC": "gcc"},
# Avoid building wheels with system compiler
# - pygraphviz
# download_only = True,
# Could put --extra-index-url here to grab my own wheels
# extra_pip_args = [],
# https://rules-python.readthedocs.io/en/latest/pypi-dependencies.html
experimental_requirement_cycles = {
"openhtf": [
"openhtf",
# specify undeclared dependency on six
"six",
],
"networkx": [
"networkx",
"pygraphviz",
],
# panel 1.9.3 added panel-material-ui, which depends back on panel.
"panel": [
"panel",
"panel-material-ui",
],
},
hub_name = "toolbox_pip",
python_version = PYTHON_VERSION,
requirements_lock = "//:requirements_lock.txt",
)
# Could support multi-platform by specifying a different target for each
# platform
# --platform
# --python-version
# --implementation
# --abi
use_repo(pip, "toolbox_pip")
#############
# rules_rust
#############
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(edition = "2021")
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
crate = use_extension(
"@rules_rust//crate_universe:extension.bzl",
"crate",
)
crate.from_cargo(
name = "crate_index",
cargo_lockfile = "//:Cargo.lock",
manifests = [
"//:examples/basic/Cargo.toml",
],
)
use_repo(crate, "crate_index")
##################
# toolchains_llvm
##################
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
llvm_versions = {
"": "16.0.0",
"darwin-x86_64": "15.0.7",
},
)
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")
##########################################
# non-dep Changes
##########################################
##########################################
# Register our own toolchains
register_toolchains(
"//examples/bazel:foo_rude_toolchain",
"//examples/bazel:foo_nice_toolchain",
)