diff options
author | Weijia He <hwj@google.com> | 2023-12-05 11:39:58 +0800 |
---|---|---|
committer | Weijia He <hwj@google.com> | 2023-12-05 11:39:58 +0800 |
commit | caaae39e6790dc07319f5027c5312cebcd840e0a (patch) | |
tree | b36493336c42e7a1834ceb28be9ae43b3f127bd6 | |
parent | 8e8cb370b437589e3f5509df1bde39096afe0f83 (diff) | |
download | libbootloader-caaae39e6790dc07319f5027c5312cebcd840e0a.tar.gz |
Use maybe to define local repositories.
This avoids repository redefinitions.
Bug: 312798837
Change-Id: Id7ad816bc43b91d123817350318092170d82d354
-rw-r--r-- | gbl/integration/aosp_u-boot-mainline/workspace.bzl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gbl/integration/aosp_u-boot-mainline/workspace.bzl b/gbl/integration/aosp_u-boot-mainline/workspace.bzl index 111a1cb..bb92010 100644 --- a/gbl/integration/aosp_u-boot-mainline/workspace.bzl +++ b/gbl/integration/aosp_u-boot-mainline/workspace.bzl @@ -17,6 +17,7 @@ This file contains rules and logic for setting up GBL workspace dependencies in u-boot-mainline branch. """ +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@gbl//toolchain:gbl_workspace_util.bzl", "android_rust_prebuilts", "gbl_llvm_prebuilts") load("@kernel_toolchain_info//:dict.bzl", "CLANG_VERSION") @@ -29,12 +30,14 @@ def define_gbl_workspace(name = None): Args: name (String): Placeholder for buildifier check. """ - native.local_repository( + maybe( + repo_rule = native.local_repository, name = "rules_rust", path = "external/bazelbuild-rules_rust", ) - native.local_repository( + maybe( + repo_rule = native.local_repository, name = "rules_license", path = "external/bazelbuild-rules_license", ) |