# 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 = "pigweed", version = "0.0.1", ) bazel_dep(name = "aspect_bazel_lib", version = "2.11.0") bazel_dep(name = "aspect_rules_js", version = "2.1.3") bazel_dep(name = "bazel_skylib", version = "1.8.2") bazel_dep(name = "boringssl", version = "0.20241024.0") bazel_dep(name = "freertos", version = "10.5.1.bcr.2") bazel_dep(name = "fuzztest", version = "20250805.0") bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") # When this version is bumped, remove the patch referenced below if included bazel_dep(name = "googletest", version = "1.17.0.bcr.2", repo_name = "com_google_googletest") bazel_dep(name = "grpc-java", version = "1.69.0") bazel_dep(name = "nanopb", version = "0.4.9.1.bcr.2") bazel_dep(name = "mbedtls", version = "3.6.0") bazel_dep(name = "pico-sdk", version = "2.2.2-develop.bcr.20260105-1cc19a21") bazel_dep(name = "picotool", version = "2.2.0") bazel_dep(name = "platforms", version = "1.0.0") # LINT.IfChange(protobuf) bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf") # LINT.ThenChange(pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json,pw_env_setup/py/pw_env_setup/virtualenv_setup/constraint.list:protobuf) bazel_dep(name = "re2", version = "2025-11-05.bcr.1") bazel_dep(name = "rules_android", version = "0.6.0") bazel_dep(name = "rules_cc", version = "0.2.16") bazel_dep(name = "rules_fuzzing", version = "0.5.2") bazel_dep(name = "rules_go", version = "0.52.0", repo_name = "io_bazel_rules_go") bazel_dep(name = "rules_java", version = "8.6.1") bazel_dep(name = "rules_jni", version = "0.11.0") bazel_dep(name = "rules_jvm_external", version = "6.9") bazel_dep(name = "rules_libusb", version = "0.1.0-rc2.bcr.1") bazel_dep(name = "rules_license", version = "1.0.0") bazel_dep(name = "rules_nodejs", version = "6.3.3") bazel_dep(name = "rules_platform", version = "0.1.0") bazel_dep(name = "rules_probe_rs", version = "0.0.6") bazel_dep(name = "rules_python", version = "1.8.3") bazel_dep(name = "rules_rust", version = "0.68.1") bazel_dep(name = "rules_rust_prost", version = "0.68.1") bazel_dep(name = "rules_shell", version = "0.6.1") bazel_dep(name = "rules_doxygen", version = "2.4.2", dev_dependency = True) bazel_dep(name = "rules_mypy", version = "0.38.0", dev_dependency = True) # Repository overrides # ==================== single_version_override( module_name = "rules_rust", patch_strip = 1, patches = [ # Adds more thumbv6m, thumbv8m, and thumbv8m triples # TODO: https://pwbug.dev/392707726 - Upstream below patch "//pw_rust/bazel_patches:0003-Add-thumbv6m-and-more-thumbv7m-and-thumbv8m-triples.patch", ], ) single_version_override( module_name = "googletest", patch_strip = 1, patches = [ # This patches googletest to remove the Fuchsia syslog dependency (which is unused and deprecated) "//pw_build/bazel_patches:0001-Remove-unused-syslog-dependency-for-Fuchsia.patch", ], ) # Transitive deps not in BCR # ========================== http_archive = use_repo_rule( "@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", ) # TODO(b/370523804): Remove this once the following issues are addressed in a # released version of rules_fuzzing # https://github.com/bazel-contrib/rules_fuzzing/issues/257 non_module_dependencies = use_extension("@rules_fuzzing//fuzzing/private:extensions.bzl", "non_module_dependencies") use_repo( non_module_dependencies, "rules_fuzzing_oss_fuzz", ) git_repository = use_repo_rule( "@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", ) git_repository( name = "bazel_clang_tidy", commit = "db677011c7363509a288a9fb3bf0a50830bbf791", remote = "https://github.com/erenon/bazel_clang_tidy.git", ) # TODO: https://github.com/google/emboss/issues/164 - Wire up the emboss repo to # BCR. Currently there is an entry contributed by a community member, but it is # not up to date. # LINT.IfChange(emboss) git_repository( name = "com_google_emboss", remote = "https://pigweed.googlesource.com/third_party/github/google/emboss.git", tag = "v2025.1003.000719", ) # LINT.ThenChange(/pw_package/py/pw_package/packages/emboss.py:emboss) # Configure libusb # ================ # # The rules_libusb lets you configure which actual libusb version to use. libusb = use_extension("@rules_libusb//:extensions.bzl", "libusb") libusb.source_release(min_version = "1.0.27") use_repo(libusb, "libusb") xcode_sdk_repository = use_repo_rule("//pw_toolchain:xcode.bzl", "xcode_sdk_repository") xcode_sdk_repository( name = "macos_sysroot", build_file = "//pw_toolchain/host_clang:macos_sysroot.BUILD", ) cipd_client_repository = use_repo_rule("//pw_env_setup/bazel/cipd_setup:cipd_rules.bzl", "_cipd_client_repository") cipd_client_repository(name = "cipd_client") cipd_repository = use_repo_rule("//pw_env_setup/bazel/cipd_setup:cipd_rules.bzl", "cipd_repository") pw_cxx_toolchain = use_extension("//pw_toolchain/cc:pw_cxx_toolchain.bzl", "pw_cxx_toolchain") # Fetch llvm toolchain. # ROLL: Warning: this variable is automatically updated. # ROLL: Last updated 2026-03-17. # ROLL: By https://cr-buildbucket.appspot.com/build/8687120024257295665. LLVM_VERSION = "git_revision:9de31c4a3e77ceb1e736d4df3ae9e3f5a1dc8748" pw_cxx_toolchain.llvm(cipd_tag = LLVM_VERSION) pw_cxx_toolchain.arm_gcc(cipd_tag = "version:2@12.2.MPACBTI-Rel1.1") pw_cxx_toolchain.zephyr(cipd_tag = "version:3@0.17.0") use_repo(pw_cxx_toolchain, "gcc_arm_none_eabi_toolchain", "llvm_toolchain", "zephyr_toolchain") # Fetch linux sysroot for host builds. cipd_repository( name = "linux_sysroot", build_file = "//pw_toolchain/host_clang:linux_sysroot.BUILD", path = "fuchsia/third_party/sysroot/bionic", tag = "git_revision:702eb9654703a7cec1cadf93a7e3aa269d053943", ) register_toolchains( "//pw_toolchain:cc_toolchain_cortex-m0", "//pw_toolchain:cc_toolchain_cortex-m0plus", "//pw_toolchain:cc_toolchain_cortex-m33", "//pw_toolchain/arm_gcc:arm_gcc_cc_toolchain_cortex-m3", "//pw_toolchain/arm_gcc:arm_gcc_cc_toolchain_cortex-m4", "//pw_toolchain/host_clang:host_cc_toolchain_linux", "//pw_toolchain/host_clang:host_cc_toolchain_macos", "//pw_toolchain/riscv_clang:riscv_clang_cc_toolchain_rv32imc", "//pw_toolchain/riscv_clang:riscv_clang_cc_toolchain_rv32imac", dev_dependency = True, ) register_toolchains( "//pw_toolchain/fuchsia:all", dev_dependency = True, ) # Configure cc_compatibility_proxy cc_compatibility_proxy = use_extension("@rules_cc//cc:extensions.bzl", "compatibility_proxy") use_repo(cc_compatibility_proxy, "cc_compatibility_proxy") # Rust toolchains pw_rust = use_extension("//pw_toolchain/rust:extensions.bzl", "pw_rust") # ROLL: Warning: this variable is automatically updated. # ROLL: Last updated 2026-03-17. # ROLL: By https://cr-buildbucket.appspot.com/build/8687120024257295665. RUST_VERSION = "git_revisions:9f0615c4301206eeba76468f78d34876c4a2997e,9de31c4a3e77ceb1e736d4df3ae9e3f5a1dc8748" # TODO(b/488384121): Setup a roller # ROLL: Warning: this variable is automatically updated. # ROLL: Last updated 2026-03-07. # ROLL: By https://cr-buildbucket.appspot.com/build/8687956729258883537. RUST_ANALYZER_VERSION = "git_revision:a1b86d600f88be98643e5dd61d6ed26eda17c09e" pw_rust.toolchain( cipd_tag = RUST_VERSION, rust_analyzer_cipd_tag = RUST_ANALYZER_VERSION, ) 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 = "//third_party/crates_io/crates_no_std:Cargo.lock", manifests = ["//third_party/crates_io/crates_no_std:Cargo.toml"], # crate_universe's defaults do not include some embedded triples so the # triples are listed explicitly. supported_platform_triples = [ # Host platforms "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", # Target platforms "thumbv6m-none-eabi", "thumbv7m-none-eabi", "thumbv8m.main-none-eabihf", "aarch64-unknown-none", "riscv32imc-unknown-none-elf", "riscv32imac-unknown-none-elf", ], ) use_repo(crate, "crates_no_std") crate.from_cargo( name = "crates_std", cargo_lockfile = "//third_party/crates_io/crates_std:Cargo.lock", manifests = ["//third_party/crates_io/crates_std:Cargo.toml"], supported_platform_triples = [ # Host platforms "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", ], ) use_repo(crate, "crates_std") crate.annotation( crate = "protoc-gen-prost", gen_binaries = ["protoc-gen-prost"], repositories = ["crates_std"], ) pw_rust_crates = use_extension("@pigweed//pw_build:pw_rust_crates_extension.bzl", "pw_rust_crates_extension") use_repo(pw_rust_crates, "rust_crates") # Get probe-rs # ============ probe_rs = use_extension("@rules_probe_rs//probe_rs:extensions.bzl", "probe_rs") probe_rs.tools( name = "probe_rs", version = "0.27.0", ) use_repo(probe_rs, "probe_rs") # Configure Python toolchains and pip dependencies. # ================================================= python = use_extension("@rules_python//python/extensions:python.bzl", "python") python.toolchain( # Allows building as root in a docker container. Required by oss-fuzz. ignore_root_user_error = True, is_default = True, python_version = "3.12", ) use_repo(python, "pythons_hub") pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") pip.default( # This special "none_any_mcu" pip platform allows rules_python to find PIP # packages when the target platform is an MCU. However the MCU is not # actually expected to run any Python code. # # We must associate this platform with requirements files. We do so with # the pip configurations below, using upstream_requirements_linux_lock.txt. # The # # Behind the scenes rules_python is creating Bazel alias rules that # map each Python package to a repo using a select expression that uses # the targets (filtered to those that match the "target_platform" setting). # # The default for those select expressions is a special internal # "_no_matching_repository" match that generates an error. This is meant # to catch the pip repo not having a build for a given host target, but # isn't great for an MCU target that will never have a match. # # The only way to stop Bazel from triggering the error otherwise requires # ensuring no rules build anything that require the deps, using perhaps # a "target_compatible_with = incompatible_with_mcu()" attribute, but that # requires rules that support that attribute. With rules_python 1.8.3, its # own "py_console_script_binary" does not, which is why workaround is being # used. # A valid arch_name is required, but the value does not matter since this # configuration is for any target with @platforms//os:none arch_name = "aarch32", config_settings = [ "@platforms//os:none", ], os_name = "none", platform = "none_any_mcu", ) pip.parse( envsubst = ["PIGWEED_PIP_INDEX_URL"], experimental_index_url = "${PIGWEED_PIP_INDEX_URL:-https://pypi.org/simple}", hub_name = "pigweed_python_packages", python_version = "3.10", requirements_by_platform = { # All supported target_platforms, including none_any_mcu must have an # associated requirements file. "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_darwin_lock.txt": "osx_aarch64", "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_linux_lock.txt": "linux_x86_64,linux_aarch64,none_any_mcu", "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_windows_lock.txt": "windows_x86_64,windows_aarch64", }, target_platforms = [ "{os}_{arch}", "none_any_mcu", ], ) pip.parse( envsubst = ["PIGWEED_PIP_INDEX_URL"], experimental_index_url = "${PIGWEED_PIP_INDEX_URL:-https://pypi.org/simple}", hub_name = "pigweed_python_packages", python_version = "3.11", requirements_by_platform = { # All supported target_platforms, including none_any_mcu must have an # associated requirements file. "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_darwin_lock.txt": "osx_aarch64", "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_linux_lock.txt": "linux_x86_64,linux_aarch64,none_any_mcu", "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_windows_lock.txt": "windows_x86_64,windows_aarch64", }, target_platforms = [ "{os}_{arch}", "none_any_mcu", ], ) pip.parse( envsubst = ["PIGWEED_PIP_INDEX_URL"], experimental_index_url = "${PIGWEED_PIP_INDEX_URL:-https://pypi.org/simple}", hub_name = "pigweed_python_packages", python_version = "3.12", requirements_by_platform = { # All supported target_platforms, including none_any_mcu must have an # associated requirements file. "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_darwin_lock.txt": "osx_aarch64", "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_linux_lock.txt": "linux_x86_64,linux_aarch64,none_any_mcu", "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_windows_lock.txt": "windows_x86_64,windows_aarch64", }, target_platforms = [ "{os}_{arch}", "none_any_mcu", ], ) use_repo(pip, "pigweed_python_packages") types = use_extension("@rules_mypy//mypy:types.bzl", "types", dev_dependency = True) types.requirements( name = "pip_types", pip_requirements = "@pigweed_python_packages//:requirements.bzl", # TODO: b/248344378 - Technically we should use separate per-OS requirements # here. Support for this is added to rules_mypy in # https://github.com/theoremlp/rules_mypy/pull/110. In practice I don't # believe any of our -types repository dependencies are OS-specific at this # time. requirements_txt = "//pw_env_setup/py:pw_env_setup/virtualenv_setup/upstream_requirements_linux_lock.txt", ) use_repo(types, "pip_types") # TODO: b/354241571 - The next two lines are only required because the Fuchsia # SDK doesn't correctly restrict the target platform compatibility of all its # targets. We should remove them once the bug is fixed. register_toolchains("@pythons_hub//:all") register_toolchains("@rules_python//python/runtime_env_toolchains:all") # Configure Go dependencies # ========================= go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//:go.mod") use_repo(go_deps, "org_golang_google_grpc", "org_golang_google_grpc_examples", "org_golang_google_protobuf") # Configure Java dependencies # =========================== maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") maven.install( name = "pigweed_maven_deps", artifacts = [ "com.google.auto.value:auto-value-annotations:1.8.2", "com.google.auto.value:auto-value:1.8.2", "com.google.code.findbugs:jsr305:3.0.2", "com.google.flogger:flogger-system-backend:0.7.1", "com.google.flogger:flogger:0.7.1", "com.google.guava:failureaccess:1.0.2", "com.google.guava:guava:31.0.1-jre", "com.google.truth:truth:1.1.3", "org.mockito:mockito-core:4.1.0", ], repositories = [ "https://maven.google.com/", "https://jcenter.bintray.com/", "https://repo1.maven.org/maven2", ], ) use_repo(maven, "pigweed_maven_deps") # QEMU prebuilts # ============== cipd_repository( name = "qemu", build_file = "//third_party/qemu:qemu.BUILD", path = "fuchsia/third_party/qemu/${platform}", tag = "git_revision:1da8f3a3c53b604edfe0d55e475102640490549e", ) # Vendored libraries # ================== # TODO: https://pwbug.dev/378531541 - These are one-off external libraries that # are NOT in the BCR that downstream users may need to override/unify to their # expected version. # TODO: https://github.com/bazelbuild/bazel/issues/23077 - Make these # bazel_deps dev_dependencies once archive_override has a build_file argument. http_archive( name = "stm32f4xx_hal_driver", build_file = "//third_party/stm32cube:stm32_hal_driver.BUILD.bazel", sha256 = "d0427a3830f0c23dd4810952321b8209be7b3c50897d1fc2d79587435cc3a379", strip_prefix = "stm32f4xx-hal-driver-1.8.0", urls = ["https://github.com/STMicroelectronics/stm32f4xx-hal-driver/archive/refs/tags/v1.8.0.tar.gz"], ) http_archive( name = "cmsis_device_f4", build_file = "//third_party/stm32cube:cmsis_device.BUILD.bazel", sha256 = "1d9612ecaaab8708c88be2c9573927f2e5e9a911aa2c1427182b545ed5ed0fd6", strip_prefix = "cmsis-device-f4-2.6.8", urls = ["https://github.com/STMicroelectronics/cmsis-device-f4/archive/refs/tags/v2.6.8.tar.gz"], ) http_archive( name = "cmsis_core", build_file = "//third_party/stm32cube:cmsis_core.BUILD.bazel", sha256 = "32f226c31d7d1ff4a504404400603e047b99f405cd0c9a8f417f1f250251b829", strip_prefix = "cmsis-core-5.4.0_cm4", urls = ["https://github.com/STMicroelectronics/cmsis-core/archive/refs/tags/v5.4.0_cm4.tar.gz"], ) git_repository( name = "mcuxpresso", commit = "0cc0caa0c44fc9ceae1ad4c0a9e3b79e8b38d751", # temporary point to antmicro github fork until SDK generated files # will be pushed to: https://pigweed.googlesource.com/pigweed/mcuxpresso-sdk remote = "https://github.com/antmicro/mcuxpresso-sdk.git", ) git_repository( name = "smartfusion_mss", build_file = "//third_party/smartfusion_mss:smartfusion_mss.BUILD.bazel", commit = "052a2ed78fa2c7a1a7cdac5e4a988b03269d2b42", remote = "https://github.com/seank/smartfusion_mss", ) # Other Pigweed-specific dependencies # =================================== cipd_repository( name = "bloaty", path = "fuchsia/third_party/bloaty/${os=linux,mac}-amd64", tag = "git_revision:c057ba4f43db0506d4ba8c096925b054b02a8bd3", ) cipd_repository( name = "buildifier", path = "infra/3pp/tools/buildifier/${platform}", tag = "version:3@v8.2.1", ) # GN is only used to format GN build files. cipd_repository( name = "gn", path = "gn/gn/${platform}", tag = "git_revision:97b68a0bb62b7528bc3491c7949d6804223c2b82", ) # This is only used to get access to gofmt for code formatting. cipd_repository( name = "go", path = "infra/3pp/tools/go/${platform}", tag = "version:3@1.24.5", ) # Set up legacy pw_transfer test binaries. # Required by: pigweed. # Used in modules: //pw_transfer. cipd_repository( name = "pw_transfer_test_binaries", # Only ever needed if you run the pw_transfer unit tests. dev_dependency = True, path = "pigweed/pw_transfer_test_binaries/${os=linux}-${arch=amd64}", tag = "version:pw_transfer_test_binaries_528098d588f307881af83f769207b8e6e1b57520-linux-amd64-cipd.cipd", ) workspace_and_buildfile = use_repo_rule("//pw_build/bazel_internal:workspace_and_buildfile.bzl", "workspace_and_buildfile") workspace_and_buildfile( name = "pw_build_external_runfile_resource", build_file = "//pw_build:test_data/external_py_runfiles.BUILD", dev_dependency = True, ) local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository") local_repository( name = "pw_cc_compile_commands_test_external", dev_dependency = True, path = "pw_ide/bazel/compile_commands/test/external_repo", ) # Doxygen setup # ============= # Get executables. cipd_repository( name = "doxygen_linux_amd64", path = "pigweed/third_party/doxygen/linux-amd64", tag = "version:1.9.6-1", ) cipd_repository( name = "doxygen_mac_amd64", path = "pigweed/third_party/doxygen/mac-amd64", tag = "version:1.9.6-1", ) cipd_repository( name = "doxygen_mac_arm64", path = "pigweed/third_party/doxygen/mac-arm64", tag = "version:1.9.6", ) cipd_repository( name = "doxygen_windows_amd64", path = "pigweed/third_party/doxygen/windows-amd64", tag = "version:1.9.6-1", ) # Configure rules_doxygen to use our executables. doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension", dev_dependency = True) doxygen_extension.configuration( executable = "@doxygen_linux_amd64//:bin/doxygen", platform = "linux", ) doxygen_extension.configuration( executable = "@doxygen_mac_amd64//:doxygen", platform = "mac", ) doxygen_extension.configuration( executable = "@doxygen_mac_arm64//:doxygen", platform = "mac-arm", ) doxygen_extension.configuration( executable = "@doxygen_windows_amd64//:windows.exe", platform = "windows", ) use_repo(doxygen_extension, "doxygen") # Configure Node.js dependencies # ============================== node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) node.toolchain(node_version = "20.12.1") npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) npm.npm_translate_lock( name = "npm", data = [ "//:package.json", "//pw_async2/codelab/webui:package.json", "//pw_web:package.json", "//pw_web:pnpm-workspace.yaml", ], # Uncomment the following when pnpm lock file needs to be updated. # update_pnpm_lock = True, pnpm_lock = "//pw_web:pnpm-lock.yaml", ) use_repo(npm, "npm") pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") use_repo(pnpm, "pnpm") # Setup Fuchsia SDK. # ================== # Since `@fuchsia_infra` isn't a real BCR module and relies on `git_override` to bring in its # transitive dependencies, mark it as a `dev_dependency` for now. bazel_dep(name = "fuchsia_infra", dev_dependency = True) git_override( module_name = "fuchsia_infra", # ROLL: Warning: this entry is automatically updated by # ROLL: https://cr-buildbucket.appspot.com/builder/pigweed/tools.roll/fuchsia-infra-bazel-rules-roller commit = "e128163af6079a2b5f4ad2c27097ccb3bec1b260", remote = "https://fuchsia.googlesource.com/fuchsia-infra-bazel-rules", ) FUCHSIA_SDK_VERSION = "version:30.20260128.1.1" # Use `cipd_ext` and `fuchsia_clang_ext` from `@fuchsia_infra` to override `@fuchsia_infra`'s # instantiations of `@rules_fuchsia`, `@fuchsia_sdk` and `@fuchsia_clang`. # # This simultaneously allows: # - `@rules_fuchsia`/`@fuchsia_sdk` builddefs to have providers compatible with # `@fuchsia_infra` builddefs, # - the version of `@fuchsia_products` to be aligned with `@rules_fuchsia` and `@fuchsia_sdk`, # - not double-fetching large dependencies like `@fuchsia_sdk` and `@fuchsia_clang`, and # - decoupling `@fuchsia_infra` vs `@rules_fuchsia`/`@fuchsia_sdk` vs `@fuchsia_clang` versions. fuchsia_cipd_ext = use_extension("@fuchsia_infra//cipd:defs.bzl", "cipd_ext", dev_dependency = True) fuchsia_clang_ext = use_extension("@fuchsia_infra//:extensions.bzl", "fuchsia_clang_ext", dev_dependency = True) fuchsia_cipd_ext.repository( name = "rules_fuchsia", cipd_bin = "@cipd_client//:cipd", package = "fuchsia/development/rules_fuchsia", tag = FUCHSIA_SDK_VERSION, ) use_repo(fuchsia_cipd_ext, "rules_fuchsia") fuchsia_cipd_ext.repository( name = "fuchsia_sdk", cipd_bin = "@cipd_client//:cipd", package = "fuchsia/sdk/core/fuchsia-bazel-rules/linux-amd64", tag = FUCHSIA_SDK_VERSION, ) use_repo(fuchsia_cipd_ext, "fuchsia_sdk") cipd_repository( name = "fuchsia_products_metadata", dev_dependency = True, path = "fuchsia/development/product_bundles/v2", tag = FUCHSIA_SDK_VERSION, ) fuchsia_products_repository = use_repo_rule("@rules_fuchsia//fuchsia:products.bzl", "fuchsia_products_repository") fuchsia_products_repository( name = "fuchsia_products", dev_dependency = True, metadata_file = "@fuchsia_products_metadata//:product_bundles.json", ) fuchsia_clang_ext.cipd_tag( cipd_tag = LLVM_VERSION, ) use_repo(fuchsia_clang_ext, "fuchsia_clang") register_toolchains( "//pw_toolchain/fuchsia:fuchsia_sdk_toolchain", dev_dependency = True, ) fake_fuchsia_sdk_extension = use_extension("@com_google_googletest//:fake_fuchsia_sdk.bzl", "fuchsia_sdk", dev_dependency = True) override_repo(fake_fuchsia_sdk_extension, "fuchsia_sdk")