blob: 352da2ce7ec482d83698ce767f3e0c1fa8b47979 [file] [log] [blame]
# Copyright 2023 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# buildifier: disable=load-on-top
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
sha256 = "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
# Set up a hermetic python toolchain.
http_archive(
name = "rules_python",
sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311",
strip_prefix = "rules_python-0.31.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
py_repositories()
python_register_toolchains(
name = "python_3_11",
python_version = "3.11",
)
local_repository(
name = "fuchsia_infra",
path = "third_party/fuchsia-infra-bazel-rules",
)
load("@fuchsia_infra//:workspace.bzl", "fuchsia_infra_workspace")
load("@fuchsia_infra//cipd:defs.bzl", "cipd_repository", "cipd_tool_repository")
load("@fuchsia_infra//shac:shac.bzl", "shac_deps")
fuchsia_infra_workspace()
shac_deps()
cipd_tool_repository(
name = "cipd_tool",
)
cipd_repository(
name = "fuchsia_sdk",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:bazel_sdk.ensure",
)
load(
"@fuchsia_sdk//fuchsia:deps.bzl",
"rules_fuchsia_deps",
)
rules_fuchsia_deps()
register_toolchains("@fuchsia_sdk//:fuchsia_toolchain_sdk")
load(
"@fuchsia_sdk//fuchsia:products.bzl",
"fuchsia_products_repository",
)
fuchsia_products_repository(
name = "fuchsia_products",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:product_bundles.ensure",
)
load(
"@fuchsia_sdk//fuchsia:clang.bzl",
"fuchsia_clang_repository",
)
fuchsia_clang_repository(
name = "fuchsia_clang",
cipd_bin = "@cipd_tool//:cipd",
cipd_ensure_file = "//manifests:clang.ensure",
)
load("@fuchsia_clang//:defs.bzl", "register_clang_toolchains")
register_clang_toolchains()
load("@fuchsia_infra//infra:host_toolchains.bzl", "configure_fuchsia_clang_host_toolchain")
# Configure a host toolchain for local execution. This is not used to compile
# fuchsia targets but is made available so we don't try to access the host gcc
# which is not available in infrastructure builds. This call must happen after
# you create a fuchsia_clang repository.
configure_fuchsia_clang_host_toolchain(name = "host_clang_toolchain")
# gTest.
local_repository(
name = "com_google_googletest",
path = "third_party/googletest",
)
# Assembly Artifacts.
# This include partitions configs, boards, and platform assembly input bundles.
# These are used to assemble a test product.
cipd_repository(
name = "vim3_partitions",
cipd_bin = "@cipd_tool//:cipd",
content_root = "config",
ensure_file = "//manifests:vim3_partitions.ensure",
exports_files = True,
)
cipd_repository(
name = "vim3_board",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vim3_board.ensure",
exports_files = True,
)
cipd_repository(
name = "fuchsia_platform",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:fuchsia_platform.ensure",
exports_files = True,
)
cipd_repository(
name = "minimal_bundles",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:minimal_bundles.ensure",
exports_files = True,
)