1# Copyright 2021 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15workspace( 16 name = "pigweed", 17) 18 19load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") 20load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 21load( 22 "//pw_env_setup/bazel/cipd_setup:cipd_rules.bzl", 23 "cipd_repository", 24) 25 26# Setup Fuchsia SDK. 27# Required by: bt-host. 28# Used in modules: //pw_bluetooth_sapphire. 29# NOTE: These blocks cannot feasibly be moved into a macro. 30# See https://github.com/bazelbuild/bazel/issues/1550 31git_repository( 32 name = "fuchsia_infra", 33 # ROLL: Warning: this entry is automatically updated. 34 # ROLL: Last updated 2024-11-16. 35 # ROLL: By https://cr-buildbucket.appspot.com/build/8731076857971632145. 36 commit = "a627dc11a73d74754d9a66a3b80b6f352c94d723", 37 remote = "https://fuchsia.googlesource.com/fuchsia-infra-bazel-rules", 38) 39 40load("@fuchsia_infra//:workspace.bzl", "fuchsia_infra_workspace") 41 42fuchsia_infra_workspace() 43 44FUCHSIA_SDK_VERSION = "version:25.20241025.4.1" 45 46cipd_repository( 47 name = "fuchsia_sdk", 48 path = "fuchsia/sdk/core/fuchsia-bazel-rules/linux-amd64", 49 tag = FUCHSIA_SDK_VERSION, 50) 51 52register_toolchains("@fuchsia_sdk//:fuchsia_toolchain_sdk") 53 54cipd_repository( 55 name = "fuchsia_products_metadata", 56 path = "fuchsia/development/product_bundles/v2", 57 tag = FUCHSIA_SDK_VERSION, 58) 59 60load("//pw_build/bazel_internal/fuchsia_sdk_workspace:products.bzl", "fuchsia_products_repository") 61 62fuchsia_products_repository( 63 name = "fuchsia_products", 64 metadata_file = "@fuchsia_products_metadata//:product_bundles.json", 65) 66 67cipd_repository( 68 name = "fuchsia_clang", 69 path = "fuchsia/development/fuchsia_clang/linux-amd64", 70 tag = "git_revision:aea60ab94db4729bad17daa86ccfc411d48a1699", 71) 72 73# TODO: b/354268150 - googletest is in the BCR, but its MODULE.bazel doesn't 74# express its dependency on the Fuchsia SDK correctly. 75git_repository( 76 name = "com_google_googletest", 77 commit = "3b6d48e8d5c1d9b3f9f10ac030a94008bfaf032b", 78 remote = "https://pigweed.googlesource.com/third_party/github/google/googletest", 79) 80 81# Required by fuzztest 82http_archive( 83 name = "com_googlesource_code_re2", 84 sha256 = "f89c61410a072e5cbcf8c27e3a778da7d6fd2f2b5b1445cd4f4508bee946ab0f", 85 strip_prefix = "re2-2022-06-01", 86 url = "https://github.com/google/re2/archive/refs/tags/2022-06-01.tar.gz", 87) 88 89# Required by fuzztest 90http_archive( 91 name = "com_google_absl", 92 sha256 = "338420448b140f0dfd1a1ea3c3ce71b3bc172071f24f4d9a57d59b45037da440", 93 strip_prefix = "abseil-cpp-20240116.0", 94 url = "https://github.com/abseil/abseil-cpp/releases/download/20240116.0/abseil-cpp-20240116.0.tar.gz", 95) 96 97# TODO: https://pwbug.dev/365103864 - Fuzztest is not in the BCR yet (also see 98# https://github.com/google/fuzztest/issues/950). 99http_archive( 100 name = "com_google_fuzztest", 101 strip_prefix = "fuzztest-6eb010c7223a6aa609b94d49bfc06ac88f922961", 102 url = "https://github.com/google/fuzztest/archive/6eb010c7223a6aa609b94d49bfc06ac88f922961.zip", 103) 104