From 08553c42a34c4d1123fd05ef67da1354fcb5bc78 Mon Sep 17 00:00:00 2001 From: Hongxin Liang Date: Thu, 7 Nov 2024 13:38:51 +0100 Subject: [PATCH] feat: Possible to skip cosign toolchains registration --- cosign/repositories.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cosign/repositories.bzl b/cosign/repositories.bzl index 06673f96..e949c431 100644 --- a/cosign/repositories.bzl +++ b/cosign/repositories.bzl @@ -38,7 +38,7 @@ cosign_repositories = repository_rule( ) # Wrapper macro around everything above, this is the primary API -def cosign_register_toolchains(name): +def cosign_register_toolchains(name, register = True): """Convenience macro for users which does typical setup. - create a repository for each built-in platform like "cosign_linux_amd64" - @@ -57,7 +57,8 @@ def cosign_register_toolchains(name): platform = platform, cosign_version = COSIGN_VERSIONS.keys()[0], ) - native.register_toolchains("@{}//:{}_toolchain".format(toolchain_name, platform)) + if register: + native.register_toolchains("@{}//:{}_toolchain".format(toolchain_name, platform)) toolchains_repo( name = toolchain_name,