blob: 00dd3fe31fea8aa107dfe390862c6a8d964117b3 [file]
# Copyright 2025 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
load("@pigweed//pw_build:compatibility.bzl", "incompatible_with_mcu")
load("@rules_platform//platform_data:defs.bzl", "platform_data")
load("@rules_rust//rust:defs.bzl", "rust_binary")
load("//pw_build:python.bzl", "pw_py_binary")
load("//pw_kernel/tooling:code_size.bzl", "code_size")
rust_binary(
name = "system_assembler",
srcs = ["system_assembler.rs"],
edition = "2024",
tags = ["kernel"],
target_compatible_with = incompatible_with_mcu(),
deps = [
"@rust_crates//:anyhow",
"@rust_crates//:clap",
"@rust_crates//:object",
],
)
rust_binary(
name = "presubmit",
srcs = ["presubmit.rs"],
edition = "2024",
tags = ["kernel"],
target_compatible_with = incompatible_with_mcu(),
visibility = ["//visibility:public"],
deps = [
"@rust_crates//:cliclack",
],
)
pw_py_binary(
name = "qemu_runner",
srcs = ["qemu_runner.py"],
visibility = ["//visibility:public"],
deps = [
"//pw_tokenizer/py:detokenize",
"@qemu//:qemu-system-arm-runfiles",
"@qemu//:qemu-system-riscv32-runfiles",
"@rules_python//python/runfiles",
],
)
platform_data(
name = "qemu",
platform = "@bazel_tools//tools:host_platform",
target = ":qemu_runner",
visibility = ["//visibility:public"],
)
platform_data(
name = "serial_detokenizer",
platform = "@bazel_tools//tools:host_platform",
target = "//pw_tokenizer/py:serial_detokenizer",
)
# TODO: b/428960116 - migrate to bloaty
code_size(
name = "code_size",
binaries = [
"//pw_kernel/target/mps2_an505/threads/kernel:threads",
"//pw_kernel/target/mps2_an505/ipc/user:ipc",
"//pw_kernel/target/mps2_an505/wait_group:wait_group",
"//pw_kernel/target/qemu_virt_riscv32/threads/kernel:threads",
"//pw_kernel/target/qemu_virt_riscv32/ipc/user:ipc",
"//pw_kernel/target/qemu_virt_riscv32/wait_group:wait_group",
],
tags = ["kernel"],
)
rust_binary(
name = "qemu_tracing_test_runner",
srcs = ["qemu_tracing_test.rs"],
data = [
":qemu",
"//pw_kernel/tooling/k",
],
edition = "2024",
tags = ["kernel"],
target_compatible_with = incompatible_with_mcu(),
deps = [
"//pw_kernel/lib/pw_gdb_protocol",
"@rules_rust//tools/runfiles",
"@rust_crates//:clap",
"@rust_crates//:object",
"@rust_crates//:tokio",
"@rust_crates//:tokio-util",
],
)