blob: 9fdcc1a22b66dbc43d8bb946e617123560e7a6c7 [file] [edit]
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
module(
name = "ztests",
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_platform", version = "0.1.0")
bazel_dep(name = "rules_python", version = "1.8.3")
bazel_dep(name = "rules_cc", version = "0.2.16")
bazel_dep(name = "zephyr-bazel")
bazel_dep(name = "protobuf", version = "33.4")
# Module overrides
# ================
git_override(
module_name = "pigweed",
# ROLL: Warning: this entry is automatically updated by
# ROLL: https://cr-buildbucket.appspot.com/builder/pigweed/zephyr.roll/pigweed-zephyr-examples-roller
commit = "00f98514d13c512ba96b29214b4cd47a56cba846",
remote = "https://pigweed.googlesource.com/pigweed/pigweed",
)
# Toolchain registration
# ======================
# Register Pigweed's C++ toolchains.
register_toolchains(
"@pigweed//pw_toolchain/host_clang:host_cc_toolchain_linux",
"@pigweed//pw_toolchain/host_clang:host_cc_toolchain_macos",
"@zephyr-bazel//toolchain/arm:cortex-m_gcc_cc_cortex-m4",
dev_dependency = True,
)
local_path_override(
module_name = "zephyr-bazel",
path = "..",
)
zephyr_patch = use_extension("@zephyr-bazel//:setup.bzl", "zephyr_patch_file")
zephyr_patch.checkout(
# The autoroller is broken. Manually update on 2026-5-8.
commit = "684c9e8f32e4373a21098559f748f06915f950c9",
)
# Get access to the patched zephyr repo.
use_repo(zephyr_patch, "zephyr", "zephyr_version")
inject_repo(zephyr_patch, "hal_nordic")
inject_repo(zephyr_patch, "cmsis_6")
new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
new_git_repository(
name = "hal_nordic",
build_file = "@zephyr-bazel//modules:hal_nordic.BUILD",
commit = "7858281d843468fe53c829995fb63f45a227387a",
remote = "https://github.com/zephyrproject-rtos/hal_nordic.git",
)
new_git_repository(
name = "cmsis_6",
build_file = "@zephyr-bazel//modules:cmsis_6.BUILD",
commit = "30a859f44ef8ab4dc8f84b03ed586fd16ccf9d74",
remote = "https://github.com/zephyrproject-rtos/CMSIS_6.git",
)
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = True,
# Only set when you have multiple toolchain versions.
is_default = True,
python_version = "3.11",
)
use_repo(python, "pythons_hub")
# Pip dependencies are provided by zephyr-bazel
zephyr_setup = use_extension("@zephyr-bazel//:setup.bzl", "zephyr_setup")
zephyr_setup.env(
apps_dirs = ["@zephyr//tests:BUILD.bazel"],
boards_dirs = [],
manual_boards = [
"nrf52833dk/nrf52833",
"native_sim",
],
modules = [
"@hal_nordic//:zephyr/module.yml",
],
)
use_repo(
zephyr_setup,
"zephyr_index",
"zephyr_kconfig",
"zephyr_state",
)