blob: edb237df1626c9af71e25cefaecad040c04899c6 [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
workspace(name = "gpu")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Set up bazel skylib and its dependencies
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()
local_repository(
name = "platforms",
path = "third_party/platforms",
)
load("@platforms//host:extension.bzl", "host_platform_repo")
host_platform_repo(
name = "host_platforms",
)
local_repository(
name = "rules_license",
path = "third_party/rules_license",
)
local_repository(
name = "rules_python",
path = "third_party/rules_python",
)
# The fuchsia_infra repository provides rules which allow us to work inside of
# fuchsia's infrastructure.
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//infra:host_toolchains.bzl", "configure_fuchsia_clang_host_toolchain")
load("@fuchsia_infra//shac:shac.bzl", "shac_deps")
fuchsia_infra_workspace()
shac_deps()
# Create a common cipd binary which will be used to download prebuilts
cipd_tool_repository(
name = "cipd_tool",
)
# Fetch the Fuchsia SDK and register it as a repostiory. The version that is
# used is stored in the manifests/bazel_sdk.ensure file so it can be updated by
# our autoroller infrastructure. When the version changes bazel will fetch the
# new prebuilts.
cipd_repository(
name = "fuchsia_sdk",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:bazel_sdk.ensure",
)
# The fuchsia toolchain contains tools like ffx and fidlc.
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",
)
# Set up our 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 a clang toolchain which will be used to compile fuchsia targets
register_clang_toolchains()
# 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")
load("//:workspace.bzl", "gpu_deps")
gpu_deps()
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
python_register_toolchains(
name = "python3_10",
python_version = "3.10",
)
register_toolchains(
"@python3_10_toolchains//:all",
)
# Allows us to assemble a sherlock and nelson test product with a standard
# feature set.
# Used for the Vulkan CTS, since smart display companion images are too bloaty
# resulting in an unacceptably high flake rate.
cipd_repository(
name = "sherlock_partitions",
cipd_bin = "@cipd_tool//:cipd",
content_root = "config",
ensure_file = "//manifests:sherlock_partitions.ensure",
exports_files = True,
)
cipd_repository(
name = "nelson_partitions",
cipd_bin = "@cipd_tool//:cipd",
content_root = "config",
ensure_file = "//manifests:nelson_partitions.ensure",
exports_files = True,
)
cipd_repository(
name = "sherlock_board",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:sherlock_board.ensure",
exports_files = True,
)
cipd_repository(
name = "nelson_board",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:nelson_board.ensure",
exports_files = True,
)
cipd_repository(
name = "fuchsia_platform",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:fuchsia_platform.ensure",
exports_files = True,
)
LEGACY_BUNDLES_BUILD_CONTENT = """
filegroup(
name = "legacy_files",
srcs = glob(
["built/artifacts/obj/build/images/fuchsia/fuchsia/legacy/**/*"],
)
)
"""
cipd_repository(
name = "sherlock_legacy_bundles",
build_file_content = LEGACY_BUNDLES_BUILD_CONTENT,
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:sherlock_legacy_bundles.ensure",
exports_files = True,
)
cipd_repository(
name = "nelson_legacy_bundles",
build_file_content = LEGACY_BUNDLES_BUILD_CONTENT,
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:nelson_legacy_bundles.ensure",
exports_files = True,
)
# Vulkan Conformance Test Suite.
cipd_repository(
name = "vulkan_cts_arm64_no_args",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-arm64-no-args.ensure",
exports_files = True,
)
cipd_repository(
name = "vulkan_cts_arm64_split",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-arm64-split.ensure",
exports_files = True,
)
cipd_repository(
name = "vulkan_cts_arm64_unified",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-arm64-unified.ensure",
exports_files = True,
)
cipd_repository(
name = "vulkan_cts_arm64_zircon",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-arm64-zircon.ensure",
exports_files = True,
)
cipd_repository(
name = "vulkan_cts_x64_no_args",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-x64-no-args.ensure",
exports_files = True,
)
cipd_repository(
name = "vulkan_cts_x64_split",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-x64-split.ensure",
exports_files = True,
)
cipd_repository(
name = "vulkan_cts_x64_unified",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-x64-unified.ensure",
exports_files = True,
)
cipd_repository(
name = "vulkan_cts_x64_zircon",
cipd_bin = "@cipd_tool//:cipd",
ensure_file = "//manifests:vulkan-cts-x64-zircon.ensure",
exports_files = True,
)