blob: 612b1790c827ac7a2b5cd5fa56b68b6b83b543f6 [file] [log] [blame]
# Copyright 2024 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.
module(
name = "maize",
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_rust", version = "0.54.1")
bazel_dep(name = "pigweed")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "pw_toolchain")
# Module overrides
# ================
git_override(
module_name = "pigweed",
commit = "0638a779a74de192d554411c09895fee9ad98e59",
remote = "https://pigweed.googlesource.com/pigweed/pigweed",
)
git_override(
module_name = "pw_toolchain",
commit = "0638a779a74de192d554411c09895fee9ad98e59",
remote = "https://pigweed.googlesource.com/pigweed/pigweed",
strip_prefix = "pw_toolchain_bazel",
)
single_version_override(
module_name = "rules_rust",
patch_strip = 1,
patches = [
# rules_rust does not contain thumbv6m and thumbv7m triples.
"//build/external:rules_rust-add-triples.patch",
],
)
# Toolchain registration
# ======================
# Register Pigweed's C++ toolchains.
register_toolchains(
"@pigweed//pw_toolchain:cc_toolchain_cortex-m0",
"@pigweed//pw_toolchain:cc_toolchain_cortex-m3",
"@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,
)
pw_rust = use_extension("@pigweed//pw_toolchain/rust:extensions.bzl", "pw_rust")
pw_rust.toolchain(cipd_tag = "rust_revision:bf9c7a64ad222b85397573668b39e6d1ab9f4a72")
use_repo(pw_rust, "pw_rust_toolchains")
register_toolchains(
"@pw_rust_toolchains//:all",
dev_dependency = True,
)
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.from_cargo(
name = "crates_no_std",
cargo_lockfile = "//build/crates_io/crates_no_std:Cargo.lock",
manifests = ["//build/crates_io/crates_no_std:Cargo.toml"],
)
use_repo(crate, "crates_no_std")
crate.from_cargo(
name = "crates_std",
cargo_lockfile = "//build/crates_io/crates_std:Cargo.lock",
manifests = ["//build/crates_io/crates_std:Cargo.toml"],
)
use_repo(crate, "crates_std")
local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
local_repository(name = "rust_crates", path = "build/crates_io/rust_crates")
pw_rust_crates = use_extension("@pigweed//pw_build:pw_rust_crates_extension.bzl", "pw_rust_crates_extension")
override_repo(pw_rust_crates, rust_crates = "rust_crates")
cipd_client_repository = use_repo_rule("@pigweed//pw_env_setup/bazel/cipd_setup:cipd_rules.bzl", "_cipd_client_repository")
cipd_client_repository(name = "cipd_client")
cipd_repository = use_repo_rule("@pigweed//pw_env_setup/bazel/cipd_setup:cipd_rules.bzl", "cipd_repository")
cipd_repository(
name = "qemu",
build_file = "//build/external:qemu.BUILD",
path = "fuchsia/third_party/qemu/${os}-${arch}",
tag = "git_revision:1600b9f46b1bd08b00fe86c46ef6dbb48cbe10d6",
)