diff --git a/.bazelci/config.yaml b/.bazelci/config.yaml index 3bf609560..84c7c9dad 100644 --- a/.bazelci/config.yaml +++ b/.bazelci/config.yaml @@ -4,35 +4,37 @@ tasks: platform: ubuntu2004 build_targets: - "//..." + - "@rules_foreign_cc_toolchains//..." test_targets: - "//..." rbe_ubuntu2004: platform: rbe_ubuntu2004 build_targets: - "//..." + - "@rules_foreign_cc_toolchains//..." test_targets: - "//..." macos: platform: macos build_targets: - "//..." + - "@rules_foreign_cc_toolchains//..." test_targets: - "//..." windows: platform: windows build_targets: - "//..." + - "@rules_foreign_cc_toolchains//..." test_targets: - "//..." # TODO: https://github.com/bazel-contrib/rules_foreign_cc/issues/495 - "-//test:shell_method_symlink_contents_to_dir_test" - "-//test:shell_script_inner_fun_test" build_flags: - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" test_flags: - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" ubuntu1804_examples_standalone: name: Examples (spawn_strategy=standalone) platform: ubuntu1804 @@ -54,8 +56,8 @@ tasks: - "--spawn_strategy=standalone" - "--noenable_bzlmod" - "--enable_workspace" - ubuntu2004_examples: - name: Examples + ubuntu2004_examples_no_bzlmod: + name: Examples (No Bzlmod) platform: ubuntu2004 working_directory: examples linux_targets: &linux_targets @@ -64,13 +66,11 @@ tasks: build_targets: *linux_targets test_targets: *linux_targets build_flags: - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" test_flags: - - "--noenable_bzlmod" - - "--enable_workspace" - ubuntu2004_examples_bzlmod: - name: Examples (bzlmod) + - "--config=no-bzlmod" + ubuntu2004_examples: + name: Examples platform: ubuntu2004 working_directory: examples linux_targets: &linux_targets_bzlmod @@ -80,10 +80,7 @@ tasks: - "-//cmake_android/..." build_targets: *linux_targets_bzlmod test_targets: *linux_targets_bzlmod - build_flags: - - "--enable_bzlmod" rbe_ubuntu2004_examples: - name: Examples platform: rbe_ubuntu2004 working_directory: examples rbe_targets: &rbe_targets @@ -95,6 +92,10 @@ tasks: - "-//:requirements_test" build_targets: *rbe_targets test_targets: *rbe_targets + build_flags: + - "--config=no-bzlmod" + test_flags: + - "--config=no-bzlmod" macos_examples_standalone: name: Examples (spawn_strategy=standalone) platform: macos @@ -112,16 +113,14 @@ tasks: - "dbg" - "--spawn_strategy=standalone" - "--noincompatible_enable_cc_toolchain_resolution" - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" test_targets: *macos_targets_standalone test_flags: - "-c" - "dbg" - "--spawn_strategy=standalone" - "--noincompatible_enable_cc_toolchain_resolution" - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" macos_examples: name: Examples platform: macos @@ -136,13 +135,11 @@ tasks: build_targets: *macos_targets build_flags: - "--noincompatible_enable_cc_toolchain_resolution" - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" test_targets: *macos_targets test_flags: - "--noincompatible_enable_cc_toolchain_resolution" - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" windows_examples: name: Examples platform: windows @@ -172,11 +169,9 @@ tasks: build_targets: *windows_targets test_targets: *windows_targets build_flags: - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" test_flags: - - "--noenable_bzlmod" - - "--enable_workspace" + - "--config=no-bzlmod" rbe_ubuntu2004_flags: name: Flags platform: rbe_ubuntu2004 diff --git a/.bazelrc b/.bazelrc index e69de29bb..2a05a094f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -0,0 +1,54 @@ +############################################################################### +## Bazel Configuration Flags +## +## `.bazelrc` is a Bazel configuration file. +## https://bazel.build/docs/best-practices#bazelrc-file +############################################################################### + +# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config +common --enable_platform_specific_config + +# Enable the only currently supported report type +# https://bazel.build/reference/command-line-reference#flag--combined_report +coverage --combined_report=lcov + +# Avoid fully cached builds reporting no coverage and failing CI +# https://bazel.build/reference/command-line-reference#flag--experimental_fetch_all_coverage_outputs +coverage --experimental_fetch_all_coverage_outputs + +# Required for some of the tests +# https://bazel.build/reference/command-line-reference#flag--experimental_cc_shared_library +common --experimental_cc_shared_library + +############################################################################### +## Incompatibility flags +############################################################################### + +# https://github.com/bazelbuild/bazel/issues/8195 +build --incompatible_disallow_empty_glob=true + +# https://github.com/bazelbuild/bazel/issues/12821 +build --nolegacy_external_runfiles + +# Required for cargo_build_script support before Bazel 7 +build --incompatible_merge_fixed_and_default_shell_env + +############################################################################### +## Bzlmod +############################################################################### + +# A configuration for disabling bzlmod. +common:no-bzlmod --noenable_bzlmod --enable_workspace + +# Disable the bzlmod lockfile, so we don't accidentally commit MODULE.bazel.lock +common --lockfile_mode=off + +############################################################################### +## Custom user flags +## +## This should always be the last thing in the `.bazelrc` file to ensure +## consistent behavior when setting flags in that file as `.bazelrc` files are +## evaluated top to bottom. +############################################################################### + +try-import %workspace%/user.bazelrc diff --git a/.gitignore b/.gitignore index ba46b0ff5..d6c9e03df 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,7 @@ bazelci.py ##### # Ignore all bazel-* symlinks. There is no full list since this can change # based on the name of the directory bazel is cloned into. +user.bazelrc /bazel-* /docs/bazel-* /examples/bazel-* diff --git a/MODULE.bazel b/MODULE.bazel index d8005946c..0c2feb374 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,4 +1,4 @@ -"bazel-contrib/rules_foreign_cc" +"""bazel-contrib/rules_foreign_cc""" module( name = "rules_foreign_cc", @@ -26,26 +26,15 @@ python = use_extension("@rules_python//python/extensions:python.bzl", "python") python.toolchain(python_version = "3.9") use_repo(python, "python_3_9") -tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools") +foreign_cc = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "foreign_cc") use_repo( - tools, - "cmake_3.23.2_toolchains", - "cmake_src", - "gettext_runtime", - "glib_dev", - "glib_src", - "gnumake_src", - "meson_src", - "ninja_1.12.1_toolchains", - "ninja_build_src", - "pkgconfig_src", + foreign_cc, "rules_foreign_cc_framework_toolchains", + "rules_foreign_cc_toolchains", ) register_toolchains( "@rules_foreign_cc_framework_toolchains//:all", - "@cmake_3.23.2_toolchains//:all", - "@ninja_1.12.1_toolchains//:all", + "@rules_foreign_cc_toolchains//:all", "@python_3_9//:all", - "@rules_foreign_cc//toolchains:all", ) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 017bfeca7..e7151ec7b 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -45,6 +45,13 @@ stardoc( deps = ["@rules_foreign_cc//foreign_cc:providers"], ) +stardoc( + name = "extensions_docs", + out = "src/extensions.md", + input = "@rules_foreign_cc//foreign_cc:extensions.bzl", + deps = ["@rules_foreign_cc//foreign_cc:extensions"], +) + DOCS_TARGETS = [ ":cmake_docs", ":ninja_docs", @@ -52,6 +59,7 @@ DOCS_TARGETS = [ ":configure_make_docs", ":meson_docs", ":providers_docs", + ":extensions_docs", ] build_test( diff --git a/docs/MODULE.bazel.lock b/docs/MODULE.bazel.lock index f9160002d..833d11d47 100644 --- a/docs/MODULE.bazel.lock +++ b/docs/MODULE.bazel.lock @@ -184,10 +184,10 @@ "recordedRepoMappingEntries": [] } }, - "@@rules_foreign_cc~//foreign_cc:extensions.bzl%tools": { + "@@rules_foreign_cc~//foreign_cc:extensions.bzl%foreign_cc": { "general": { - "bzlTransitiveDigest": "82gl0j2nuUSwR2DhSU4Mejqc+E1d+0SHmnz6jHQGxak=", - "usagesDigest": "iWj6btwJ+MsMEUdwPmGRjCwIkOzbbnx8NIo56/soHIM=", + "bzlTransitiveDigest": "k8QA+W+hlKmcJnnGCxGGCaDF53yTKXQhXXwdU/e/vyQ=", + "usagesDigest": "/c89WcT6buzEO7A3rvu5KY2t4LPwIboWVj3Bz/lMy1o=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -237,165 +237,6 @@ "ruleClassName": "framework_toolchain_repository_hub", "attributes": {} }, - "cmake_src": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", - "sha256": "f316b40053466f9a416adf981efda41b160ca859e97f6a484b447ea299ff26aa", - "strip_prefix": "cmake-3.23.2", - "urls": [ - "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2.tar.gz" - ], - "patches": [ - "@@rules_foreign_cc~//toolchains:cmake-c++11.patch" - ] - } - }, - "gnumake_src": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", - "sha256": "dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3", - "strip_prefix": "make-4.4.1", - "urls": [ - "https://mirror.bazel.build/ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz", - "http://ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz" - ] - } - }, - "ninja_build_src": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", - "integrity": "sha256-ghvf9Io/aDvEuztvC1/nstZHz2XVKutjMoyRpsbfKFo=", - "strip_prefix": "ninja-1.12.1", - "urls": [ - "https://mirror.bazel.build/github.com/ninja-build/ninja/archive/v1.12.1.tar.gz", - "https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz" - ] - } - }, - "meson_src": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "exports_files([\"meson.py\"])\n\nfilegroup(\n name = \"runtime\",\n srcs = glob([\"mesonbuild/**\"]),\n visibility = [\"//visibility:public\"],\n)\n", - "sha256": "567e533adf255de73a2de35049b99923caf872a455af9ce03e01077e0d384bed", - "strip_prefix": "meson-1.5.1", - "urls": [ - "https://mirror.bazel.build/github.com/mesonbuild/meson/releases/download/1.5.1/meson-1.5.1.tar.gz", - "https://github.com/mesonbuild/meson/releases/download/1.5.1/meson-1.5.1.tar.gz" - ] - } - }, - "glib_dev": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\ncc_import(\n name = \"glib_dev\",\n hdrs = glob([\"include/**\"]),\n shared_library = \"@glib_runtime//:bin/libglib-2.0-0.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", - "sha256": "bdf18506df304d38be98a4b3f18055b8b8cca81beabecad0eece6ce95319c369", - "urls": [ - "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip", - "https://download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip" - ] - } - }, - "glib_src": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\ncc_import(\n name = \"msvc_hdr\",\n hdrs = [\"msvc_recommended_pragmas.h\"],\n visibility = [\"//visibility:public\"],\n)\n ", - "sha256": "bc96f63112823b7d6c9f06572d2ad626ddac7eb452c04d762592197f6e07898e", - "strip_prefix": "glib-2.26.1", - "urls": [ - "https://mirror.bazel.build/download.gnome.org/sources/glib/2.26/glib-2.26.1.tar.gz", - "https://download.gnome.org/sources/glib/2.26/glib-2.26.1.tar.gz" - ] - } - }, - "glib_runtime": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\nexports_files(\n [\n \"bin/libgio-2.0-0.dll\",\n \"bin/libglib-2.0-0.dll\",\n \"bin/libgmodule-2.0-0.dll\",\n \"bin/libgobject-2.0-0.dll\",\n \"bin/libgthread-2.0-0.dll\",\n ],\n visibility = [\"//visibility:public\"],\n)\n ", - "sha256": "88d857087e86f16a9be651ee7021880b3f7ba050d34a1ed9f06113b8799cb973", - "urls": [ - "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip", - "https://download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip" - ] - } - }, - "gettext_runtime": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "\ncc_import(\n name = \"gettext_runtime\",\n shared_library = \"bin/libintl-8.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", - "sha256": "1f4269c0e021076d60a54e98da6f978a3195013f6de21674ba0edbc339c5b079", - "urls": [ - "https://mirror.bazel.build/download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip", - "https://download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip" - ] - } - }, - "pkgconfig_src": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", - "sha256": "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591", - "strip_prefix": "pkg-config-0.29.2", - "patches": [ - "@@rules_foreign_cc~//toolchains:pkgconfig-detectenv.patch", - "@@rules_foreign_cc~//toolchains:pkgconfig-makefile-vc.patch", - "@@rules_foreign_cc~//toolchains:pkgconfig-builtin-glib-int-conversion.patch" - ], - "urls": [ - "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz", - "https://mirror.bazel.build/pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz" - ] - } - }, - "bazel_features": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "ba1282c1aa1d1fffdcf994ab32131d7c7551a9bc960fbf05f42d55a1b930cbfb", - "strip_prefix": "bazel_features-1.15.0", - "url": "https://github.com/bazel-contrib/bazel_features/releases/download/v1.15.0/bazel_features-v1.15.0.tar.gz" - } - }, - "bazel_skylib": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "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" - ], - "sha256": "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728" - } - }, - "rules_python": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841", - "strip_prefix": "rules_python-0.23.1", - "url": "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.23.1.tar.gz" - } - }, - "rules_shell": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "sha256": "d8cd4a3a91fc1dc68d4c7d6b655f09def109f7186437e3f50a9b60ab436a0c53", - "strip_prefix": "rules_shell-0.3.0", - "url": "https://github.com/bazelbuild/rules_shell/releases/download/v0.3.0/rules_shell-v0.3.0.tar.gz" - } - }, "cmake-3.23.2-linux-aarch64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", @@ -572,6 +413,124 @@ }, "tool": "ninja" } + }, + "make_4.4.1_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3", + "strip_prefix": "make-4.4.1", + "urls": [ + "https://mirror.bazel.build/ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz", + "http://ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz" + ] + } + }, + "glib_dev": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"glib_dev\",\n hdrs = glob([\"include/**\"]),\n shared_library = \"@glib_runtime//:bin/libglib-2.0-0.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "bdf18506df304d38be98a4b3f18055b8b8cca81beabecad0eece6ce95319c369", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip", + "https://download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip" + ] + } + }, + "glib_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"msvc_hdr\",\n hdrs = [\"msvc_recommended_pragmas.h\"],\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "bc96f63112823b7d6c9f06572d2ad626ddac7eb452c04d762592197f6e07898e", + "strip_prefix": "glib-2.26.1", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/sources/glib/2.26/glib-2.26.1.tar.gz", + "https://download.gnome.org/sources/glib/2.26/glib-2.26.1.tar.gz" + ] + } + }, + "glib_runtime": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\nexports_files(\n [\n \"bin/libgio-2.0-0.dll\",\n \"bin/libglib-2.0-0.dll\",\n \"bin/libgmodule-2.0-0.dll\",\n \"bin/libgobject-2.0-0.dll\",\n \"bin/libgthread-2.0-0.dll\",\n ],\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "88d857087e86f16a9be651ee7021880b3f7ba050d34a1ed9f06113b8799cb973", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip", + "https://download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip" + ] + } + }, + "gettext_runtime": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"gettext_runtime\",\n shared_library = \"bin/libintl-8.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "1f4269c0e021076d60a54e98da6f978a3195013f6de21674ba0edbc339c5b079", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip", + "https://download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip" + ] + } + }, + "pkgconfig_0.29.2_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591", + "strip_prefix": "pkg-config-0.29.2", + "patches": [ + "@@rules_foreign_cc~//toolchains/patches:pkgconfig-detectenv.patch", + "@@rules_foreign_cc~//toolchains/patches:pkgconfig-makefile-vc.patch", + "@@rules_foreign_cc~//toolchains/patches:pkgconfig-builtin-glib-int-conversion.patch" + ], + "urls": [ + "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz", + "https://mirror.bazel.build/pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz" + ] + } + }, + "meson_1.5.1_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "exports_files([\"meson.py\"])\n\nfilegroup(\n name = \"runtime\",\n # NOTE: excluding __pycache__ is important to avoid rebuilding due to pyc\n # files, see https://github.com/bazel-contrib/rules_foreign_cc/issues/1342\n srcs = glob([\"mesonbuild/**\"], exclude = [\"**/__pycache__/*\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "567e533adf255de73a2de35049b99923caf872a455af9ce03e01077e0d384bed", + "strip_prefix": "meson-1.5.1", + "urls": [ + "https://mirror.bazel.build/github.com/mesonbuild/meson/releases/download/1.5.1/meson-1.5.1.tar.gz", + "https://github.com/mesonbuild/meson/releases/download/1.5.1/meson-1.5.1.tar.gz" + ] + } + }, + "rules_foreign_cc_toolchains": { + "bzlFile": "@@rules_foreign_cc~//foreign_cc:extensions.bzl", + "ruleClassName": "_foreign_cc_toolchain_repository", + "attributes": { + "toolchains": [ + "toolchain(\n name = \"cmake-3.23.2-linux-aarch64_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:aarch64\", \"@platforms//os:linux\"],\n toolchain = \"@cmake-3.23.2-linux-aarch64//:cmake_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:cmake_toolchain\",\n)\n", + "toolchain(\n name = \"cmake-3.23.2-linux-x86_64_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:x86_64\", \"@platforms//os:linux\"],\n toolchain = \"@cmake-3.23.2-linux-x86_64//:cmake_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:cmake_toolchain\",\n)\n", + "toolchain(\n name = \"cmake-3.23.2-macos-universal_toolchain\",\n exec_compatible_with = [\"@platforms//os:macos\"],\n toolchain = \"@cmake-3.23.2-macos-universal//:cmake_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:cmake_toolchain\",\n)\n", + "toolchain(\n name = \"cmake-3.23.2-windows-i386_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:x86_32\", \"@platforms//os:windows\"],\n toolchain = \"@cmake-3.23.2-windows-i386//:cmake_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:cmake_toolchain\",\n)\n", + "toolchain(\n name = \"cmake-3.23.2-windows-x86_64_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:x86_64\", \"@platforms//os:windows\"],\n toolchain = \"@cmake-3.23.2-windows-x86_64//:cmake_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:cmake_toolchain\",\n)\n", + "toolchain(\n name = \"ninja_1.12.1_linux_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:x86_64\", \"@platforms//os:linux\"],\n toolchain = \"@ninja_1.12.1_linux//:ninja_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:ninja_toolchain\",\n)\n", + "toolchain(\n name = \"ninja_1.12.1_linux-aarch64_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:aarch64\", \"@platforms//os:linux\"],\n toolchain = \"@ninja_1.12.1_linux-aarch64//:ninja_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:ninja_toolchain\",\n)\n", + "toolchain(\n name = \"ninja_1.12.1_mac_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:x86_64\", \"@platforms//os:macos\"],\n toolchain = \"@ninja_1.12.1_mac//:ninja_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:ninja_toolchain\",\n)\n", + "toolchain(\n name = \"ninja_1.12.1_mac_aarch64_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:aarch64\", \"@platforms//os:macos\"],\n toolchain = \"@ninja_1.12.1_mac_aarch64//:ninja_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:ninja_toolchain\",\n)\n", + "toolchain(\n name = \"ninja_1.12.1_win_toolchain\",\n exec_compatible_with = [\"@platforms//cpu:x86_64\", \"@platforms//os:windows\"],\n toolchain = \"@ninja_1.12.1_win//:ninja_tool\",\n toolchain_type = \"@rules_foreign_cc//toolchains:ninja_toolchain\",\n)\n", + "load(\"@rules_foreign_cc//foreign_cc/built_tools:make_build.bzl\", \"make_tool\")\nload(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\nmake_tool(\n name = \"make_tool\",\n srcs = \"@make_4.4.1_src//:all_srcs\",\n tags = [\"manual\"],\n)\n\nnative_tool_toolchain(\n name = \"built_make\",\n env = select({\n \"@platforms//os:windows\": {\"MAKE\": \"$(execpath :make_tool)/bin/make.exe\"},\n \"//conditions:default\": {\"MAKE\": \"$(execpath :make_tool)/bin/make\"},\n }),\n path = select({\n \"@platforms//os:windows\": \"$(execpath :make_tool)/bin/make.exe\",\n \"//conditions:default\": \"$(execpath :make_tool)/bin/make\",\n }),\n target = \":make_tool\",\n)\n\ntoolchain(\n name = \"built_make_toolchain\",\n toolchain = \":built_make\",\n toolchain_type = \"@rules_foreign_cc//toolchains:make_toolchain\",\n)\n", + "load(\"@rules_foreign_cc//foreign_cc/built_tools:pkgconfig_build.bzl\", \"pkgconfig_tool\")\nload(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npkgconfig_tool(\n name = \"pkgconfig_tool\",\n srcs = \"@pkgconfig_0.29.2_src//:all_srcs\",\n tags = [\"manual\"],\n)\n\nnative_tool_toolchain(\n name = \"built_pkgconfig\",\n env = select({\n \"@platforms//os:windows\": {\"PKG_CONFIG\": \"$(execpath :pkgconfig_tool)\"},\n \"//conditions:default\": {\"PKG_CONFIG\": \"$(execpath :pkgconfig_tool)/bin/pkg-config\"},\n }),\n path = select({\n \"@platforms//os:windows\": \"$(execpath :pkgconfig_tool)\",\n \"//conditions:default\": \"$(execpath :pkgconfig_tool)/bin/pkg-config\",\n }),\n target = \":pkgconfig_tool\",\n)\n\ntoolchain(\n name = \"built_pkgconfig_toolchain\",\n toolchain = \":built_pkgconfig\",\n toolchain_type = \"@rules_foreign_cc//toolchains:pkgconfig_toolchain\",\n)\n", + "load(\"@rules_foreign_cc//foreign_cc/built_tools:meson_build.bzl\", \"meson_tool\")\nload(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\nalias(\n name = \"meson_runtime\",\n actual = \"@meson_1.5.1_src//:runtime\",\n)\n\nalias(\n name = \"meson.py\",\n actual = \"@meson_1.5.1_src//:meson.py\",\n)\n\nmeson_tool(\n name = \"meson_tool\",\n data = [\":meson_runtime\"],\n main = \"//:meson.py\",\n tags = [\"manual\"],\n)\n\nnative_tool_toolchain(\n name = \"built_meson\",\n env = {\"MESON\": \"$(execpath :meson_tool)\"},\n path = \"$(execpath :meson_tool)\",\n target = \":meson_tool\",\n)\n\ntoolchain(\n name = \"built_meson_toolchain\",\n toolchain = \":built_meson\",\n toolchain_type = \"@rules_foreign_cc//toolchains:meson_toolchain\",\n)\n", + "native_tool_toolchain(\n name = \"preinstalled_m4\",\n env = select({\n \"@platforms//os:windows\": {\"M4\": \"m4.exe\"},\n \"//conditions:default\": {\"M4\": \"m4\"},\n }),\n path = select({\n \"@platforms//os:windows\": \"m4.exe\",\n \"//conditions:default\": \"m4\",\n }),\n)\n\ntoolchain(\n name = \"preinstalled_m4_toolchain\",\n toolchain = \":preinstalled_m4\",\n toolchain_type = \"@rules_foreign_cc//toolchains:m4_toolchain\",\n)\n", + "native_tool_toolchain(\n name = \"preinstalled_autoconf\",\n env = select({\n \"@platforms//os:windows\": {\"AUTOCONF\": \"autoconf.exe\"},\n \"//conditions:default\": {\"AUTOCONF\": \"autoconf\"},\n }),\n path = select({\n \"@platforms//os:windows\": \"autoconf.exe\",\n \"//conditions:default\": \"autoconf\",\n }),\n)\n\ntoolchain(\n name = \"preinstalled_autoconf_toolchain\",\n toolchain = \":preinstalled_autoconf\",\n toolchain_type = \"@rules_foreign_cc//toolchains:autoconf_toolchain\",\n)\n", + "native_tool_toolchain(\n name = \"preinstalled_automake\",\n env = select({\n \"@platforms//os:windows\": {\"AUTOMAKE\": \"automake.exe\"},\n \"//conditions:default\": {\"AUTOMAKE\": \"automake\"},\n }),\n path = select({\n \"@platforms//os:windows\": \"automake.exe\",\n \"//conditions:default\": \"automake\",\n }),\n)\n\ntoolchain(\n name = \"preinstalled_automake_toolchain\",\n toolchain = \":preinstalled_automake\",\n toolchain_type = \"@rules_foreign_cc//toolchains:automake_toolchain\",\n)\n", + "native_tool_toolchain(\n name = \"preinstalled_nmake\",\n path = \"nmake.exe\",\n)\n" + ] + } } }, "recordedRepoMappingEntries": [ diff --git a/docs/docs.bzl b/docs/docs.bzl deleted file mode 100644 index 3690e1dfc..000000000 --- a/docs/docs.bzl +++ /dev/null @@ -1,50 +0,0 @@ -"""A module exporting symbols for Stardoc generation.""" - -load( - "@rules_foreign_cc//foreign_cc:defs.bzl", - _boost_build = "boost_build", - _cmake = "cmake", - _cmake_variant = "cmake_variant", - _configure_make = "configure_make", - _configure_make_variant = "configure_make_variant", - _make = "make", - _make_variant = "make_variant", - _meson = "meson", - _meson_with_requirements = "meson_with_requirements", - _ninja = "ninja", -) -load( - "@rules_foreign_cc//foreign_cc:providers.bzl", - _ForeignCcArtifactInfo = "ForeignCcArtifactInfo", - _ForeignCcDepsInfo = "ForeignCcDepsInfo", -) -load("@rules_foreign_cc//foreign_cc:repositories.bzl", _rules_foreign_cc_dependencies = "rules_foreign_cc_dependencies") -load("@rules_foreign_cc//foreign_cc/built_tools:cmake_build.bzl", _cmake_tool = "cmake_tool") -load("@rules_foreign_cc//foreign_cc/built_tools:make_build.bzl", _make_tool = "make_tool") -load("@rules_foreign_cc//foreign_cc/built_tools:ninja_build.bzl", _ninja_tool = "ninja_tool") -load( - "@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", - _ToolInfo = "ToolInfo", - _native_tool_toolchain = "native_tool_toolchain", -) - -# Rules Foreign CC symbols -boost_build = _boost_build -cmake = _cmake -cmake_tool = _cmake_tool -cmake_variant = _cmake_variant -configure_make = _configure_make -configure_make_variant = _configure_make_variant -make = _make -make_tool = _make_tool -make_variant = _make_variant -meson = _meson -meson_with_requirements = _meson_with_requirements -native_tool_toolchain = _native_tool_toolchain -ninja = _ninja -ninja_tool = _ninja_tool -rules_foreign_cc_dependencies = _rules_foreign_cc_dependencies - -ForeignCcArtifactInfo = _ForeignCcArtifactInfo -ForeignCcDepsInfo = _ForeignCcDepsInfo -ToolInfo = _ToolInfo diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 01b241971..bc950f90c 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -7,3 +7,4 @@ - [make](make.md) - [meson](meson.md) - [ninja](ninja.md) + - [Extensions](extensions.md) diff --git a/examples/.bazelrc b/examples/.bazelrc index 3510abec7..38f035145 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -1,3 +1,25 @@ +############################################################################### +## Bazel Configuration Flags +## +## `.bazelrc` is a Bazel configuration file. +## https://bazel.build/docs/best-practices#bazelrc-file +############################################################################### + +# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config +common --enable_platform_specific_config + +# Enable the only currently supported report type +# https://bazel.build/reference/command-line-reference#flag--combined_report +coverage --combined_report=lcov + +# Avoid fully cached builds reporting no coverage and failing CI +# https://bazel.build/reference/command-line-reference#flag--experimental_fetch_all_coverage_outputs +coverage --experimental_fetch_all_coverage_outputs + +# Required for some of the tests +# https://bazel.build/reference/command-line-reference#flag--experimental_cc_shared_library +common --experimental_cc_shared_library + build --enable_platform_specific_config # Required by Meson on Windows @@ -19,3 +41,36 @@ test:windows --action_env=MSYS=winsymlinks:nativestrict build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain build:macos --crosstool_top=@local_config_apple_cc//:toolchain build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain + +############################################################################### +## Incompatibility flags +############################################################################### + +# https://github.com/bazelbuild/bazel/issues/8195 +build --incompatible_disallow_empty_glob=true + +# https://github.com/bazelbuild/bazel/issues/12821 +build --nolegacy_external_runfiles + +# Required for cargo_build_script support before Bazel 7 +build --incompatible_merge_fixed_and_default_shell_env + +############################################################################### +## Bzlmod +############################################################################### + +# A configuration for disabling bzlmod. +common:no-bzlmod --noenable_bzlmod --enable_workspace + +# Disable the bzlmod lockfile, so we don't accidentally commit MODULE.bazel.lock +common --lockfile_mode=off + +############################################################################### +## Custom user flags +## +## This should always be the last thing in the `.bazelrc` file to ensure +## consistent behavior when setting flags in that file as `.bazelrc` files are +## evaluated top to bottom. +############################################################################### + +try-import %workspace%/user.bazelrc diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index b13b893bc..aa5d2dfd3 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -4,12 +4,18 @@ local_path_override( path = "..", ) -tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools") -tools.cmake(version = "3.23.1") -tools.ninja(version = "1.11.1") +foreign_cc = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "foreign_cc") +foreign_cc.tools( + cmake = "3.23.1", + ninja = "1.11.1", +) use_repo( - tools, - "meson_src", + foreign_cc, + "rules_foreign_cc_toolchains" +) + +register_toolchains( + "@rules_foreign_cc_toolchains//:all", ) bazel_dep(name = "platforms", version = "0.0.6") diff --git a/examples/third_party/apr/apr_repositories.bzl b/examples/third_party/apr/apr_repositories.bzl index 83097c901..7264d2688 100644 --- a/examples/third_party/apr/apr_repositories.bzl +++ b/examples/third_party/apr/apr_repositories.bzl @@ -14,7 +14,7 @@ def apr_repositories(): # https://apachelounge.com/viewtopic.php?t=8260 Label("//apr:windows_winnt.patch"), ], - sha256 = "", + integrity = "sha256-M3X6Nl1nvPlF5StSy6B6vqV+9TD0Cygf++l3qSUTYds=", strip_prefix = "apr-1.7.5", urls = [ "https://mirror.bazel.build/www-eu.apache.org/dist/apr/apr-1.7.5.tar.gz", diff --git a/examples/third_party/bison/bison_repositories.bzl b/examples/third_party/bison/bison_repositories.bzl index 75920c295..b5caabc79 100644 --- a/examples/third_party/bison/bison_repositories.bzl +++ b/examples/third_party/bison/bison_repositories.bzl @@ -14,5 +14,5 @@ def bison_repositories(): "https://mirror.bazel.build/ftp.gnu.org/gnu/bison/bison-3.8.2.tar.gz", "https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.gz", ], - sha256 = "", + integrity = "sha256-BsnhO99+sk1M62tZIFpPZ8LH5yExGWREMP6C+9FKCrs=", ) diff --git a/foreign_cc/BUILD.bazel b/foreign_cc/BUILD.bazel index 0c965128f..6a0243711 100644 --- a/foreign_cc/BUILD.bazel +++ b/foreign_cc/BUILD.bazel @@ -64,8 +64,10 @@ bzl_library( srcs = ["extensions.bzl"], visibility = ["//visibility:public"], deps = [ - ":repositories", + "//foreign_cc/private/framework:toolchain", + "//toolchains:built_toolchains", "//toolchains:prebuilt_toolchains", + "//toolchains:preinstalled_toolchains", ], ) @@ -123,14 +125,14 @@ bzl_library( ) bzl_library( - name = "providers", - srcs = ["providers.bzl"], + name = "utils", + srcs = ["utils.bzl"], visibility = ["//visibility:public"], + deps = ["@rules_shell//shell:rules_bzl"], ) bzl_library( - name = "utils", - srcs = ["utils.bzl"], + name = "providers", + srcs = ["providers.bzl"], visibility = ["//visibility:public"], - deps = ["@rules_shell//shell:rules_bzl"], ) diff --git a/foreign_cc/extensions.bzl b/foreign_cc/extensions.bzl index f195d3af2..3f0bfc999 100644 --- a/foreign_cc/extensions.bzl +++ b/foreign_cc/extensions.bzl @@ -1,51 +1,247 @@ """Entry point for extensions used by bzlmod.""" -load("//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") -load("//toolchains:prebuilt_toolchains.bzl", "prebuilt_toolchains") +load("//foreign_cc/private/framework:toolchain.bzl", "register_framework_toolchains") +load( + "//toolchains:built_toolchains.bzl", + cmake_toolchain_built = "cmake_toolchain", + make_toolchain_built = "make_toolchain", + meson_toolchain_built = "meson_toolchain", + ninja_toolchain_built = "ninja_toolchain", + pkgconfig_toolchain_built = "pkgconfig_toolchain", +) +load( + "//toolchains:prebuilt_toolchains.bzl", + cmake_toolchain_prebuilt = "cmake_toolchains", + ninja_toolchain_prebuilt = "ninja_toolchains", +) +load( + "//toolchains:preinstalled_toolchains.bzl", + "preinstalled_toolchains", +) _DEFAULT_CMAKE_VERSION = "3.23.2" _DEFAULT_NINJA_VERSION = "1.12.1" +_DEFAULT_MESON_VERSION = "1.5.1" +_DEFAULT_MAKE_VERSION = "4.4.1" +_DEFAULT_PKG_CONFIG_VERSION = "0.29.2" + +_TOOL_TYPE_PREBUILT = "prebuilt" +_TOOL_TYPE_BUILT = "built" + +_tools = tag_class( + doc = "Tags for defining Foreign Cc toolchains.", + attrs = { + "name": attr.string( + doc = "The name of the tools repository.", + default = "rules_foreign_cc_toolchains", + ), + } | { + "cmake": attr.string( + doc = "The cmake version", + default = _DEFAULT_CMAKE_VERSION, + ), + "cmake_tool_type": attr.string( + doc = "The type of toolchain to use.", + values = [ + _TOOL_TYPE_PREBUILT, + _TOOL_TYPE_BUILT, + ], + default = _TOOL_TYPE_PREBUILT, + ), + "make": attr.string( + doc = "The make version.", + default = _DEFAULT_MAKE_VERSION, + ), + "make_tool_type": attr.string( + doc = "The type of toolchain to use.", + values = [ + _TOOL_TYPE_BUILT, + ], + default = _TOOL_TYPE_BUILT, + ), + "meson": attr.string( + doc = "The meson version.", + default = _DEFAULT_MESON_VERSION, + ), + "meson_tool_type": attr.string( + doc = "The type of toolchain to use.", + values = [ + _TOOL_TYPE_BUILT, + ], + default = _TOOL_TYPE_BUILT, + ), + "ninja": attr.string( + doc = "The ninja version", + default = _DEFAULT_NINJA_VERSION, + ), + "ninja_tool_type": attr.string( + doc = "The type of toolchain to use.", + values = [ + _TOOL_TYPE_PREBUILT, + _TOOL_TYPE_BUILT, + ], + default = _TOOL_TYPE_PREBUILT, + ), + "pkgconfig": attr.string( + doc = "The pkgconfig version.", + default = _DEFAULT_PKG_CONFIG_VERSION, + ), + "pkgconfig_tool_type": attr.string( + doc = "The type of toolchain to use.", + values = [ + _TOOL_TYPE_BUILT, + ], + default = _TOOL_TYPE_BUILT, + ), + }, +) -cmake_toolchain_version = tag_class(attrs = { - "version": attr.string(doc = "The cmake version", default = _DEFAULT_CMAKE_VERSION), -}) +_BUILD_FILE = """\ +load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") -ninja_toolchain_version = tag_class(attrs = { - "version": attr.string(doc = "The ninja version", default = _DEFAULT_NINJA_VERSION), -}) +package(default_visibility = ["//visibility:public"]) -def _init(module_ctx): - rules_foreign_cc_dependencies( +{toolchains} +""" + +_WORKSPACE_FILE = """\ +workspace(name = "{}") +""" + +def _foreign_cc_toolchain_repository_impl(repository_ctx): + repository_ctx.file("BUILD.bazel", _BUILD_FILE.format( + toolchains = "\n".join(repository_ctx.attr.toolchains), + )) + repository_ctx.file("WORKSPACE.bazel", _WORKSPACE_FILE.format( + repository_ctx.name, + )) + +_foreign_cc_toolchain_repository = repository_rule( + doc = "A rule for aliasing rules_foreign_cc toolchains.", + implementation = _foreign_cc_toolchain_repository_impl, + attrs = { + "toolchains": attr.string_list( + doc = "Toolchain definitions to render into the repository.", + mandatory = True, + ), + }, +) + +def _foreign_cc_impl(module_ctx): + # Defines `rules_foreign_cc_framework_toolchains` but with bzlmod + # users are required to register it themselves. + register_framework_toolchains( register_toolchains = False, - register_built_tools = True, - register_default_tools = False, - register_preinstalled_tools = False, - register_built_pkgconfig_toolchain = True, ) - versions = { - "cmake": _DEFAULT_CMAKE_VERSION, - "ninja": _DEFAULT_NINJA_VERSION, - } + cmake_prebuilt = {} + cmake_built = {} + ninja_prebuilt = {} + ninja_built = {} + make_built = {} + pkgconfig_built = {} + meson_built = {} + tags = [] for mod in module_ctx.modules: - if not mod.is_root: - for toolchain in mod.tags.cmake: - versions["cmake"] = toolchain.version + if mod.is_root: + tags.extend(mod.tags.tools) - for toolchain in mod.tags.ninja: - versions["ninja"] = toolchain.version + if not tags: + tags = [struct( + name = "rules_foreign_cc_toolchains", + cmake = _DEFAULT_CMAKE_VERSION, + cmake_tool_type = _TOOL_TYPE_PREBUILT, + make = _DEFAULT_MAKE_VERSION, + make_tool_type = _TOOL_TYPE_BUILT, + meson = _DEFAULT_MESON_VERSION, + meson_tool_type = _TOOL_TYPE_BUILT, + ninja = _DEFAULT_NINJA_VERSION, + ninja_tool_type = _TOOL_TYPE_PREBUILT, + pkgconfig = _DEFAULT_PKG_CONFIG_VERSION, + pkgconfig_tool_type = _TOOL_TYPE_BUILT, + )] - prebuilt_toolchains( - cmake_version = versions["cmake"], - ninja_version = versions["ninja"], - register_toolchains = False, - ) + for tag in tags: + toolchains = [] + + if tag.cmake_tool_type == _TOOL_TYPE_PREBUILT: + if tag.cmake not in cmake_prebuilt: + cmake_prebuilt[tag.cmake] = cmake_toolchain_prebuilt( + version = tag.cmake, + register_toolchains = False, + ) + + toolchains.extend(cmake_prebuilt[tag.cmake]) + + elif tag.cmake_tool_type == _TOOL_TYPE_BUILT: + if tag.cmake not in cmake_built: + cmake_built[tag.cmake] = cmake_toolchain_built( + name = "cmake_{}_src".format(tag.cmake), + version = tag.cmake, + register_toolchains = False, + ) + + toolchains.extend(cmake_built[tag.cmake]) + + if tag.ninja_tool_type == _TOOL_TYPE_PREBUILT: + if tag.ninja not in ninja_prebuilt: + ninja_prebuilt[tag.ninja] = ninja_toolchain_prebuilt( + version = tag.ninja, + register_toolchains = False, + ) + + toolchains.extend(ninja_prebuilt[tag.ninja]) + + elif tag.ninja_tool_type == _TOOL_TYPE_BUILT: + if tag.ninja not in ninja_built: + ninja_built[tag.ninja] = ninja_toolchain_built( + name = "ninja_{}_src".format(tag.ninja), + version = tag.ninja, + register_toolchains = False, + ) + + toolchains.extend(ninja_built[tag.ninja]) + + # The following only support built tools so their values will + # be directly stored + if tag.make not in make_built: + make_built[tag.make] = make_toolchain_built( + name = "make_{}_src".format(tag.make), + version = tag.make, + register_toolchains = False, + ) + toolchains.extend(make_built[tag.make]) + + if tag.pkgconfig not in pkgconfig_built: + pkgconfig_built[tag.pkgconfig] = pkgconfig_toolchain_built( + name = "pkgconfig_{}_src".format(tag.pkgconfig), + version = tag.pkgconfig, + register_toolchains = False, + ) + toolchains.extend(pkgconfig_built[tag.pkgconfig]) + + if tag.meson not in meson_built: + meson_built[tag.meson] = meson_toolchain_built( + name = "meson_{}_src".format(tag.meson), + version = tag.meson, + register_toolchains = False, + ) + toolchains.extend(meson_built[tag.meson]) + + toolchains.extend(preinstalled_toolchains( + register_toolchains = False, + )) + + _foreign_cc_toolchain_repository( + name = tag.name, + toolchains = toolchains, + ) -tools = module_extension( - implementation = _init, +foreign_cc = module_extension( + doc = "rules_foreign_cc bzlmod extensions.", + implementation = _foreign_cc_impl, tag_classes = { - "cmake": cmake_toolchain_version, - "ninja": ninja_toolchain_version, + "tools": _tools, }, ) diff --git a/foreign_cc/meson.bzl b/foreign_cc/meson.bzl index dcce35d8f..c1a886f0f 100644 --- a/foreign_cc/meson.bzl +++ b/foreign_cc/meson.bzl @@ -212,8 +212,8 @@ def meson_with_requirements(name, requirements, **kwargs): meson_tool( name = "meson_tool_for_{}".format(name), - main = "@meson_src//:meson.py", - data = ["@meson_src//:runtime"], + main = "@rules_foreign_cc_toolchains//:meson.py", + data = ["@rules_foreign_cc_toolchains//:meson_runtime"], requirements = requirements, tags = tags + ["manual"], ) diff --git a/foreign_cc/private/BUILD.bazel b/foreign_cc/private/BUILD.bazel index bb3318425..b65566d55 100644 --- a/foreign_cc/private/BUILD.bazel +++ b/foreign_cc/private/BUILD.bazel @@ -84,6 +84,13 @@ bzl_library( ], ) +bzl_library( + name = "detect_xcompile", + srcs = ["detect_xcompile.bzl"], + visibility = ["//foreign_cc:__subpackages__"], + deps = ["//foreign_cc/private/framework:platform"], +) + bzl_library( name = "run_shell_file_utils", srcs = ["run_shell_file_utils.bzl"], diff --git a/foreign_cc/repositories.bzl b/foreign_cc/repositories.bzl index 308a0dacb..af3d7db7c 100644 --- a/foreign_cc/repositories.bzl +++ b/foreign_cc/repositories.bzl @@ -4,6 +4,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("//foreign_cc/private/framework:toolchain.bzl", "register_framework_toolchains") load("//toolchains:toolchains.bzl", "built_toolchains", "prebuilt_toolchains", "preinstalled_toolchains") +load("//toolchains:workspace_legacy.bzl", "foreign_cc_toolchain_legacy_repository") # buildifier: disable=unnamed-macro def rules_foreign_cc_dependencies( @@ -63,6 +64,10 @@ def rules_foreign_cc_dependencies( register_framework_toolchains(register_toolchains = register_toolchains) + foreign_cc_toolchain_legacy_repository( + name = "rules_foreign_cc_toolchains", + ) + if register_toolchains: native.register_toolchains(*native_tools_toolchains) diff --git a/toolchains/BUILD.bazel b/toolchains/BUILD.bazel index 69d5c1400..583189116 100644 --- a/toolchains/BUILD.bazel +++ b/toolchains/BUILD.bazel @@ -69,31 +69,31 @@ current_autoconf_toolchain( toolchain( name = "built_cmake_toolchain", - toolchain = "//toolchains/private:built_cmake", + toolchain = "@rules_foreign_cc_toolchains//:built_cmake", toolchain_type = ":cmake_toolchain", ) toolchain( name = "built_ninja_toolchain", - toolchain = "//toolchains/private:built_ninja", + toolchain = "@rules_foreign_cc_toolchains//:built_ninja", toolchain_type = ":ninja_toolchain", ) toolchain( name = "built_make_toolchain", - toolchain = "//toolchains/private:built_make", + toolchain = "@rules_foreign_cc_toolchains//:built_make", toolchain_type = ":make_toolchain", ) toolchain( name = "built_meson_toolchain", - toolchain = "//toolchains/private:built_meson", + toolchain = "@rules_foreign_cc_toolchains//:built_meson", toolchain_type = ":meson_toolchain", ) toolchain( name = "built_pkgconfig_toolchain", - toolchain = "//toolchains/private:built_pkgconfig", + toolchain = "@rules_foreign_cc_toolchains//:built_pkgconfig", toolchain_type = ":pkgconfig_toolchain", ) @@ -101,7 +101,7 @@ toolchain( # is not defined before; registered from workspace_definitions.bzl#rules_foreign_cc_dependencies toolchain( name = "preinstalled_cmake_toolchain", - toolchain = "//toolchains/private:preinstalled_cmake", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_cmake", toolchain_type = ":cmake_toolchain", ) @@ -109,7 +109,7 @@ toolchain( # is not defined before; registered from workspace_definitions.bzl#rules_foreign_cc_dependencies toolchain( name = "preinstalled_ninja_toolchain", - toolchain = "//toolchains/private:preinstalled_ninja", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_ninja", toolchain_type = ":ninja_toolchain", ) @@ -117,7 +117,7 @@ toolchain( # is not defined before; registered from workspace_definitions.bzl#rules_foreign_cc_dependencies toolchain( name = "preinstalled_make_toolchain", - toolchain = "//toolchains/private:preinstalled_make", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_make", toolchain_type = ":make_toolchain", ) @@ -126,46 +126,52 @@ toolchain( exec_compatible_with = [ "@platforms//os:windows", ], - toolchain = "//toolchains/private:preinstalled_nmake", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_nmake", toolchain_type = ":make_toolchain", ) toolchain( name = "preinstalled_meson_toolchain", - toolchain = "//toolchains/private:preinstalled_meson", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_meson", toolchain_type = ":meson_toolchain", ) toolchain( name = "preinstalled_autoconf_toolchain", - toolchain = "//toolchains/private:preinstalled_autoconf", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_autoconf", toolchain_type = ":autoconf_toolchain", ) toolchain( name = "preinstalled_automake_toolchain", - toolchain = "//toolchains/private:preinstalled_automake", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_automake", toolchain_type = ":automake_toolchain", ) toolchain( name = "preinstalled_m4_toolchain", - toolchain = "//toolchains/private:preinstalled_m4", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_m4", toolchain_type = ":m4_toolchain", ) toolchain( name = "preinstalled_pkgconfig_toolchain", - toolchain = "//toolchains/private:preinstalled_pkgconfig", + toolchain = "@rules_foreign_cc_toolchains//:preinstalled_pkgconfig", toolchain_type = ":pkgconfig_toolchain", ) +bzl_library( + name = "bazel_tools_bzl", + srcs = [ + "@bazel_tools//tools:bzl_srcs", + ], +) + bzl_library( name = "built_toolchains", srcs = ["built_toolchains.bzl"], deps = [ - "@bazel_tools//tools/build_defs/repo:http.bzl", - "@bazel_tools//tools/build_defs/repo:utils.bzl", + ":bazel_tools_bzl", "@rules_foreign_cc//toolchains:cmake_versions", ], ) @@ -174,8 +180,7 @@ bzl_library( name = "prebuilt_toolchains", srcs = ["prebuilt_toolchains.bzl"], deps = [ - "@bazel_tools//tools/build_defs/repo:http.bzl", - "@bazel_tools//tools/build_defs/repo:utils.bzl", + ":bazel_tools_bzl", "@rules_foreign_cc//toolchains:prebuilt_toolchains_repository", ], ) @@ -197,4 +202,15 @@ bzl_library( bzl_library( name = "prebuilt_toolchains_repository", srcs = ["prebuilt_toolchains_repository.bzl"], + deps = [":bazel_tools_bzl"], +) + +bzl_library( + name = "preinstalled_toolchains", + srcs = ["preinstalled_toolchains.bzl"], +) + +bzl_library( + name = "workspace_legacy", + srcs = ["workspace_legacy.bzl"], ) diff --git a/toolchains/built_toolchains.bzl b/toolchains/built_toolchains.bzl index e2b5e5e51..bb93a4e38 100644 --- a/toolchains/built_toolchains.bzl +++ b/toolchains/built_toolchains.bzl @@ -30,27 +30,86 @@ filegroup( # buildifier: disable=unnamed-macro def built_toolchains(cmake_version, make_version, ninja_version, meson_version, pkgconfig_version, register_toolchains, register_built_pkgconfig_toolchain): """ - Register toolchains for built tools that will be built from source - + Registers toolchains for built tools that will be built from source. Args: - cmake_version: The CMake version to build - make_version: The Make version to build - ninja_version: The Ninja version to build - meson_version: The Meson version to build - pkgconfig_version: The pkg-config version to build - register_toolchains: If true, registers the toolchains via native.register_toolchains. Used by bzlmod - register_built_pkgconfig_toolchain: If true, the built pkgconfig toolchain will be registered. + cmake_version (str): The CMake version to build. + make_version (str): The Make version to build. + ninja_version (str): The Ninja version to build. + meson_version (str): The Meson version to build. + pkgconfig_version (str): The pkg-config version to build. + register_toolchains (bool): Whether to register the toolchains via native.register_toolchains. Used by bzlmod. + register_built_pkgconfig_toolchain (bool): Whether the built pkgconfig toolchain will be registered. """ - _cmake_toolchain(cmake_version, register_toolchains) - _make_toolchain(make_version, register_toolchains) - _ninja_toolchain(ninja_version, register_toolchains) - _meson_toolchain(meson_version, register_toolchains) + cmake_toolchain( + version = cmake_version, + register_toolchains = register_toolchains, + ) + make_toolchain( + version = make_version, + register_toolchains = register_toolchains, + ) + ninja_toolchain( + version = ninja_version, + register_toolchains = register_toolchains, + ) + meson_toolchain( + version = meson_version, + register_toolchains = register_toolchains, + ) if register_built_pkgconfig_toolchain: - _pkgconfig_toolchain(pkgconfig_version, register_toolchains) + pkgconfig_toolchain( + version = pkgconfig_version, + register_toolchains = register_toolchains, + ) + +_CMAKE_TOOLCHAIN_TEMPLATE = """\ +load("@rules_foreign_cc//foreign_cc/built_tools:cmake_build.bzl", "cmake_tool") +load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") -def _cmake_toolchain(version, register_toolchains): +cmake_tool( + name = "cmake_tool", + srcs = "@{name}//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_cmake", + env = select({{ + "@platforms//os:windows": {{"CMAKE": "$(execpath :cmake_tool)/bin/cmake.exe"}}, + "//conditions:default": {{"CMAKE": "$(execpath :cmake_tool)/bin/cmake"}}, + }}), + path = select({{ + "@platforms//os:windows": "$(execpath :cmake_tool)/bin/cmake.exe", + "//conditions:default": "$(execpath :cmake_tool)/bin/cmake", + }}), + target = ":cmake_tool", +) + +toolchain( + name = "built_cmake_toolchain", + toolchain = ":built_cmake", + toolchain_type = "@rules_foreign_cc//toolchains:cmake_toolchain", +) +""" + +def cmake_toolchain( + *, + version, + register_toolchains, + name = "cmake_src"): + """ + Registers a toolchain for CMake built from source. + + Args: + version (str): The version of CMake to use. + register_toolchains (bool): Whether to register the toolchains. + name (str, optional): The name of the toolchain. + + Returns: + list: Toolchain definitions. + """ if register_toolchains: native.register_toolchains( "@rules_foreign_cc//toolchains:built_cmake_toolchain", @@ -63,7 +122,7 @@ def _cmake_toolchain(version, register_toolchains): sha256 = cmake_meta[2] maybe( http_archive, - name = "cmake_src", + name = name, build_file_content = _ALL_CONTENT, sha256 = sha256, strip_prefix = prefix, @@ -72,11 +131,58 @@ def _cmake_toolchain(version, register_toolchains): Label("//toolchains/patches:cmake-c++11.patch"), ], ) - return + return [_CMAKE_TOOLCHAIN_TEMPLATE.format( + name = name, + )] fail("Unsupported cmake version: " + str(version)) -def _make_toolchain(version, register_toolchains): +_MAKE_TOOLCHAIN_TEMPLATE = """\ +load("@rules_foreign_cc//foreign_cc/built_tools:make_build.bzl", "make_tool") +load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") + +make_tool( + name = "make_tool", + srcs = "@{name}//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_make", + env = select({{ + "@platforms//os:windows": {{"MAKE": "$(execpath :make_tool)/bin/make.exe"}}, + "//conditions:default": {{"MAKE": "$(execpath :make_tool)/bin/make"}}, + }}), + path = select({{ + "@platforms//os:windows": "$(execpath :make_tool)/bin/make.exe", + "//conditions:default": "$(execpath :make_tool)/bin/make", + }}), + target = ":make_tool", +) + +toolchain( + name = "built_make_toolchain", + toolchain = ":built_make", + toolchain_type = "@rules_foreign_cc//toolchains:make_toolchain", +) +""" + +def make_toolchain( + *, + version, + register_toolchains, + name = "gnumake_src"): + """ + Registers a toolchain for GNU Make built from source. + + Args: + version (str): The version of GNU Make to use. + register_toolchains (bool): Whether to register the toolchains. + name (str, optional): The name of the toolchain. + + Returns: + list: Toolchain definitions. + """ if register_toolchains: native.register_toolchains( "@rules_foreign_cc//toolchains:built_make_toolchain", @@ -85,7 +191,7 @@ def _make_toolchain(version, register_toolchains): if version == "4.4.1": maybe( http_archive, - name = "gnumake_src", + name = name, build_file_content = _ALL_CONTENT, sha256 = "dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3", strip_prefix = "make-4.4.1", @@ -94,12 +200,12 @@ def _make_toolchain(version, register_toolchains): "http://ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz", ], ) - return + return [_MAKE_TOOLCHAIN_TEMPLATE.format(name = name)] if version == "4.4": maybe( http_archive, - name = "gnumake_src", + name = name, build_file_content = _ALL_CONTENT, sha256 = "581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18", strip_prefix = "make-4.4", @@ -108,11 +214,12 @@ def _make_toolchain(version, register_toolchains): "http://ftpmirror.gnu.org/gnu/make/make-4.4.tar.gz", ], ) - return + return [_MAKE_TOOLCHAIN_TEMPLATE.format(name = name)] + if version == "4.3": maybe( http_archive, - name = "gnumake_src", + name = name, build_file_content = _ALL_CONTENT, patches = [Label("//toolchains/patches:make-reproducible-bootstrap.patch")], sha256 = "e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19", @@ -122,11 +229,56 @@ def _make_toolchain(version, register_toolchains): "http://ftpmirror.gnu.org/gnu/make/make-4.3.tar.gz", ], ) - return + return [_MAKE_TOOLCHAIN_TEMPLATE.format(name = name)] fail("Unsupported make version: " + str(version)) -def _ninja_toolchain(version, register_toolchains): +_NINJA_TOOLCHAIN_TEMPLATE = """\ +load("//foreign_cc/built_tools:ninja_build.bzl", "ninja_tool") +load("//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") + +ninja_tool( + name = "ninja_tool", + srcs = "@{name}//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_ninja", + env = select({{ + "@platforms//os:windows": {{"NINJA": "$(execpath :ninja_tool)/bin/ninja.exe"}}, + "//conditions:default": {{"NINJA": "$(execpath :ninja_tool)/bin/ninja"}}, + }}), + path = select({{ + "@platforms//os:windows": "$(execpath :ninja_tool)/bin/ninja.exe", + "//conditions:default": "$(execpath :ninja_tool)/bin/ninja", + }}), + target = ":ninja_tool", +) + +toolchain( + name = "built_ninja_toolchain", + toolchain = ":built_ninja", + toolchain_type = "@rules_foreign_cc//toolchains:ninja_toolchain", +) +""" + +def ninja_toolchain( + *, + version, + register_toolchains, + name = "ninja_build_src"): + """ + Registers a toolchain for Ninja built from source. + + Args: + version (str): The version of Ninja to use. + register_toolchains (bool): Whether to register the toolchains. + name (str, optional): The name of the toolchain. + + Returns: + list: Toolchain definitions. + """ if register_toolchains: native.register_toolchains( "@rules_foreign_cc//toolchains:built_ninja_toolchain", @@ -134,7 +286,7 @@ def _ninja_toolchain(version, register_toolchains): if version == "1.12.1": maybe( http_archive, - name = "ninja_build_src", + name = name, build_file_content = _ALL_CONTENT, integrity = "sha256-ghvf9Io/aDvEuztvC1/nstZHz2XVKutjMoyRpsbfKFo=", strip_prefix = "ninja-1.12.1", @@ -143,11 +295,11 @@ def _ninja_toolchain(version, register_toolchains): "https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz", ], ) - return + return [_NINJA_TOOLCHAIN_TEMPLATE.format(name = name)] if version == "1.12.0": maybe( http_archive, - name = "ninja_build_src", + name = name, build_file_content = _ALL_CONTENT, integrity = "sha256-iyyGzUg9x/y3l1xexzKRNdIQCZqJvH2wWQoHsLv+SaU=", strip_prefix = "ninja-1.12.0", @@ -156,11 +308,11 @@ def _ninja_toolchain(version, register_toolchains): "https://github.com/ninja-build/ninja/archive/v1.12.0.tar.gz", ], ) - return + return [_NINJA_TOOLCHAIN_TEMPLATE.format(name = name)] if version == "1.11.1": maybe( http_archive, - name = "ninja_build_src", + name = name, build_file_content = _ALL_CONTENT, sha256 = "31747ae633213f1eda3842686f83c2aa1412e0f5691d1c14dbbcc67fe7400cea", strip_prefix = "ninja-1.11.1", @@ -169,11 +321,11 @@ def _ninja_toolchain(version, register_toolchains): "https://github.com/ninja-build/ninja/archive/v1.11.1.tar.gz", ], ) - return + return [_NINJA_TOOLCHAIN_TEMPLATE.format(name = name)] if version == "1.11.0": maybe( http_archive, - name = "ninja_build_src", + name = name, build_file_content = _ALL_CONTENT, sha256 = "3c6ba2e66400fe3f1ae83deb4b235faf3137ec20bd5b08c29bfc368db143e4c6", strip_prefix = "ninja-1.11.0", @@ -182,11 +334,11 @@ def _ninja_toolchain(version, register_toolchains): "https://github.com/ninja-build/ninja/archive/v1.11.0.tar.gz", ], ) - return + return [_NINJA_TOOLCHAIN_TEMPLATE.format(name = name)] if version == "1.10.2": maybe( http_archive, - name = "ninja_build_src", + name = name, build_file_content = _ALL_CONTENT, sha256 = "ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed", strip_prefix = "ninja-1.10.2", @@ -195,11 +347,61 @@ def _ninja_toolchain(version, register_toolchains): "https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz", ], ) - return + return [_NINJA_TOOLCHAIN_TEMPLATE.format(name = name)] fail("Unsupported ninja version: " + str(version)) -def _meson_toolchain(version, register_toolchains): +_MESON_TOOLCHAIN_TEMPLATE = """\ +load("@rules_foreign_cc//foreign_cc/built_tools:meson_build.bzl", "meson_tool") +load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") + +alias( + name = "meson_runtime", + actual = "@{name}//:runtime", +) + +alias( + name = "meson.py", + actual = "@{name}//:meson.py", +) + +meson_tool( + name = "meson_tool", + data = [":meson_runtime"], + main = "//:meson.py", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_meson", + env = {{"MESON": "$(execpath :meson_tool)"}}, + path = "$(execpath :meson_tool)", + target = ":meson_tool", +) + +toolchain( + name = "built_meson_toolchain", + toolchain = ":built_meson", + toolchain_type = "@rules_foreign_cc//toolchains:meson_toolchain", +) +""" + +def meson_toolchain( + *, + version, + register_toolchains, + name = "meson_src"): + """ + Registers a toolchain for Meson built from source. + + Args: + version (str): The version of Meson to use. + register_toolchains (bool): Whether to register the toolchains. + name (str, optional): The name of the toolchain. + + Returns: + list: Toolchain definitions. + """ if register_toolchains: native.register_toolchains( "@rules_foreign_cc//toolchains:built_meson_toolchain", @@ -207,7 +409,7 @@ def _meson_toolchain(version, register_toolchains): if version == "1.5.1": maybe( http_archive, - name = "meson_src", + name = name, build_file_content = _MESON_BUILD_FILE_CONTENT, sha256 = "567e533adf255de73a2de35049b99923caf872a455af9ce03e01077e0d384bed", strip_prefix = "meson-1.5.1", @@ -216,11 +418,11 @@ def _meson_toolchain(version, register_toolchains): "https://github.com/mesonbuild/meson/releases/download/1.5.1/meson-1.5.1.tar.gz", ], ) - return + return [_MESON_TOOLCHAIN_TEMPLATE.format(name = name)] if version == "1.1.1": maybe( http_archive, - name = "meson_src", + name = name, build_file_content = _MESON_BUILD_FILE_CONTENT, sha256 = "d04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c", strip_prefix = "meson-1.1.1", @@ -229,11 +431,11 @@ def _meson_toolchain(version, register_toolchains): "https://github.com/mesonbuild/meson/releases/download/1.1.1/meson-1.1.1.tar.gz", ], ) - return + return [_MESON_TOOLCHAIN_TEMPLATE.format(name = name)] if version == "0.63.0": maybe( http_archive, - name = "meson_src", + name = name, build_file_content = _MESON_BUILD_FILE_CONTENT, sha256 = "3b51d451744c2bc71838524ec8d96cd4f8c4793d5b8d5d0d0a9c8a4f7c94cd6f", strip_prefix = "meson-0.63.0", @@ -242,11 +444,63 @@ def _meson_toolchain(version, register_toolchains): "https://github.com/mesonbuild/meson/releases/download/0.63.0/meson-0.63.0.tar.gz", ], ) - return + return [_MESON_TOOLCHAIN_TEMPLATE.format(name = name)] fail("Unsupported meson version: " + str(version)) -def _pkgconfig_toolchain(version, register_toolchains): +_PKGCONFIG_TOOLCHAIN_TEMPLATE = """\ +load("@rules_foreign_cc//foreign_cc/built_tools:pkgconfig_build.bzl", "pkgconfig_tool") +load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") + +pkgconfig_tool( + name = "pkgconfig_tool", + srcs = "@{name}//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_pkgconfig", + env = select({{ + "@platforms//os:windows": {{"PKG_CONFIG": "$(execpath :pkgconfig_tool)"}}, + "//conditions:default": {{"PKG_CONFIG": "$(execpath :pkgconfig_tool)/bin/pkg-config"}}, + }}), + path = select({{ + "@platforms//os:windows": "$(execpath :pkgconfig_tool)", + "//conditions:default": "$(execpath :pkgconfig_tool)/bin/pkg-config", + }}), + target = ":pkgconfig_tool", +) + +toolchain( + name = "built_pkgconfig_toolchain", + toolchain = ":built_pkgconfig", + toolchain_type = "@rules_foreign_cc//toolchains:pkgconfig_toolchain", +) +""" + +def pkgconfig_toolchain( + *, + version, + register_toolchains, + name = "pkgconfig_src", + glib_dev_name = "glib_dev", + glib_src_name = "glib_src", + glib_runtime_name = "glib_runtime", + gettext_runtime_name = "gettext_runtime"): + """Registers a toolchain for pkgconfig built from source. + + Args: + version (str): The version of Ninja to use. + register_toolchains (bool): Whether to register the toolchains. + name (str, optional): The name of the toolchain. + glib_dev_name (str, optional): The name of the toolchain. + glib_src_name (str, optional): The name of the toolchain. + glib_runtime_name (str, optional): The name of the toolchain. + gettext_runtime_name (str, optional): The name of the toolchain. + + Returns: + list: Toolchain definitions. + """ if register_toolchains: native.register_toolchains( "@rules_foreign_cc//toolchains:built_pkgconfig_toolchain", @@ -254,15 +508,15 @@ def _pkgconfig_toolchain(version, register_toolchains): maybe( http_archive, - name = "glib_dev", - build_file_content = ''' + name = glib_dev_name, + build_file_content = """ cc_import( name = "glib_dev", hdrs = glob(["include/**"]), shared_library = "@glib_runtime//:bin/libglib-2.0-0.dll", visibility = ["//visibility:public"], ) - ''', + """, sha256 = "bdf18506df304d38be98a4b3f18055b8b8cca81beabecad0eece6ce95319c369", urls = [ "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip", @@ -272,14 +526,14 @@ cc_import( maybe( http_archive, - name = "glib_src", - build_file_content = ''' + name = glib_src_name, + build_file_content = """ cc_import( name = "msvc_hdr", hdrs = ["msvc_recommended_pragmas.h"], visibility = ["//visibility:public"], ) - ''', + """, sha256 = "bc96f63112823b7d6c9f06572d2ad626ddac7eb452c04d762592197f6e07898e", strip_prefix = "glib-2.26.1", urls = [ @@ -290,8 +544,8 @@ cc_import( maybe( http_archive, - name = "glib_runtime", - build_file_content = ''' + name = glib_runtime_name, + build_file_content = """ exports_files( [ "bin/libgio-2.0-0.dll", @@ -302,7 +556,7 @@ exports_files( ], visibility = ["//visibility:public"], ) - ''', + """, sha256 = "88d857087e86f16a9be651ee7021880b3f7ba050d34a1ed9f06113b8799cb973", urls = [ "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip", @@ -312,14 +566,14 @@ exports_files( maybe( http_archive, - name = "gettext_runtime", - build_file_content = ''' + name = gettext_runtime_name, + build_file_content = """ cc_import( name = "gettext_runtime", shared_library = "bin/libintl-8.dll", visibility = ["//visibility:public"], ) - ''', + """, sha256 = "1f4269c0e021076d60a54e98da6f978a3195013f6de21674ba0edbc339c5b079", urls = [ "https://mirror.bazel.build/download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip", @@ -329,7 +583,7 @@ cc_import( if version == "0.29.2": maybe( http_archive, - name = "pkgconfig_src", + name = name, build_file_content = _ALL_CONTENT, sha256 = "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591", strip_prefix = "pkg-config-0.29.2", @@ -349,6 +603,6 @@ cc_import( "https://mirror.bazel.build/pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz", ], ) - return + return [_PKGCONFIG_TOOLCHAIN_TEMPLATE.format(name = name)] fail("Unsupported pkgconfig version: " + str(version)) diff --git a/toolchains/prebuilt_toolchains.bzl b/toolchains/prebuilt_toolchains.bzl index 5a32d329c..692c6659a 100644 --- a/toolchains/prebuilt_toolchains.bzl +++ b/toolchains/prebuilt_toolchains.bzl @@ -6,7 +6,7 @@ This file is generated by prebuilt_toolchains.py load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("@rules_foreign_cc//toolchains:prebuilt_toolchains_repository.bzl", "prebuilt_toolchains_repository") +load("//toolchains:prebuilt_toolchains_repository.bzl", "maybe_prebuilt_toolchains_repository") _CMAKE_BUILD_FILE = """\ load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") @@ -70,10 +70,26 @@ def prebuilt_toolchains(cmake_version, ninja_version, register_toolchains): ninja_version (string): The target ninja-build version register_toolchains (boolean): Whether to call native.register_toolchains or not """ - _cmake_toolchains(cmake_version, register_toolchains) - _ninja_toolchains(ninja_version, register_toolchains) + cmake_toolchains( + version = cmake_version, + register_toolchains = register_toolchains, + ) + ninja_toolchains( + version = ninja_version, + register_toolchains = register_toolchains, + ) -def _cmake_toolchains(version, register_toolchains): +# buildifier: disable=unnamed-macro +def cmake_toolchains(*, version, register_toolchains): + """Define repositories needed to register cmake toolchains for a given version. + + Args: + version (string): The CMake version to use. + register_toolchains (boolean): Whether to call native.register_toolchains or not + + Returns: + list: Toolchain definitions. + """ if "3.31.0" == version: maybe( http_archive, @@ -145,9 +161,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.31.0_toolchains//:cmake-3.31.0-linux-aarch64_toolchain", + "@cmake_3.31.0_toolchains//:cmake-3.31.0-linux-x86_64_toolchain", + "@cmake_3.31.0_toolchains//:cmake-3.31.0-macos-universal_toolchain", + "@cmake_3.31.0_toolchains//:cmake-3.31.0-windows-i386_toolchain", + "@cmake_3.31.0_toolchains//:cmake-3.31.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.31.0_toolchains", repos = { "cmake-3.31.0-linux-aarch64": [ @@ -173,17 +197,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.31.0_toolchains//:cmake-3.31.0-linux-aarch64_toolchain", - "@cmake_3.31.0_toolchains//:cmake-3.31.0-linux-x86_64_toolchain", - "@cmake_3.31.0_toolchains//:cmake-3.31.0-macos-universal_toolchain", - "@cmake_3.31.0_toolchains//:cmake-3.31.0-windows-i386_toolchain", - "@cmake_3.31.0_toolchains//:cmake-3.31.0-windows-x86_64_toolchain", - ) - - return - if "3.31.1" == version: maybe( http_archive, @@ -255,9 +268,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.31.1_toolchains//:cmake-3.31.1-linux-aarch64_toolchain", + "@cmake_3.31.1_toolchains//:cmake-3.31.1-linux-x86_64_toolchain", + "@cmake_3.31.1_toolchains//:cmake-3.31.1-macos-universal_toolchain", + "@cmake_3.31.1_toolchains//:cmake-3.31.1-windows-i386_toolchain", + "@cmake_3.31.1_toolchains//:cmake-3.31.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.31.1_toolchains", repos = { "cmake-3.31.1-linux-aarch64": [ @@ -283,17 +304,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.31.1_toolchains//:cmake-3.31.1-linux-aarch64_toolchain", - "@cmake_3.31.1_toolchains//:cmake-3.31.1-linux-x86_64_toolchain", - "@cmake_3.31.1_toolchains//:cmake-3.31.1-macos-universal_toolchain", - "@cmake_3.31.1_toolchains//:cmake-3.31.1-windows-i386_toolchain", - "@cmake_3.31.1_toolchains//:cmake-3.31.1-windows-x86_64_toolchain", - ) - - return - if "3.30.0" == version: maybe( http_archive, @@ -365,9 +375,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.30.0_toolchains//:cmake-3.30.0-linux-aarch64_toolchain", + "@cmake_3.30.0_toolchains//:cmake-3.30.0-linux-x86_64_toolchain", + "@cmake_3.30.0_toolchains//:cmake-3.30.0-macos-universal_toolchain", + "@cmake_3.30.0_toolchains//:cmake-3.30.0-windows-i386_toolchain", + "@cmake_3.30.0_toolchains//:cmake-3.30.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.30.0_toolchains", repos = { "cmake-3.30.0-linux-aarch64": [ @@ -393,17 +411,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.30.0_toolchains//:cmake-3.30.0-linux-aarch64_toolchain", - "@cmake_3.30.0_toolchains//:cmake-3.30.0-linux-x86_64_toolchain", - "@cmake_3.30.0_toolchains//:cmake-3.30.0-macos-universal_toolchain", - "@cmake_3.30.0_toolchains//:cmake-3.30.0-windows-i386_toolchain", - "@cmake_3.30.0_toolchains//:cmake-3.30.0-windows-x86_64_toolchain", - ) - - return - if "3.30.1" == version: maybe( http_archive, @@ -475,9 +482,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.30.1_toolchains//:cmake-3.30.1-linux-aarch64_toolchain", + "@cmake_3.30.1_toolchains//:cmake-3.30.1-linux-x86_64_toolchain", + "@cmake_3.30.1_toolchains//:cmake-3.30.1-macos-universal_toolchain", + "@cmake_3.30.1_toolchains//:cmake-3.30.1-windows-i386_toolchain", + "@cmake_3.30.1_toolchains//:cmake-3.30.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.30.1_toolchains", repos = { "cmake-3.30.1-linux-aarch64": [ @@ -503,17 +518,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.30.1_toolchains//:cmake-3.30.1-linux-aarch64_toolchain", - "@cmake_3.30.1_toolchains//:cmake-3.30.1-linux-x86_64_toolchain", - "@cmake_3.30.1_toolchains//:cmake-3.30.1-macos-universal_toolchain", - "@cmake_3.30.1_toolchains//:cmake-3.30.1-windows-i386_toolchain", - "@cmake_3.30.1_toolchains//:cmake-3.30.1-windows-x86_64_toolchain", - ) - - return - if "3.30.2" == version: maybe( http_archive, @@ -585,9 +589,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.30.2_toolchains//:cmake-3.30.2-linux-aarch64_toolchain", + "@cmake_3.30.2_toolchains//:cmake-3.30.2-linux-x86_64_toolchain", + "@cmake_3.30.2_toolchains//:cmake-3.30.2-macos-universal_toolchain", + "@cmake_3.30.2_toolchains//:cmake-3.30.2-windows-i386_toolchain", + "@cmake_3.30.2_toolchains//:cmake-3.30.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.30.2_toolchains", repos = { "cmake-3.30.2-linux-aarch64": [ @@ -613,17 +625,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.30.2_toolchains//:cmake-3.30.2-linux-aarch64_toolchain", - "@cmake_3.30.2_toolchains//:cmake-3.30.2-linux-x86_64_toolchain", - "@cmake_3.30.2_toolchains//:cmake-3.30.2-macos-universal_toolchain", - "@cmake_3.30.2_toolchains//:cmake-3.30.2-windows-i386_toolchain", - "@cmake_3.30.2_toolchains//:cmake-3.30.2-windows-x86_64_toolchain", - ) - - return - if "3.30.3" == version: maybe( http_archive, @@ -695,9 +696,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.30.3_toolchains//:cmake-3.30.3-linux-aarch64_toolchain", + "@cmake_3.30.3_toolchains//:cmake-3.30.3-linux-x86_64_toolchain", + "@cmake_3.30.3_toolchains//:cmake-3.30.3-macos-universal_toolchain", + "@cmake_3.30.3_toolchains//:cmake-3.30.3-windows-i386_toolchain", + "@cmake_3.30.3_toolchains//:cmake-3.30.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.30.3_toolchains", repos = { "cmake-3.30.3-linux-aarch64": [ @@ -723,17 +732,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.30.3_toolchains//:cmake-3.30.3-linux-aarch64_toolchain", - "@cmake_3.30.3_toolchains//:cmake-3.30.3-linux-x86_64_toolchain", - "@cmake_3.30.3_toolchains//:cmake-3.30.3-macos-universal_toolchain", - "@cmake_3.30.3_toolchains//:cmake-3.30.3-windows-i386_toolchain", - "@cmake_3.30.3_toolchains//:cmake-3.30.3-windows-x86_64_toolchain", - ) - - return - if "3.30.4" == version: maybe( http_archive, @@ -805,9 +803,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.30.4_toolchains//:cmake-3.30.4-linux-aarch64_toolchain", + "@cmake_3.30.4_toolchains//:cmake-3.30.4-linux-x86_64_toolchain", + "@cmake_3.30.4_toolchains//:cmake-3.30.4-macos-universal_toolchain", + "@cmake_3.30.4_toolchains//:cmake-3.30.4-windows-i386_toolchain", + "@cmake_3.30.4_toolchains//:cmake-3.30.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.30.4_toolchains", repos = { "cmake-3.30.4-linux-aarch64": [ @@ -833,17 +839,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.30.4_toolchains//:cmake-3.30.4-linux-aarch64_toolchain", - "@cmake_3.30.4_toolchains//:cmake-3.30.4-linux-x86_64_toolchain", - "@cmake_3.30.4_toolchains//:cmake-3.30.4-macos-universal_toolchain", - "@cmake_3.30.4_toolchains//:cmake-3.30.4-windows-i386_toolchain", - "@cmake_3.30.4_toolchains//:cmake-3.30.4-windows-x86_64_toolchain", - ) - - return - if "3.30.5" == version: maybe( http_archive, @@ -915,9 +910,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.30.5_toolchains//:cmake-3.30.5-linux-aarch64_toolchain", + "@cmake_3.30.5_toolchains//:cmake-3.30.5-linux-x86_64_toolchain", + "@cmake_3.30.5_toolchains//:cmake-3.30.5-macos-universal_toolchain", + "@cmake_3.30.5_toolchains//:cmake-3.30.5-windows-i386_toolchain", + "@cmake_3.30.5_toolchains//:cmake-3.30.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.30.5_toolchains", repos = { "cmake-3.30.5-linux-aarch64": [ @@ -943,17 +946,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.30.5_toolchains//:cmake-3.30.5-linux-aarch64_toolchain", - "@cmake_3.30.5_toolchains//:cmake-3.30.5-linux-x86_64_toolchain", - "@cmake_3.30.5_toolchains//:cmake-3.30.5-macos-universal_toolchain", - "@cmake_3.30.5_toolchains//:cmake-3.30.5-windows-i386_toolchain", - "@cmake_3.30.5_toolchains//:cmake-3.30.5-windows-x86_64_toolchain", - ) - - return - if "3.30.6" == version: maybe( http_archive, @@ -1025,9 +1017,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.30.6_toolchains//:cmake-3.30.6-linux-aarch64_toolchain", + "@cmake_3.30.6_toolchains//:cmake-3.30.6-linux-x86_64_toolchain", + "@cmake_3.30.6_toolchains//:cmake-3.30.6-macos-universal_toolchain", + "@cmake_3.30.6_toolchains//:cmake-3.30.6-windows-i386_toolchain", + "@cmake_3.30.6_toolchains//:cmake-3.30.6-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.30.6_toolchains", repos = { "cmake-3.30.6-linux-aarch64": [ @@ -1053,17 +1053,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.30.6_toolchains//:cmake-3.30.6-linux-aarch64_toolchain", - "@cmake_3.30.6_toolchains//:cmake-3.30.6-linux-x86_64_toolchain", - "@cmake_3.30.6_toolchains//:cmake-3.30.6-macos-universal_toolchain", - "@cmake_3.30.6_toolchains//:cmake-3.30.6-windows-i386_toolchain", - "@cmake_3.30.6_toolchains//:cmake-3.30.6-windows-x86_64_toolchain", - ) - - return - if "3.29.0" == version: maybe( http_archive, @@ -1135,9 +1124,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.0_toolchains//:cmake-3.29.0-linux-aarch64_toolchain", + "@cmake_3.29.0_toolchains//:cmake-3.29.0-linux-x86_64_toolchain", + "@cmake_3.29.0_toolchains//:cmake-3.29.0-macos-universal_toolchain", + "@cmake_3.29.0_toolchains//:cmake-3.29.0-windows-i386_toolchain", + "@cmake_3.29.0_toolchains//:cmake-3.29.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.0_toolchains", repos = { "cmake-3.29.0-linux-aarch64": [ @@ -1163,17 +1160,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.0_toolchains//:cmake-3.29.0-linux-aarch64_toolchain", - "@cmake_3.29.0_toolchains//:cmake-3.29.0-linux-x86_64_toolchain", - "@cmake_3.29.0_toolchains//:cmake-3.29.0-macos-universal_toolchain", - "@cmake_3.29.0_toolchains//:cmake-3.29.0-windows-i386_toolchain", - "@cmake_3.29.0_toolchains//:cmake-3.29.0-windows-x86_64_toolchain", - ) - - return - if "3.29.1" == version: maybe( http_archive, @@ -1245,9 +1231,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.1_toolchains//:cmake-3.29.1-linux-aarch64_toolchain", + "@cmake_3.29.1_toolchains//:cmake-3.29.1-linux-x86_64_toolchain", + "@cmake_3.29.1_toolchains//:cmake-3.29.1-macos-universal_toolchain", + "@cmake_3.29.1_toolchains//:cmake-3.29.1-windows-i386_toolchain", + "@cmake_3.29.1_toolchains//:cmake-3.29.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.1_toolchains", repos = { "cmake-3.29.1-linux-aarch64": [ @@ -1273,17 +1267,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.1_toolchains//:cmake-3.29.1-linux-aarch64_toolchain", - "@cmake_3.29.1_toolchains//:cmake-3.29.1-linux-x86_64_toolchain", - "@cmake_3.29.1_toolchains//:cmake-3.29.1-macos-universal_toolchain", - "@cmake_3.29.1_toolchains//:cmake-3.29.1-windows-i386_toolchain", - "@cmake_3.29.1_toolchains//:cmake-3.29.1-windows-x86_64_toolchain", - ) - - return - if "3.29.2" == version: maybe( http_archive, @@ -1355,9 +1338,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.2_toolchains//:cmake-3.29.2-linux-aarch64_toolchain", + "@cmake_3.29.2_toolchains//:cmake-3.29.2-linux-x86_64_toolchain", + "@cmake_3.29.2_toolchains//:cmake-3.29.2-macos-universal_toolchain", + "@cmake_3.29.2_toolchains//:cmake-3.29.2-windows-i386_toolchain", + "@cmake_3.29.2_toolchains//:cmake-3.29.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.2_toolchains", repos = { "cmake-3.29.2-linux-aarch64": [ @@ -1383,17 +1374,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.2_toolchains//:cmake-3.29.2-linux-aarch64_toolchain", - "@cmake_3.29.2_toolchains//:cmake-3.29.2-linux-x86_64_toolchain", - "@cmake_3.29.2_toolchains//:cmake-3.29.2-macos-universal_toolchain", - "@cmake_3.29.2_toolchains//:cmake-3.29.2-windows-i386_toolchain", - "@cmake_3.29.2_toolchains//:cmake-3.29.2-windows-x86_64_toolchain", - ) - - return - if "3.29.3" == version: maybe( http_archive, @@ -1465,9 +1445,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.3_toolchains//:cmake-3.29.3-linux-aarch64_toolchain", + "@cmake_3.29.3_toolchains//:cmake-3.29.3-linux-x86_64_toolchain", + "@cmake_3.29.3_toolchains//:cmake-3.29.3-macos-universal_toolchain", + "@cmake_3.29.3_toolchains//:cmake-3.29.3-windows-i386_toolchain", + "@cmake_3.29.3_toolchains//:cmake-3.29.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.3_toolchains", repos = { "cmake-3.29.3-linux-aarch64": [ @@ -1493,17 +1481,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.3_toolchains//:cmake-3.29.3-linux-aarch64_toolchain", - "@cmake_3.29.3_toolchains//:cmake-3.29.3-linux-x86_64_toolchain", - "@cmake_3.29.3_toolchains//:cmake-3.29.3-macos-universal_toolchain", - "@cmake_3.29.3_toolchains//:cmake-3.29.3-windows-i386_toolchain", - "@cmake_3.29.3_toolchains//:cmake-3.29.3-windows-x86_64_toolchain", - ) - - return - if "3.29.4" == version: maybe( http_archive, @@ -1575,9 +1552,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.4_toolchains//:cmake-3.29.4-linux-aarch64_toolchain", + "@cmake_3.29.4_toolchains//:cmake-3.29.4-linux-x86_64_toolchain", + "@cmake_3.29.4_toolchains//:cmake-3.29.4-macos-universal_toolchain", + "@cmake_3.29.4_toolchains//:cmake-3.29.4-windows-i386_toolchain", + "@cmake_3.29.4_toolchains//:cmake-3.29.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.4_toolchains", repos = { "cmake-3.29.4-linux-aarch64": [ @@ -1603,17 +1588,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.4_toolchains//:cmake-3.29.4-linux-aarch64_toolchain", - "@cmake_3.29.4_toolchains//:cmake-3.29.4-linux-x86_64_toolchain", - "@cmake_3.29.4_toolchains//:cmake-3.29.4-macos-universal_toolchain", - "@cmake_3.29.4_toolchains//:cmake-3.29.4-windows-i386_toolchain", - "@cmake_3.29.4_toolchains//:cmake-3.29.4-windows-x86_64_toolchain", - ) - - return - if "3.29.5" == version: maybe( http_archive, @@ -1685,9 +1659,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.5_toolchains//:cmake-3.29.5-linux-aarch64_toolchain", + "@cmake_3.29.5_toolchains//:cmake-3.29.5-linux-x86_64_toolchain", + "@cmake_3.29.5_toolchains//:cmake-3.29.5-macos-universal_toolchain", + "@cmake_3.29.5_toolchains//:cmake-3.29.5-windows-i386_toolchain", + "@cmake_3.29.5_toolchains//:cmake-3.29.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.5_toolchains", repos = { "cmake-3.29.5-linux-aarch64": [ @@ -1713,17 +1695,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.5_toolchains//:cmake-3.29.5-linux-aarch64_toolchain", - "@cmake_3.29.5_toolchains//:cmake-3.29.5-linux-x86_64_toolchain", - "@cmake_3.29.5_toolchains//:cmake-3.29.5-macos-universal_toolchain", - "@cmake_3.29.5_toolchains//:cmake-3.29.5-windows-i386_toolchain", - "@cmake_3.29.5_toolchains//:cmake-3.29.5-windows-x86_64_toolchain", - ) - - return - if "3.29.6" == version: maybe( http_archive, @@ -1795,9 +1766,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.6_toolchains//:cmake-3.29.6-linux-aarch64_toolchain", + "@cmake_3.29.6_toolchains//:cmake-3.29.6-linux-x86_64_toolchain", + "@cmake_3.29.6_toolchains//:cmake-3.29.6-macos-universal_toolchain", + "@cmake_3.29.6_toolchains//:cmake-3.29.6-windows-i386_toolchain", + "@cmake_3.29.6_toolchains//:cmake-3.29.6-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.6_toolchains", repos = { "cmake-3.29.6-linux-aarch64": [ @@ -1823,17 +1802,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.6_toolchains//:cmake-3.29.6-linux-aarch64_toolchain", - "@cmake_3.29.6_toolchains//:cmake-3.29.6-linux-x86_64_toolchain", - "@cmake_3.29.6_toolchains//:cmake-3.29.6-macos-universal_toolchain", - "@cmake_3.29.6_toolchains//:cmake-3.29.6-windows-i386_toolchain", - "@cmake_3.29.6_toolchains//:cmake-3.29.6-windows-x86_64_toolchain", - ) - - return - if "3.29.7" == version: maybe( http_archive, @@ -1905,9 +1873,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.7_toolchains//:cmake-3.29.7-linux-aarch64_toolchain", + "@cmake_3.29.7_toolchains//:cmake-3.29.7-linux-x86_64_toolchain", + "@cmake_3.29.7_toolchains//:cmake-3.29.7-macos-universal_toolchain", + "@cmake_3.29.7_toolchains//:cmake-3.29.7-windows-i386_toolchain", + "@cmake_3.29.7_toolchains//:cmake-3.29.7-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.7_toolchains", repos = { "cmake-3.29.7-linux-aarch64": [ @@ -1933,17 +1909,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.7_toolchains//:cmake-3.29.7-linux-aarch64_toolchain", - "@cmake_3.29.7_toolchains//:cmake-3.29.7-linux-x86_64_toolchain", - "@cmake_3.29.7_toolchains//:cmake-3.29.7-macos-universal_toolchain", - "@cmake_3.29.7_toolchains//:cmake-3.29.7-windows-i386_toolchain", - "@cmake_3.29.7_toolchains//:cmake-3.29.7-windows-x86_64_toolchain", - ) - - return - if "3.29.8" == version: maybe( http_archive, @@ -2015,9 +1980,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.8_toolchains//:cmake-3.29.8-linux-aarch64_toolchain", + "@cmake_3.29.8_toolchains//:cmake-3.29.8-linux-x86_64_toolchain", + "@cmake_3.29.8_toolchains//:cmake-3.29.8-macos-universal_toolchain", + "@cmake_3.29.8_toolchains//:cmake-3.29.8-windows-i386_toolchain", + "@cmake_3.29.8_toolchains//:cmake-3.29.8-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.8_toolchains", repos = { "cmake-3.29.8-linux-aarch64": [ @@ -2043,17 +2016,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.8_toolchains//:cmake-3.29.8-linux-aarch64_toolchain", - "@cmake_3.29.8_toolchains//:cmake-3.29.8-linux-x86_64_toolchain", - "@cmake_3.29.8_toolchains//:cmake-3.29.8-macos-universal_toolchain", - "@cmake_3.29.8_toolchains//:cmake-3.29.8-windows-i386_toolchain", - "@cmake_3.29.8_toolchains//:cmake-3.29.8-windows-x86_64_toolchain", - ) - - return - if "3.29.9" == version: maybe( http_archive, @@ -2125,9 +2087,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.29.9_toolchains//:cmake-3.29.9-linux-aarch64_toolchain", + "@cmake_3.29.9_toolchains//:cmake-3.29.9-linux-x86_64_toolchain", + "@cmake_3.29.9_toolchains//:cmake-3.29.9-macos-universal_toolchain", + "@cmake_3.29.9_toolchains//:cmake-3.29.9-windows-i386_toolchain", + "@cmake_3.29.9_toolchains//:cmake-3.29.9-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.29.9_toolchains", repos = { "cmake-3.29.9-linux-aarch64": [ @@ -2153,17 +2123,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.29.9_toolchains//:cmake-3.29.9-linux-aarch64_toolchain", - "@cmake_3.29.9_toolchains//:cmake-3.29.9-linux-x86_64_toolchain", - "@cmake_3.29.9_toolchains//:cmake-3.29.9-macos-universal_toolchain", - "@cmake_3.29.9_toolchains//:cmake-3.29.9-windows-i386_toolchain", - "@cmake_3.29.9_toolchains//:cmake-3.29.9-windows-x86_64_toolchain", - ) - - return - if "3.28.0" == version: maybe( http_archive, @@ -2235,9 +2194,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.28.0_toolchains//:cmake-3.28.0-linux-aarch64_toolchain", + "@cmake_3.28.0_toolchains//:cmake-3.28.0-linux-x86_64_toolchain", + "@cmake_3.28.0_toolchains//:cmake-3.28.0-macos-universal_toolchain", + "@cmake_3.28.0_toolchains//:cmake-3.28.0-windows-i386_toolchain", + "@cmake_3.28.0_toolchains//:cmake-3.28.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.28.0_toolchains", repos = { "cmake-3.28.0-linux-aarch64": [ @@ -2263,17 +2230,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.28.0_toolchains//:cmake-3.28.0-linux-aarch64_toolchain", - "@cmake_3.28.0_toolchains//:cmake-3.28.0-linux-x86_64_toolchain", - "@cmake_3.28.0_toolchains//:cmake-3.28.0-macos-universal_toolchain", - "@cmake_3.28.0_toolchains//:cmake-3.28.0-windows-i386_toolchain", - "@cmake_3.28.0_toolchains//:cmake-3.28.0-windows-x86_64_toolchain", - ) - - return - if "3.28.1" == version: maybe( http_archive, @@ -2345,9 +2301,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.28.1_toolchains//:cmake-3.28.1-linux-aarch64_toolchain", + "@cmake_3.28.1_toolchains//:cmake-3.28.1-linux-x86_64_toolchain", + "@cmake_3.28.1_toolchains//:cmake-3.28.1-macos-universal_toolchain", + "@cmake_3.28.1_toolchains//:cmake-3.28.1-windows-i386_toolchain", + "@cmake_3.28.1_toolchains//:cmake-3.28.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.28.1_toolchains", repos = { "cmake-3.28.1-linux-aarch64": [ @@ -2373,17 +2337,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.28.1_toolchains//:cmake-3.28.1-linux-aarch64_toolchain", - "@cmake_3.28.1_toolchains//:cmake-3.28.1-linux-x86_64_toolchain", - "@cmake_3.28.1_toolchains//:cmake-3.28.1-macos-universal_toolchain", - "@cmake_3.28.1_toolchains//:cmake-3.28.1-windows-i386_toolchain", - "@cmake_3.28.1_toolchains//:cmake-3.28.1-windows-x86_64_toolchain", - ) - - return - if "3.28.2" == version: maybe( http_archive, @@ -2455,9 +2408,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.28.2_toolchains//:cmake-3.28.2-linux-aarch64_toolchain", + "@cmake_3.28.2_toolchains//:cmake-3.28.2-linux-x86_64_toolchain", + "@cmake_3.28.2_toolchains//:cmake-3.28.2-macos-universal_toolchain", + "@cmake_3.28.2_toolchains//:cmake-3.28.2-windows-i386_toolchain", + "@cmake_3.28.2_toolchains//:cmake-3.28.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.28.2_toolchains", repos = { "cmake-3.28.2-linux-aarch64": [ @@ -2483,17 +2444,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.28.2_toolchains//:cmake-3.28.2-linux-aarch64_toolchain", - "@cmake_3.28.2_toolchains//:cmake-3.28.2-linux-x86_64_toolchain", - "@cmake_3.28.2_toolchains//:cmake-3.28.2-macos-universal_toolchain", - "@cmake_3.28.2_toolchains//:cmake-3.28.2-windows-i386_toolchain", - "@cmake_3.28.2_toolchains//:cmake-3.28.2-windows-x86_64_toolchain", - ) - - return - if "3.28.3" == version: maybe( http_archive, @@ -2565,9 +2515,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.28.3_toolchains//:cmake-3.28.3-linux-aarch64_toolchain", + "@cmake_3.28.3_toolchains//:cmake-3.28.3-linux-x86_64_toolchain", + "@cmake_3.28.3_toolchains//:cmake-3.28.3-macos-universal_toolchain", + "@cmake_3.28.3_toolchains//:cmake-3.28.3-windows-i386_toolchain", + "@cmake_3.28.3_toolchains//:cmake-3.28.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.28.3_toolchains", repos = { "cmake-3.28.3-linux-aarch64": [ @@ -2593,17 +2551,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.28.3_toolchains//:cmake-3.28.3-linux-aarch64_toolchain", - "@cmake_3.28.3_toolchains//:cmake-3.28.3-linux-x86_64_toolchain", - "@cmake_3.28.3_toolchains//:cmake-3.28.3-macos-universal_toolchain", - "@cmake_3.28.3_toolchains//:cmake-3.28.3-windows-i386_toolchain", - "@cmake_3.28.3_toolchains//:cmake-3.28.3-windows-x86_64_toolchain", - ) - - return - if "3.28.4" == version: maybe( http_archive, @@ -2675,9 +2622,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.28.4_toolchains//:cmake-3.28.4-linux-aarch64_toolchain", + "@cmake_3.28.4_toolchains//:cmake-3.28.4-linux-x86_64_toolchain", + "@cmake_3.28.4_toolchains//:cmake-3.28.4-macos-universal_toolchain", + "@cmake_3.28.4_toolchains//:cmake-3.28.4-windows-i386_toolchain", + "@cmake_3.28.4_toolchains//:cmake-3.28.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.28.4_toolchains", repos = { "cmake-3.28.4-linux-aarch64": [ @@ -2703,17 +2658,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.28.4_toolchains//:cmake-3.28.4-linux-aarch64_toolchain", - "@cmake_3.28.4_toolchains//:cmake-3.28.4-linux-x86_64_toolchain", - "@cmake_3.28.4_toolchains//:cmake-3.28.4-macos-universal_toolchain", - "@cmake_3.28.4_toolchains//:cmake-3.28.4-windows-i386_toolchain", - "@cmake_3.28.4_toolchains//:cmake-3.28.4-windows-x86_64_toolchain", - ) - - return - if "3.28.5" == version: maybe( http_archive, @@ -2785,9 +2729,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.28.5_toolchains//:cmake-3.28.5-linux-aarch64_toolchain", + "@cmake_3.28.5_toolchains//:cmake-3.28.5-linux-x86_64_toolchain", + "@cmake_3.28.5_toolchains//:cmake-3.28.5-macos-universal_toolchain", + "@cmake_3.28.5_toolchains//:cmake-3.28.5-windows-i386_toolchain", + "@cmake_3.28.5_toolchains//:cmake-3.28.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.28.5_toolchains", repos = { "cmake-3.28.5-linux-aarch64": [ @@ -2813,17 +2765,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.28.5_toolchains//:cmake-3.28.5-linux-aarch64_toolchain", - "@cmake_3.28.5_toolchains//:cmake-3.28.5-linux-x86_64_toolchain", - "@cmake_3.28.5_toolchains//:cmake-3.28.5-macos-universal_toolchain", - "@cmake_3.28.5_toolchains//:cmake-3.28.5-windows-i386_toolchain", - "@cmake_3.28.5_toolchains//:cmake-3.28.5-windows-x86_64_toolchain", - ) - - return - if "3.28.6" == version: maybe( http_archive, @@ -2895,13 +2836,21 @@ def _cmake_toolchains(version, register_toolchains): ), ) - # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, - name = "cmake_3.28.6_toolchains", - repos = { - "cmake-3.28.6-linux-aarch64": [ - "@platforms//cpu:aarch64", + if register_toolchains: + native.register_toolchains( + "@cmake_3.28.6_toolchains//:cmake-3.28.6-linux-aarch64_toolchain", + "@cmake_3.28.6_toolchains//:cmake-3.28.6-linux-x86_64_toolchain", + "@cmake_3.28.6_toolchains//:cmake-3.28.6-macos-universal_toolchain", + "@cmake_3.28.6_toolchains//:cmake-3.28.6-windows-i386_toolchain", + "@cmake_3.28.6_toolchains//:cmake-3.28.6-windows-x86_64_toolchain", + ) + + # buildifier: leave-alone + return maybe_prebuilt_toolchains_repository( + name = "cmake_3.28.6_toolchains", + repos = { + "cmake-3.28.6-linux-aarch64": [ + "@platforms//cpu:aarch64", "@platforms//os:linux", ], "cmake-3.28.6-linux-x86_64": [ @@ -2923,17 +2872,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.28.6_toolchains//:cmake-3.28.6-linux-aarch64_toolchain", - "@cmake_3.28.6_toolchains//:cmake-3.28.6-linux-x86_64_toolchain", - "@cmake_3.28.6_toolchains//:cmake-3.28.6-macos-universal_toolchain", - "@cmake_3.28.6_toolchains//:cmake-3.28.6-windows-i386_toolchain", - "@cmake_3.28.6_toolchains//:cmake-3.28.6-windows-x86_64_toolchain", - ) - - return - if "3.27.0" == version: maybe( http_archive, @@ -3005,9 +2943,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.0_toolchains//:cmake-3.27.0-linux-aarch64_toolchain", + "@cmake_3.27.0_toolchains//:cmake-3.27.0-linux-x86_64_toolchain", + "@cmake_3.27.0_toolchains//:cmake-3.27.0-macos-universal_toolchain", + "@cmake_3.27.0_toolchains//:cmake-3.27.0-windows-i386_toolchain", + "@cmake_3.27.0_toolchains//:cmake-3.27.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.0_toolchains", repos = { "cmake-3.27.0-linux-aarch64": [ @@ -3033,17 +2979,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.0_toolchains//:cmake-3.27.0-linux-aarch64_toolchain", - "@cmake_3.27.0_toolchains//:cmake-3.27.0-linux-x86_64_toolchain", - "@cmake_3.27.0_toolchains//:cmake-3.27.0-macos-universal_toolchain", - "@cmake_3.27.0_toolchains//:cmake-3.27.0-windows-i386_toolchain", - "@cmake_3.27.0_toolchains//:cmake-3.27.0-windows-x86_64_toolchain", - ) - - return - if "3.27.1" == version: maybe( http_archive, @@ -3115,9 +3050,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.1_toolchains//:cmake-3.27.1-linux-aarch64_toolchain", + "@cmake_3.27.1_toolchains//:cmake-3.27.1-linux-x86_64_toolchain", + "@cmake_3.27.1_toolchains//:cmake-3.27.1-macos-universal_toolchain", + "@cmake_3.27.1_toolchains//:cmake-3.27.1-windows-i386_toolchain", + "@cmake_3.27.1_toolchains//:cmake-3.27.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.1_toolchains", repos = { "cmake-3.27.1-linux-aarch64": [ @@ -3143,17 +3086,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.1_toolchains//:cmake-3.27.1-linux-aarch64_toolchain", - "@cmake_3.27.1_toolchains//:cmake-3.27.1-linux-x86_64_toolchain", - "@cmake_3.27.1_toolchains//:cmake-3.27.1-macos-universal_toolchain", - "@cmake_3.27.1_toolchains//:cmake-3.27.1-windows-i386_toolchain", - "@cmake_3.27.1_toolchains//:cmake-3.27.1-windows-x86_64_toolchain", - ) - - return - if "3.27.2" == version: maybe( http_archive, @@ -3225,9 +3157,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.2_toolchains//:cmake-3.27.2-linux-aarch64_toolchain", + "@cmake_3.27.2_toolchains//:cmake-3.27.2-linux-x86_64_toolchain", + "@cmake_3.27.2_toolchains//:cmake-3.27.2-macos-universal_toolchain", + "@cmake_3.27.2_toolchains//:cmake-3.27.2-windows-i386_toolchain", + "@cmake_3.27.2_toolchains//:cmake-3.27.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.2_toolchains", repos = { "cmake-3.27.2-linux-aarch64": [ @@ -3253,17 +3193,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.2_toolchains//:cmake-3.27.2-linux-aarch64_toolchain", - "@cmake_3.27.2_toolchains//:cmake-3.27.2-linux-x86_64_toolchain", - "@cmake_3.27.2_toolchains//:cmake-3.27.2-macos-universal_toolchain", - "@cmake_3.27.2_toolchains//:cmake-3.27.2-windows-i386_toolchain", - "@cmake_3.27.2_toolchains//:cmake-3.27.2-windows-x86_64_toolchain", - ) - - return - if "3.27.3" == version: maybe( http_archive, @@ -3335,9 +3264,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.3_toolchains//:cmake-3.27.3-linux-aarch64_toolchain", + "@cmake_3.27.3_toolchains//:cmake-3.27.3-linux-x86_64_toolchain", + "@cmake_3.27.3_toolchains//:cmake-3.27.3-macos-universal_toolchain", + "@cmake_3.27.3_toolchains//:cmake-3.27.3-windows-i386_toolchain", + "@cmake_3.27.3_toolchains//:cmake-3.27.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.3_toolchains", repos = { "cmake-3.27.3-linux-aarch64": [ @@ -3363,17 +3300,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.3_toolchains//:cmake-3.27.3-linux-aarch64_toolchain", - "@cmake_3.27.3_toolchains//:cmake-3.27.3-linux-x86_64_toolchain", - "@cmake_3.27.3_toolchains//:cmake-3.27.3-macos-universal_toolchain", - "@cmake_3.27.3_toolchains//:cmake-3.27.3-windows-i386_toolchain", - "@cmake_3.27.3_toolchains//:cmake-3.27.3-windows-x86_64_toolchain", - ) - - return - if "3.27.4" == version: maybe( http_archive, @@ -3445,9 +3371,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.4_toolchains//:cmake-3.27.4-linux-aarch64_toolchain", + "@cmake_3.27.4_toolchains//:cmake-3.27.4-linux-x86_64_toolchain", + "@cmake_3.27.4_toolchains//:cmake-3.27.4-macos-universal_toolchain", + "@cmake_3.27.4_toolchains//:cmake-3.27.4-windows-i386_toolchain", + "@cmake_3.27.4_toolchains//:cmake-3.27.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.4_toolchains", repos = { "cmake-3.27.4-linux-aarch64": [ @@ -3473,17 +3407,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.4_toolchains//:cmake-3.27.4-linux-aarch64_toolchain", - "@cmake_3.27.4_toolchains//:cmake-3.27.4-linux-x86_64_toolchain", - "@cmake_3.27.4_toolchains//:cmake-3.27.4-macos-universal_toolchain", - "@cmake_3.27.4_toolchains//:cmake-3.27.4-windows-i386_toolchain", - "@cmake_3.27.4_toolchains//:cmake-3.27.4-windows-x86_64_toolchain", - ) - - return - if "3.27.5" == version: maybe( http_archive, @@ -3555,9 +3478,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.5_toolchains//:cmake-3.27.5-linux-aarch64_toolchain", + "@cmake_3.27.5_toolchains//:cmake-3.27.5-linux-x86_64_toolchain", + "@cmake_3.27.5_toolchains//:cmake-3.27.5-macos-universal_toolchain", + "@cmake_3.27.5_toolchains//:cmake-3.27.5-windows-i386_toolchain", + "@cmake_3.27.5_toolchains//:cmake-3.27.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.5_toolchains", repos = { "cmake-3.27.5-linux-aarch64": [ @@ -3583,17 +3514,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.5_toolchains//:cmake-3.27.5-linux-aarch64_toolchain", - "@cmake_3.27.5_toolchains//:cmake-3.27.5-linux-x86_64_toolchain", - "@cmake_3.27.5_toolchains//:cmake-3.27.5-macos-universal_toolchain", - "@cmake_3.27.5_toolchains//:cmake-3.27.5-windows-i386_toolchain", - "@cmake_3.27.5_toolchains//:cmake-3.27.5-windows-x86_64_toolchain", - ) - - return - if "3.27.6" == version: maybe( http_archive, @@ -3665,9 +3585,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.6_toolchains//:cmake-3.27.6-linux-aarch64_toolchain", + "@cmake_3.27.6_toolchains//:cmake-3.27.6-linux-x86_64_toolchain", + "@cmake_3.27.6_toolchains//:cmake-3.27.6-macos-universal_toolchain", + "@cmake_3.27.6_toolchains//:cmake-3.27.6-windows-i386_toolchain", + "@cmake_3.27.6_toolchains//:cmake-3.27.6-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.6_toolchains", repos = { "cmake-3.27.6-linux-aarch64": [ @@ -3693,17 +3621,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.6_toolchains//:cmake-3.27.6-linux-aarch64_toolchain", - "@cmake_3.27.6_toolchains//:cmake-3.27.6-linux-x86_64_toolchain", - "@cmake_3.27.6_toolchains//:cmake-3.27.6-macos-universal_toolchain", - "@cmake_3.27.6_toolchains//:cmake-3.27.6-windows-i386_toolchain", - "@cmake_3.27.6_toolchains//:cmake-3.27.6-windows-x86_64_toolchain", - ) - - return - if "3.27.7" == version: maybe( http_archive, @@ -3775,9 +3692,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.7_toolchains//:cmake-3.27.7-linux-aarch64_toolchain", + "@cmake_3.27.7_toolchains//:cmake-3.27.7-linux-x86_64_toolchain", + "@cmake_3.27.7_toolchains//:cmake-3.27.7-macos-universal_toolchain", + "@cmake_3.27.7_toolchains//:cmake-3.27.7-windows-i386_toolchain", + "@cmake_3.27.7_toolchains//:cmake-3.27.7-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.7_toolchains", repos = { "cmake-3.27.7-linux-aarch64": [ @@ -3803,17 +3728,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.7_toolchains//:cmake-3.27.7-linux-aarch64_toolchain", - "@cmake_3.27.7_toolchains//:cmake-3.27.7-linux-x86_64_toolchain", - "@cmake_3.27.7_toolchains//:cmake-3.27.7-macos-universal_toolchain", - "@cmake_3.27.7_toolchains//:cmake-3.27.7-windows-i386_toolchain", - "@cmake_3.27.7_toolchains//:cmake-3.27.7-windows-x86_64_toolchain", - ) - - return - if "3.27.8" == version: maybe( http_archive, @@ -3885,9 +3799,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.8_toolchains//:cmake-3.27.8-linux-aarch64_toolchain", + "@cmake_3.27.8_toolchains//:cmake-3.27.8-linux-x86_64_toolchain", + "@cmake_3.27.8_toolchains//:cmake-3.27.8-macos-universal_toolchain", + "@cmake_3.27.8_toolchains//:cmake-3.27.8-windows-i386_toolchain", + "@cmake_3.27.8_toolchains//:cmake-3.27.8-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.8_toolchains", repos = { "cmake-3.27.8-linux-aarch64": [ @@ -3913,17 +3835,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.8_toolchains//:cmake-3.27.8-linux-aarch64_toolchain", - "@cmake_3.27.8_toolchains//:cmake-3.27.8-linux-x86_64_toolchain", - "@cmake_3.27.8_toolchains//:cmake-3.27.8-macos-universal_toolchain", - "@cmake_3.27.8_toolchains//:cmake-3.27.8-windows-i386_toolchain", - "@cmake_3.27.8_toolchains//:cmake-3.27.8-windows-x86_64_toolchain", - ) - - return - if "3.27.9" == version: maybe( http_archive, @@ -3995,9 +3906,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.27.9_toolchains//:cmake-3.27.9-linux-aarch64_toolchain", + "@cmake_3.27.9_toolchains//:cmake-3.27.9-linux-x86_64_toolchain", + "@cmake_3.27.9_toolchains//:cmake-3.27.9-macos-universal_toolchain", + "@cmake_3.27.9_toolchains//:cmake-3.27.9-windows-i386_toolchain", + "@cmake_3.27.9_toolchains//:cmake-3.27.9-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.27.9_toolchains", repos = { "cmake-3.27.9-linux-aarch64": [ @@ -4023,17 +3942,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.27.9_toolchains//:cmake-3.27.9-linux-aarch64_toolchain", - "@cmake_3.27.9_toolchains//:cmake-3.27.9-linux-x86_64_toolchain", - "@cmake_3.27.9_toolchains//:cmake-3.27.9-macos-universal_toolchain", - "@cmake_3.27.9_toolchains//:cmake-3.27.9-windows-i386_toolchain", - "@cmake_3.27.9_toolchains//:cmake-3.27.9-windows-x86_64_toolchain", - ) - - return - if "3.26.0" == version: maybe( http_archive, @@ -4105,9 +4013,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.26.0_toolchains//:cmake-3.26.0-linux-aarch64_toolchain", + "@cmake_3.26.0_toolchains//:cmake-3.26.0-linux-x86_64_toolchain", + "@cmake_3.26.0_toolchains//:cmake-3.26.0-macos-universal_toolchain", + "@cmake_3.26.0_toolchains//:cmake-3.26.0-windows-i386_toolchain", + "@cmake_3.26.0_toolchains//:cmake-3.26.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.26.0_toolchains", repos = { "cmake-3.26.0-linux-aarch64": [ @@ -4133,17 +4049,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.26.0_toolchains//:cmake-3.26.0-linux-aarch64_toolchain", - "@cmake_3.26.0_toolchains//:cmake-3.26.0-linux-x86_64_toolchain", - "@cmake_3.26.0_toolchains//:cmake-3.26.0-macos-universal_toolchain", - "@cmake_3.26.0_toolchains//:cmake-3.26.0-windows-i386_toolchain", - "@cmake_3.26.0_toolchains//:cmake-3.26.0-windows-x86_64_toolchain", - ) - - return - if "3.26.1" == version: maybe( http_archive, @@ -4215,9 +4120,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.26.1_toolchains//:cmake-3.26.1-linux-aarch64_toolchain", + "@cmake_3.26.1_toolchains//:cmake-3.26.1-linux-x86_64_toolchain", + "@cmake_3.26.1_toolchains//:cmake-3.26.1-macos-universal_toolchain", + "@cmake_3.26.1_toolchains//:cmake-3.26.1-windows-i386_toolchain", + "@cmake_3.26.1_toolchains//:cmake-3.26.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.26.1_toolchains", repos = { "cmake-3.26.1-linux-aarch64": [ @@ -4243,17 +4156,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.26.1_toolchains//:cmake-3.26.1-linux-aarch64_toolchain", - "@cmake_3.26.1_toolchains//:cmake-3.26.1-linux-x86_64_toolchain", - "@cmake_3.26.1_toolchains//:cmake-3.26.1-macos-universal_toolchain", - "@cmake_3.26.1_toolchains//:cmake-3.26.1-windows-i386_toolchain", - "@cmake_3.26.1_toolchains//:cmake-3.26.1-windows-x86_64_toolchain", - ) - - return - if "3.26.2" == version: maybe( http_archive, @@ -4325,9 +4227,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.26.2_toolchains//:cmake-3.26.2-linux-aarch64_toolchain", + "@cmake_3.26.2_toolchains//:cmake-3.26.2-linux-x86_64_toolchain", + "@cmake_3.26.2_toolchains//:cmake-3.26.2-macos-universal_toolchain", + "@cmake_3.26.2_toolchains//:cmake-3.26.2-windows-i386_toolchain", + "@cmake_3.26.2_toolchains//:cmake-3.26.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.26.2_toolchains", repos = { "cmake-3.26.2-linux-aarch64": [ @@ -4353,17 +4263,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.26.2_toolchains//:cmake-3.26.2-linux-aarch64_toolchain", - "@cmake_3.26.2_toolchains//:cmake-3.26.2-linux-x86_64_toolchain", - "@cmake_3.26.2_toolchains//:cmake-3.26.2-macos-universal_toolchain", - "@cmake_3.26.2_toolchains//:cmake-3.26.2-windows-i386_toolchain", - "@cmake_3.26.2_toolchains//:cmake-3.26.2-windows-x86_64_toolchain", - ) - - return - if "3.26.3" == version: maybe( http_archive, @@ -4435,9 +4334,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.26.3_toolchains//:cmake-3.26.3-linux-aarch64_toolchain", + "@cmake_3.26.3_toolchains//:cmake-3.26.3-linux-x86_64_toolchain", + "@cmake_3.26.3_toolchains//:cmake-3.26.3-macos-universal_toolchain", + "@cmake_3.26.3_toolchains//:cmake-3.26.3-windows-i386_toolchain", + "@cmake_3.26.3_toolchains//:cmake-3.26.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.26.3_toolchains", repos = { "cmake-3.26.3-linux-aarch64": [ @@ -4463,17 +4370,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.26.3_toolchains//:cmake-3.26.3-linux-aarch64_toolchain", - "@cmake_3.26.3_toolchains//:cmake-3.26.3-linux-x86_64_toolchain", - "@cmake_3.26.3_toolchains//:cmake-3.26.3-macos-universal_toolchain", - "@cmake_3.26.3_toolchains//:cmake-3.26.3-windows-i386_toolchain", - "@cmake_3.26.3_toolchains//:cmake-3.26.3-windows-x86_64_toolchain", - ) - - return - if "3.26.4" == version: maybe( http_archive, @@ -4545,9 +4441,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.26.4_toolchains//:cmake-3.26.4-linux-aarch64_toolchain", + "@cmake_3.26.4_toolchains//:cmake-3.26.4-linux-x86_64_toolchain", + "@cmake_3.26.4_toolchains//:cmake-3.26.4-macos-universal_toolchain", + "@cmake_3.26.4_toolchains//:cmake-3.26.4-windows-i386_toolchain", + "@cmake_3.26.4_toolchains//:cmake-3.26.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.26.4_toolchains", repos = { "cmake-3.26.4-linux-aarch64": [ @@ -4573,17 +4477,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.26.4_toolchains//:cmake-3.26.4-linux-aarch64_toolchain", - "@cmake_3.26.4_toolchains//:cmake-3.26.4-linux-x86_64_toolchain", - "@cmake_3.26.4_toolchains//:cmake-3.26.4-macos-universal_toolchain", - "@cmake_3.26.4_toolchains//:cmake-3.26.4-windows-i386_toolchain", - "@cmake_3.26.4_toolchains//:cmake-3.26.4-windows-x86_64_toolchain", - ) - - return - if "3.26.5" == version: maybe( http_archive, @@ -4655,9 +4548,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.26.5_toolchains//:cmake-3.26.5-linux-aarch64_toolchain", + "@cmake_3.26.5_toolchains//:cmake-3.26.5-linux-x86_64_toolchain", + "@cmake_3.26.5_toolchains//:cmake-3.26.5-macos-universal_toolchain", + "@cmake_3.26.5_toolchains//:cmake-3.26.5-windows-i386_toolchain", + "@cmake_3.26.5_toolchains//:cmake-3.26.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.26.5_toolchains", repos = { "cmake-3.26.5-linux-aarch64": [ @@ -4683,17 +4584,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.26.5_toolchains//:cmake-3.26.5-linux-aarch64_toolchain", - "@cmake_3.26.5_toolchains//:cmake-3.26.5-linux-x86_64_toolchain", - "@cmake_3.26.5_toolchains//:cmake-3.26.5-macos-universal_toolchain", - "@cmake_3.26.5_toolchains//:cmake-3.26.5-windows-i386_toolchain", - "@cmake_3.26.5_toolchains//:cmake-3.26.5-windows-x86_64_toolchain", - ) - - return - if "3.26.6" == version: maybe( http_archive, @@ -4765,9 +4655,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.26.6_toolchains//:cmake-3.26.6-linux-aarch64_toolchain", + "@cmake_3.26.6_toolchains//:cmake-3.26.6-linux-x86_64_toolchain", + "@cmake_3.26.6_toolchains//:cmake-3.26.6-macos-universal_toolchain", + "@cmake_3.26.6_toolchains//:cmake-3.26.6-windows-i386_toolchain", + "@cmake_3.26.6_toolchains//:cmake-3.26.6-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.26.6_toolchains", repos = { "cmake-3.26.6-linux-aarch64": [ @@ -4793,17 +4691,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.26.6_toolchains//:cmake-3.26.6-linux-aarch64_toolchain", - "@cmake_3.26.6_toolchains//:cmake-3.26.6-linux-x86_64_toolchain", - "@cmake_3.26.6_toolchains//:cmake-3.26.6-macos-universal_toolchain", - "@cmake_3.26.6_toolchains//:cmake-3.26.6-windows-i386_toolchain", - "@cmake_3.26.6_toolchains//:cmake-3.26.6-windows-x86_64_toolchain", - ) - - return - if "3.25.0" == version: maybe( http_archive, @@ -4875,9 +4762,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.25.0_toolchains//:cmake-3.25.0-linux-aarch64_toolchain", + "@cmake_3.25.0_toolchains//:cmake-3.25.0-linux-x86_64_toolchain", + "@cmake_3.25.0_toolchains//:cmake-3.25.0-macos-universal_toolchain", + "@cmake_3.25.0_toolchains//:cmake-3.25.0-windows-i386_toolchain", + "@cmake_3.25.0_toolchains//:cmake-3.25.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.25.0_toolchains", repos = { "cmake-3.25.0-linux-aarch64": [ @@ -4903,17 +4798,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.25.0_toolchains//:cmake-3.25.0-linux-aarch64_toolchain", - "@cmake_3.25.0_toolchains//:cmake-3.25.0-linux-x86_64_toolchain", - "@cmake_3.25.0_toolchains//:cmake-3.25.0-macos-universal_toolchain", - "@cmake_3.25.0_toolchains//:cmake-3.25.0-windows-i386_toolchain", - "@cmake_3.25.0_toolchains//:cmake-3.25.0-windows-x86_64_toolchain", - ) - - return - if "3.25.1" == version: maybe( http_archive, @@ -4985,9 +4869,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.25.1_toolchains//:cmake-3.25.1-linux-aarch64_toolchain", + "@cmake_3.25.1_toolchains//:cmake-3.25.1-linux-x86_64_toolchain", + "@cmake_3.25.1_toolchains//:cmake-3.25.1-macos-universal_toolchain", + "@cmake_3.25.1_toolchains//:cmake-3.25.1-windows-i386_toolchain", + "@cmake_3.25.1_toolchains//:cmake-3.25.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.25.1_toolchains", repos = { "cmake-3.25.1-linux-aarch64": [ @@ -5013,17 +4905,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.25.1_toolchains//:cmake-3.25.1-linux-aarch64_toolchain", - "@cmake_3.25.1_toolchains//:cmake-3.25.1-linux-x86_64_toolchain", - "@cmake_3.25.1_toolchains//:cmake-3.25.1-macos-universal_toolchain", - "@cmake_3.25.1_toolchains//:cmake-3.25.1-windows-i386_toolchain", - "@cmake_3.25.1_toolchains//:cmake-3.25.1-windows-x86_64_toolchain", - ) - - return - if "3.25.2" == version: maybe( http_archive, @@ -5095,9 +4976,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.25.2_toolchains//:cmake-3.25.2-linux-aarch64_toolchain", + "@cmake_3.25.2_toolchains//:cmake-3.25.2-linux-x86_64_toolchain", + "@cmake_3.25.2_toolchains//:cmake-3.25.2-macos-universal_toolchain", + "@cmake_3.25.2_toolchains//:cmake-3.25.2-windows-i386_toolchain", + "@cmake_3.25.2_toolchains//:cmake-3.25.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.25.2_toolchains", repos = { "cmake-3.25.2-linux-aarch64": [ @@ -5123,17 +5012,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.25.2_toolchains//:cmake-3.25.2-linux-aarch64_toolchain", - "@cmake_3.25.2_toolchains//:cmake-3.25.2-linux-x86_64_toolchain", - "@cmake_3.25.2_toolchains//:cmake-3.25.2-macos-universal_toolchain", - "@cmake_3.25.2_toolchains//:cmake-3.25.2-windows-i386_toolchain", - "@cmake_3.25.2_toolchains//:cmake-3.25.2-windows-x86_64_toolchain", - ) - - return - if "3.25.3" == version: maybe( http_archive, @@ -5205,9 +5083,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.25.3_toolchains//:cmake-3.25.3-linux-aarch64_toolchain", + "@cmake_3.25.3_toolchains//:cmake-3.25.3-linux-x86_64_toolchain", + "@cmake_3.25.3_toolchains//:cmake-3.25.3-macos-universal_toolchain", + "@cmake_3.25.3_toolchains//:cmake-3.25.3-windows-i386_toolchain", + "@cmake_3.25.3_toolchains//:cmake-3.25.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.25.3_toolchains", repos = { "cmake-3.25.3-linux-aarch64": [ @@ -5233,17 +5119,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.25.3_toolchains//:cmake-3.25.3-linux-aarch64_toolchain", - "@cmake_3.25.3_toolchains//:cmake-3.25.3-linux-x86_64_toolchain", - "@cmake_3.25.3_toolchains//:cmake-3.25.3-macos-universal_toolchain", - "@cmake_3.25.3_toolchains//:cmake-3.25.3-windows-i386_toolchain", - "@cmake_3.25.3_toolchains//:cmake-3.25.3-windows-x86_64_toolchain", - ) - - return - if "3.24.0" == version: maybe( http_archive, @@ -5315,9 +5190,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.24.0_toolchains//:cmake-3.24.0-linux-aarch64_toolchain", + "@cmake_3.24.0_toolchains//:cmake-3.24.0-linux-x86_64_toolchain", + "@cmake_3.24.0_toolchains//:cmake-3.24.0-macos-universal_toolchain", + "@cmake_3.24.0_toolchains//:cmake-3.24.0-windows-i386_toolchain", + "@cmake_3.24.0_toolchains//:cmake-3.24.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.24.0_toolchains", repos = { "cmake-3.24.0-linux-aarch64": [ @@ -5343,17 +5226,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.24.0_toolchains//:cmake-3.24.0-linux-aarch64_toolchain", - "@cmake_3.24.0_toolchains//:cmake-3.24.0-linux-x86_64_toolchain", - "@cmake_3.24.0_toolchains//:cmake-3.24.0-macos-universal_toolchain", - "@cmake_3.24.0_toolchains//:cmake-3.24.0-windows-i386_toolchain", - "@cmake_3.24.0_toolchains//:cmake-3.24.0-windows-x86_64_toolchain", - ) - - return - if "3.24.1" == version: maybe( http_archive, @@ -5425,9 +5297,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.24.1_toolchains//:cmake-3.24.1-linux-aarch64_toolchain", + "@cmake_3.24.1_toolchains//:cmake-3.24.1-linux-x86_64_toolchain", + "@cmake_3.24.1_toolchains//:cmake-3.24.1-macos-universal_toolchain", + "@cmake_3.24.1_toolchains//:cmake-3.24.1-windows-i386_toolchain", + "@cmake_3.24.1_toolchains//:cmake-3.24.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.24.1_toolchains", repos = { "cmake-3.24.1-linux-aarch64": [ @@ -5453,17 +5333,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.24.1_toolchains//:cmake-3.24.1-linux-aarch64_toolchain", - "@cmake_3.24.1_toolchains//:cmake-3.24.1-linux-x86_64_toolchain", - "@cmake_3.24.1_toolchains//:cmake-3.24.1-macos-universal_toolchain", - "@cmake_3.24.1_toolchains//:cmake-3.24.1-windows-i386_toolchain", - "@cmake_3.24.1_toolchains//:cmake-3.24.1-windows-x86_64_toolchain", - ) - - return - if "3.24.2" == version: maybe( http_archive, @@ -5535,9 +5404,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.24.2_toolchains//:cmake-3.24.2-linux-aarch64_toolchain", + "@cmake_3.24.2_toolchains//:cmake-3.24.2-linux-x86_64_toolchain", + "@cmake_3.24.2_toolchains//:cmake-3.24.2-macos-universal_toolchain", + "@cmake_3.24.2_toolchains//:cmake-3.24.2-windows-i386_toolchain", + "@cmake_3.24.2_toolchains//:cmake-3.24.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.24.2_toolchains", repos = { "cmake-3.24.2-linux-aarch64": [ @@ -5563,17 +5440,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.24.2_toolchains//:cmake-3.24.2-linux-aarch64_toolchain", - "@cmake_3.24.2_toolchains//:cmake-3.24.2-linux-x86_64_toolchain", - "@cmake_3.24.2_toolchains//:cmake-3.24.2-macos-universal_toolchain", - "@cmake_3.24.2_toolchains//:cmake-3.24.2-windows-i386_toolchain", - "@cmake_3.24.2_toolchains//:cmake-3.24.2-windows-x86_64_toolchain", - ) - - return - if "3.24.3" == version: maybe( http_archive, @@ -5645,15 +5511,23 @@ def _cmake_toolchains(version, register_toolchains): ), ) - # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, - name = "cmake_3.24.3_toolchains", - repos = { - "cmake-3.24.3-linux-aarch64": [ - "@platforms//cpu:aarch64", - "@platforms//os:linux", - ], + if register_toolchains: + native.register_toolchains( + "@cmake_3.24.3_toolchains//:cmake-3.24.3-linux-aarch64_toolchain", + "@cmake_3.24.3_toolchains//:cmake-3.24.3-linux-x86_64_toolchain", + "@cmake_3.24.3_toolchains//:cmake-3.24.3-macos-universal_toolchain", + "@cmake_3.24.3_toolchains//:cmake-3.24.3-windows-i386_toolchain", + "@cmake_3.24.3_toolchains//:cmake-3.24.3-windows-x86_64_toolchain", + ) + + # buildifier: leave-alone + return maybe_prebuilt_toolchains_repository( + name = "cmake_3.24.3_toolchains", + repos = { + "cmake-3.24.3-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], "cmake-3.24.3-linux-x86_64": [ "@platforms//cpu:x86_64", "@platforms//os:linux", @@ -5673,17 +5547,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.24.3_toolchains//:cmake-3.24.3-linux-aarch64_toolchain", - "@cmake_3.24.3_toolchains//:cmake-3.24.3-linux-x86_64_toolchain", - "@cmake_3.24.3_toolchains//:cmake-3.24.3-macos-universal_toolchain", - "@cmake_3.24.3_toolchains//:cmake-3.24.3-windows-i386_toolchain", - "@cmake_3.24.3_toolchains//:cmake-3.24.3-windows-x86_64_toolchain", - ) - - return - if "3.24.4" == version: maybe( http_archive, @@ -5755,9 +5618,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.24.4_toolchains//:cmake-3.24.4-linux-aarch64_toolchain", + "@cmake_3.24.4_toolchains//:cmake-3.24.4-linux-x86_64_toolchain", + "@cmake_3.24.4_toolchains//:cmake-3.24.4-macos-universal_toolchain", + "@cmake_3.24.4_toolchains//:cmake-3.24.4-windows-i386_toolchain", + "@cmake_3.24.4_toolchains//:cmake-3.24.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.24.4_toolchains", repos = { "cmake-3.24.4-linux-aarch64": [ @@ -5783,17 +5654,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.24.4_toolchains//:cmake-3.24.4-linux-aarch64_toolchain", - "@cmake_3.24.4_toolchains//:cmake-3.24.4-linux-x86_64_toolchain", - "@cmake_3.24.4_toolchains//:cmake-3.24.4-macos-universal_toolchain", - "@cmake_3.24.4_toolchains//:cmake-3.24.4-windows-i386_toolchain", - "@cmake_3.24.4_toolchains//:cmake-3.24.4-windows-x86_64_toolchain", - ) - - return - if "3.23.0" == version: maybe( http_archive, @@ -5865,9 +5725,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.23.0_toolchains//:cmake-3.23.0-linux-aarch64_toolchain", + "@cmake_3.23.0_toolchains//:cmake-3.23.0-linux-x86_64_toolchain", + "@cmake_3.23.0_toolchains//:cmake-3.23.0-macos-universal_toolchain", + "@cmake_3.23.0_toolchains//:cmake-3.23.0-windows-i386_toolchain", + "@cmake_3.23.0_toolchains//:cmake-3.23.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.23.0_toolchains", repos = { "cmake-3.23.0-linux-aarch64": [ @@ -5893,17 +5761,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.23.0_toolchains//:cmake-3.23.0-linux-aarch64_toolchain", - "@cmake_3.23.0_toolchains//:cmake-3.23.0-linux-x86_64_toolchain", - "@cmake_3.23.0_toolchains//:cmake-3.23.0-macos-universal_toolchain", - "@cmake_3.23.0_toolchains//:cmake-3.23.0-windows-i386_toolchain", - "@cmake_3.23.0_toolchains//:cmake-3.23.0-windows-x86_64_toolchain", - ) - - return - if "3.23.1" == version: maybe( http_archive, @@ -5975,9 +5832,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.23.1_toolchains//:cmake-3.23.1-linux-aarch64_toolchain", + "@cmake_3.23.1_toolchains//:cmake-3.23.1-linux-x86_64_toolchain", + "@cmake_3.23.1_toolchains//:cmake-3.23.1-macos-universal_toolchain", + "@cmake_3.23.1_toolchains//:cmake-3.23.1-windows-i386_toolchain", + "@cmake_3.23.1_toolchains//:cmake-3.23.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.23.1_toolchains", repos = { "cmake-3.23.1-linux-aarch64": [ @@ -6003,17 +5868,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.23.1_toolchains//:cmake-3.23.1-linux-aarch64_toolchain", - "@cmake_3.23.1_toolchains//:cmake-3.23.1-linux-x86_64_toolchain", - "@cmake_3.23.1_toolchains//:cmake-3.23.1-macos-universal_toolchain", - "@cmake_3.23.1_toolchains//:cmake-3.23.1-windows-i386_toolchain", - "@cmake_3.23.1_toolchains//:cmake-3.23.1-windows-x86_64_toolchain", - ) - - return - if "3.23.2" == version: maybe( http_archive, @@ -6085,9 +5939,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.23.2_toolchains//:cmake-3.23.2-linux-aarch64_toolchain", + "@cmake_3.23.2_toolchains//:cmake-3.23.2-linux-x86_64_toolchain", + "@cmake_3.23.2_toolchains//:cmake-3.23.2-macos-universal_toolchain", + "@cmake_3.23.2_toolchains//:cmake-3.23.2-windows-i386_toolchain", + "@cmake_3.23.2_toolchains//:cmake-3.23.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.23.2_toolchains", repos = { "cmake-3.23.2-linux-aarch64": [ @@ -6113,17 +5975,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.23.2_toolchains//:cmake-3.23.2-linux-aarch64_toolchain", - "@cmake_3.23.2_toolchains//:cmake-3.23.2-linux-x86_64_toolchain", - "@cmake_3.23.2_toolchains//:cmake-3.23.2-macos-universal_toolchain", - "@cmake_3.23.2_toolchains//:cmake-3.23.2-windows-i386_toolchain", - "@cmake_3.23.2_toolchains//:cmake-3.23.2-windows-x86_64_toolchain", - ) - - return - if "3.23.3" == version: maybe( http_archive, @@ -6195,9 +6046,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.23.3_toolchains//:cmake-3.23.3-linux-aarch64_toolchain", + "@cmake_3.23.3_toolchains//:cmake-3.23.3-linux-x86_64_toolchain", + "@cmake_3.23.3_toolchains//:cmake-3.23.3-macos-universal_toolchain", + "@cmake_3.23.3_toolchains//:cmake-3.23.3-windows-i386_toolchain", + "@cmake_3.23.3_toolchains//:cmake-3.23.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.23.3_toolchains", repos = { "cmake-3.23.3-linux-aarch64": [ @@ -6223,17 +6082,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.23.3_toolchains//:cmake-3.23.3-linux-aarch64_toolchain", - "@cmake_3.23.3_toolchains//:cmake-3.23.3-linux-x86_64_toolchain", - "@cmake_3.23.3_toolchains//:cmake-3.23.3-macos-universal_toolchain", - "@cmake_3.23.3_toolchains//:cmake-3.23.3-windows-i386_toolchain", - "@cmake_3.23.3_toolchains//:cmake-3.23.3-windows-x86_64_toolchain", - ) - - return - if "3.23.4" == version: maybe( http_archive, @@ -6305,9 +6153,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.23.4_toolchains//:cmake-3.23.4-linux-aarch64_toolchain", + "@cmake_3.23.4_toolchains//:cmake-3.23.4-linux-x86_64_toolchain", + "@cmake_3.23.4_toolchains//:cmake-3.23.4-macos-universal_toolchain", + "@cmake_3.23.4_toolchains//:cmake-3.23.4-windows-i386_toolchain", + "@cmake_3.23.4_toolchains//:cmake-3.23.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.23.4_toolchains", repos = { "cmake-3.23.4-linux-aarch64": [ @@ -6333,17 +6189,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.23.4_toolchains//:cmake-3.23.4-linux-aarch64_toolchain", - "@cmake_3.23.4_toolchains//:cmake-3.23.4-linux-x86_64_toolchain", - "@cmake_3.23.4_toolchains//:cmake-3.23.4-macos-universal_toolchain", - "@cmake_3.23.4_toolchains//:cmake-3.23.4-windows-i386_toolchain", - "@cmake_3.23.4_toolchains//:cmake-3.23.4-windows-x86_64_toolchain", - ) - - return - if "3.23.5" == version: maybe( http_archive, @@ -6415,9 +6260,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.23.5_toolchains//:cmake-3.23.5-linux-aarch64_toolchain", + "@cmake_3.23.5_toolchains//:cmake-3.23.5-linux-x86_64_toolchain", + "@cmake_3.23.5_toolchains//:cmake-3.23.5-macos-universal_toolchain", + "@cmake_3.23.5_toolchains//:cmake-3.23.5-windows-i386_toolchain", + "@cmake_3.23.5_toolchains//:cmake-3.23.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.23.5_toolchains", repos = { "cmake-3.23.5-linux-aarch64": [ @@ -6443,17 +6296,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.23.5_toolchains//:cmake-3.23.5-linux-aarch64_toolchain", - "@cmake_3.23.5_toolchains//:cmake-3.23.5-linux-x86_64_toolchain", - "@cmake_3.23.5_toolchains//:cmake-3.23.5-macos-universal_toolchain", - "@cmake_3.23.5_toolchains//:cmake-3.23.5-windows-i386_toolchain", - "@cmake_3.23.5_toolchains//:cmake-3.23.5-windows-x86_64_toolchain", - ) - - return - if "3.22.0" == version: maybe( http_archive, @@ -6525,9 +6367,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.22.0_toolchains//:cmake-3.22.0-linux-aarch64_toolchain", + "@cmake_3.22.0_toolchains//:cmake-3.22.0-linux-x86_64_toolchain", + "@cmake_3.22.0_toolchains//:cmake-3.22.0-macos-universal_toolchain", + "@cmake_3.22.0_toolchains//:cmake-3.22.0-windows-i386_toolchain", + "@cmake_3.22.0_toolchains//:cmake-3.22.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.22.0_toolchains", repos = { "cmake-3.22.0-linux-aarch64": [ @@ -6553,17 +6403,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.22.0_toolchains//:cmake-3.22.0-linux-aarch64_toolchain", - "@cmake_3.22.0_toolchains//:cmake-3.22.0-linux-x86_64_toolchain", - "@cmake_3.22.0_toolchains//:cmake-3.22.0-macos-universal_toolchain", - "@cmake_3.22.0_toolchains//:cmake-3.22.0-windows-i386_toolchain", - "@cmake_3.22.0_toolchains//:cmake-3.22.0-windows-x86_64_toolchain", - ) - - return - if "3.22.1" == version: maybe( http_archive, @@ -6635,9 +6474,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.22.1_toolchains//:cmake-3.22.1-linux-aarch64_toolchain", + "@cmake_3.22.1_toolchains//:cmake-3.22.1-linux-x86_64_toolchain", + "@cmake_3.22.1_toolchains//:cmake-3.22.1-macos-universal_toolchain", + "@cmake_3.22.1_toolchains//:cmake-3.22.1-windows-i386_toolchain", + "@cmake_3.22.1_toolchains//:cmake-3.22.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.22.1_toolchains", repos = { "cmake-3.22.1-linux-aarch64": [ @@ -6663,17 +6510,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.22.1_toolchains//:cmake-3.22.1-linux-aarch64_toolchain", - "@cmake_3.22.1_toolchains//:cmake-3.22.1-linux-x86_64_toolchain", - "@cmake_3.22.1_toolchains//:cmake-3.22.1-macos-universal_toolchain", - "@cmake_3.22.1_toolchains//:cmake-3.22.1-windows-i386_toolchain", - "@cmake_3.22.1_toolchains//:cmake-3.22.1-windows-x86_64_toolchain", - ) - - return - if "3.22.2" == version: maybe( http_archive, @@ -6745,9 +6581,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.22.2_toolchains//:cmake-3.22.2-linux-aarch64_toolchain", + "@cmake_3.22.2_toolchains//:cmake-3.22.2-linux-x86_64_toolchain", + "@cmake_3.22.2_toolchains//:cmake-3.22.2-macos-universal_toolchain", + "@cmake_3.22.2_toolchains//:cmake-3.22.2-windows-i386_toolchain", + "@cmake_3.22.2_toolchains//:cmake-3.22.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.22.2_toolchains", repos = { "cmake-3.22.2-linux-aarch64": [ @@ -6773,17 +6617,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.22.2_toolchains//:cmake-3.22.2-linux-aarch64_toolchain", - "@cmake_3.22.2_toolchains//:cmake-3.22.2-linux-x86_64_toolchain", - "@cmake_3.22.2_toolchains//:cmake-3.22.2-macos-universal_toolchain", - "@cmake_3.22.2_toolchains//:cmake-3.22.2-windows-i386_toolchain", - "@cmake_3.22.2_toolchains//:cmake-3.22.2-windows-x86_64_toolchain", - ) - - return - if "3.22.3" == version: maybe( http_archive, @@ -6855,9 +6688,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.22.3_toolchains//:cmake-3.22.3-linux-aarch64_toolchain", + "@cmake_3.22.3_toolchains//:cmake-3.22.3-linux-x86_64_toolchain", + "@cmake_3.22.3_toolchains//:cmake-3.22.3-macos-universal_toolchain", + "@cmake_3.22.3_toolchains//:cmake-3.22.3-windows-i386_toolchain", + "@cmake_3.22.3_toolchains//:cmake-3.22.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.22.3_toolchains", repos = { "cmake-3.22.3-linux-aarch64": [ @@ -6883,17 +6724,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.22.3_toolchains//:cmake-3.22.3-linux-aarch64_toolchain", - "@cmake_3.22.3_toolchains//:cmake-3.22.3-linux-x86_64_toolchain", - "@cmake_3.22.3_toolchains//:cmake-3.22.3-macos-universal_toolchain", - "@cmake_3.22.3_toolchains//:cmake-3.22.3-windows-i386_toolchain", - "@cmake_3.22.3_toolchains//:cmake-3.22.3-windows-x86_64_toolchain", - ) - - return - if "3.22.4" == version: maybe( http_archive, @@ -6965,9 +6795,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.22.4_toolchains//:cmake-3.22.4-linux-aarch64_toolchain", + "@cmake_3.22.4_toolchains//:cmake-3.22.4-linux-x86_64_toolchain", + "@cmake_3.22.4_toolchains//:cmake-3.22.4-macos-universal_toolchain", + "@cmake_3.22.4_toolchains//:cmake-3.22.4-windows-i386_toolchain", + "@cmake_3.22.4_toolchains//:cmake-3.22.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.22.4_toolchains", repos = { "cmake-3.22.4-linux-aarch64": [ @@ -6993,17 +6831,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.22.4_toolchains//:cmake-3.22.4-linux-aarch64_toolchain", - "@cmake_3.22.4_toolchains//:cmake-3.22.4-linux-x86_64_toolchain", - "@cmake_3.22.4_toolchains//:cmake-3.22.4-macos-universal_toolchain", - "@cmake_3.22.4_toolchains//:cmake-3.22.4-windows-i386_toolchain", - "@cmake_3.22.4_toolchains//:cmake-3.22.4-windows-x86_64_toolchain", - ) - - return - if "3.22.5" == version: maybe( http_archive, @@ -7075,9 +6902,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.22.5_toolchains//:cmake-3.22.5-linux-aarch64_toolchain", + "@cmake_3.22.5_toolchains//:cmake-3.22.5-linux-x86_64_toolchain", + "@cmake_3.22.5_toolchains//:cmake-3.22.5-macos-universal_toolchain", + "@cmake_3.22.5_toolchains//:cmake-3.22.5-windows-i386_toolchain", + "@cmake_3.22.5_toolchains//:cmake-3.22.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.22.5_toolchains", repos = { "cmake-3.22.5-linux-aarch64": [ @@ -7103,17 +6938,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.22.5_toolchains//:cmake-3.22.5-linux-aarch64_toolchain", - "@cmake_3.22.5_toolchains//:cmake-3.22.5-linux-x86_64_toolchain", - "@cmake_3.22.5_toolchains//:cmake-3.22.5-macos-universal_toolchain", - "@cmake_3.22.5_toolchains//:cmake-3.22.5-windows-i386_toolchain", - "@cmake_3.22.5_toolchains//:cmake-3.22.5-windows-x86_64_toolchain", - ) - - return - if "3.22.6" == version: maybe( http_archive, @@ -7185,9 +7009,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.22.6_toolchains//:cmake-3.22.6-linux-aarch64_toolchain", + "@cmake_3.22.6_toolchains//:cmake-3.22.6-linux-x86_64_toolchain", + "@cmake_3.22.6_toolchains//:cmake-3.22.6-macos-universal_toolchain", + "@cmake_3.22.6_toolchains//:cmake-3.22.6-windows-i386_toolchain", + "@cmake_3.22.6_toolchains//:cmake-3.22.6-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.22.6_toolchains", repos = { "cmake-3.22.6-linux-aarch64": [ @@ -7213,17 +7045,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.22.6_toolchains//:cmake-3.22.6-linux-aarch64_toolchain", - "@cmake_3.22.6_toolchains//:cmake-3.22.6-linux-x86_64_toolchain", - "@cmake_3.22.6_toolchains//:cmake-3.22.6-macos-universal_toolchain", - "@cmake_3.22.6_toolchains//:cmake-3.22.6-windows-i386_toolchain", - "@cmake_3.22.6_toolchains//:cmake-3.22.6-windows-x86_64_toolchain", - ) - - return - if "3.21.0" == version: maybe( http_archive, @@ -7295,9 +7116,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.0_toolchains//:cmake-3.21.0-linux-aarch64_toolchain", + "@cmake_3.21.0_toolchains//:cmake-3.21.0-linux-x86_64_toolchain", + "@cmake_3.21.0_toolchains//:cmake-3.21.0-macos-universal_toolchain", + "@cmake_3.21.0_toolchains//:cmake-3.21.0-windows-i386_toolchain", + "@cmake_3.21.0_toolchains//:cmake-3.21.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.0_toolchains", repos = { "cmake-3.21.0-linux-aarch64": [ @@ -7323,17 +7152,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.0_toolchains//:cmake-3.21.0-linux-aarch64_toolchain", - "@cmake_3.21.0_toolchains//:cmake-3.21.0-linux-x86_64_toolchain", - "@cmake_3.21.0_toolchains//:cmake-3.21.0-macos-universal_toolchain", - "@cmake_3.21.0_toolchains//:cmake-3.21.0-windows-i386_toolchain", - "@cmake_3.21.0_toolchains//:cmake-3.21.0-windows-x86_64_toolchain", - ) - - return - if "3.21.1" == version: maybe( http_archive, @@ -7405,9 +7223,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.1_toolchains//:cmake-3.21.1-linux-aarch64_toolchain", + "@cmake_3.21.1_toolchains//:cmake-3.21.1-linux-x86_64_toolchain", + "@cmake_3.21.1_toolchains//:cmake-3.21.1-macos-universal_toolchain", + "@cmake_3.21.1_toolchains//:cmake-3.21.1-windows-i386_toolchain", + "@cmake_3.21.1_toolchains//:cmake-3.21.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.1_toolchains", repos = { "cmake-3.21.1-linux-aarch64": [ @@ -7433,17 +7259,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.1_toolchains//:cmake-3.21.1-linux-aarch64_toolchain", - "@cmake_3.21.1_toolchains//:cmake-3.21.1-linux-x86_64_toolchain", - "@cmake_3.21.1_toolchains//:cmake-3.21.1-macos-universal_toolchain", - "@cmake_3.21.1_toolchains//:cmake-3.21.1-windows-i386_toolchain", - "@cmake_3.21.1_toolchains//:cmake-3.21.1-windows-x86_64_toolchain", - ) - - return - if "3.21.2" == version: maybe( http_archive, @@ -7515,9 +7330,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.2_toolchains//:cmake-3.21.2-linux-aarch64_toolchain", + "@cmake_3.21.2_toolchains//:cmake-3.21.2-linux-x86_64_toolchain", + "@cmake_3.21.2_toolchains//:cmake-3.21.2-macos-universal_toolchain", + "@cmake_3.21.2_toolchains//:cmake-3.21.2-windows-i386_toolchain", + "@cmake_3.21.2_toolchains//:cmake-3.21.2-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.2_toolchains", repos = { "cmake-3.21.2-linux-aarch64": [ @@ -7543,17 +7366,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.2_toolchains//:cmake-3.21.2-linux-aarch64_toolchain", - "@cmake_3.21.2_toolchains//:cmake-3.21.2-linux-x86_64_toolchain", - "@cmake_3.21.2_toolchains//:cmake-3.21.2-macos-universal_toolchain", - "@cmake_3.21.2_toolchains//:cmake-3.21.2-windows-i386_toolchain", - "@cmake_3.21.2_toolchains//:cmake-3.21.2-windows-x86_64_toolchain", - ) - - return - if "3.21.3" == version: maybe( http_archive, @@ -7625,9 +7437,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.3_toolchains//:cmake-3.21.3-linux-aarch64_toolchain", + "@cmake_3.21.3_toolchains//:cmake-3.21.3-linux-x86_64_toolchain", + "@cmake_3.21.3_toolchains//:cmake-3.21.3-macos-universal_toolchain", + "@cmake_3.21.3_toolchains//:cmake-3.21.3-windows-i386_toolchain", + "@cmake_3.21.3_toolchains//:cmake-3.21.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.3_toolchains", repos = { "cmake-3.21.3-linux-aarch64": [ @@ -7653,17 +7473,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.3_toolchains//:cmake-3.21.3-linux-aarch64_toolchain", - "@cmake_3.21.3_toolchains//:cmake-3.21.3-linux-x86_64_toolchain", - "@cmake_3.21.3_toolchains//:cmake-3.21.3-macos-universal_toolchain", - "@cmake_3.21.3_toolchains//:cmake-3.21.3-windows-i386_toolchain", - "@cmake_3.21.3_toolchains//:cmake-3.21.3-windows-x86_64_toolchain", - ) - - return - if "3.21.4" == version: maybe( http_archive, @@ -7735,9 +7544,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.4_toolchains//:cmake-3.21.4-linux-aarch64_toolchain", + "@cmake_3.21.4_toolchains//:cmake-3.21.4-linux-x86_64_toolchain", + "@cmake_3.21.4_toolchains//:cmake-3.21.4-macos-universal_toolchain", + "@cmake_3.21.4_toolchains//:cmake-3.21.4-windows-i386_toolchain", + "@cmake_3.21.4_toolchains//:cmake-3.21.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.4_toolchains", repos = { "cmake-3.21.4-linux-aarch64": [ @@ -7763,17 +7580,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.4_toolchains//:cmake-3.21.4-linux-aarch64_toolchain", - "@cmake_3.21.4_toolchains//:cmake-3.21.4-linux-x86_64_toolchain", - "@cmake_3.21.4_toolchains//:cmake-3.21.4-macos-universal_toolchain", - "@cmake_3.21.4_toolchains//:cmake-3.21.4-windows-i386_toolchain", - "@cmake_3.21.4_toolchains//:cmake-3.21.4-windows-x86_64_toolchain", - ) - - return - if "3.21.5" == version: maybe( http_archive, @@ -7845,9 +7651,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.5_toolchains//:cmake-3.21.5-linux-aarch64_toolchain", + "@cmake_3.21.5_toolchains//:cmake-3.21.5-linux-x86_64_toolchain", + "@cmake_3.21.5_toolchains//:cmake-3.21.5-macos-universal_toolchain", + "@cmake_3.21.5_toolchains//:cmake-3.21.5-windows-i386_toolchain", + "@cmake_3.21.5_toolchains//:cmake-3.21.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.5_toolchains", repos = { "cmake-3.21.5-linux-aarch64": [ @@ -7873,17 +7687,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.5_toolchains//:cmake-3.21.5-linux-aarch64_toolchain", - "@cmake_3.21.5_toolchains//:cmake-3.21.5-linux-x86_64_toolchain", - "@cmake_3.21.5_toolchains//:cmake-3.21.5-macos-universal_toolchain", - "@cmake_3.21.5_toolchains//:cmake-3.21.5-windows-i386_toolchain", - "@cmake_3.21.5_toolchains//:cmake-3.21.5-windows-x86_64_toolchain", - ) - - return - if "3.21.6" == version: maybe( http_archive, @@ -7955,9 +7758,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.6_toolchains//:cmake-3.21.6-linux-aarch64_toolchain", + "@cmake_3.21.6_toolchains//:cmake-3.21.6-linux-x86_64_toolchain", + "@cmake_3.21.6_toolchains//:cmake-3.21.6-macos-universal_toolchain", + "@cmake_3.21.6_toolchains//:cmake-3.21.6-windows-i386_toolchain", + "@cmake_3.21.6_toolchains//:cmake-3.21.6-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.6_toolchains", repos = { "cmake-3.21.6-linux-aarch64": [ @@ -7983,17 +7794,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.6_toolchains//:cmake-3.21.6-linux-aarch64_toolchain", - "@cmake_3.21.6_toolchains//:cmake-3.21.6-linux-x86_64_toolchain", - "@cmake_3.21.6_toolchains//:cmake-3.21.6-macos-universal_toolchain", - "@cmake_3.21.6_toolchains//:cmake-3.21.6-windows-i386_toolchain", - "@cmake_3.21.6_toolchains//:cmake-3.21.6-windows-x86_64_toolchain", - ) - - return - if "3.21.7" == version: maybe( http_archive, @@ -8065,9 +7865,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.21.7_toolchains//:cmake-3.21.7-linux-aarch64_toolchain", + "@cmake_3.21.7_toolchains//:cmake-3.21.7-linux-x86_64_toolchain", + "@cmake_3.21.7_toolchains//:cmake-3.21.7-macos-universal_toolchain", + "@cmake_3.21.7_toolchains//:cmake-3.21.7-windows-i386_toolchain", + "@cmake_3.21.7_toolchains//:cmake-3.21.7-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.21.7_toolchains", repos = { "cmake-3.21.7-linux-aarch64": [ @@ -8093,17 +7901,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.21.7_toolchains//:cmake-3.21.7-linux-aarch64_toolchain", - "@cmake_3.21.7_toolchains//:cmake-3.21.7-linux-x86_64_toolchain", - "@cmake_3.21.7_toolchains//:cmake-3.21.7-macos-universal_toolchain", - "@cmake_3.21.7_toolchains//:cmake-3.21.7-windows-i386_toolchain", - "@cmake_3.21.7_toolchains//:cmake-3.21.7-windows-x86_64_toolchain", - ) - - return - if "3.20.0" == version: maybe( http_archive, @@ -8175,9 +7972,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.20.0_toolchains//:cmake-3.20.0-linux-aarch64_toolchain", + "@cmake_3.20.0_toolchains//:cmake-3.20.0-linux-x86_64_toolchain", + "@cmake_3.20.0_toolchains//:cmake-3.20.0-macos-universal_toolchain", + "@cmake_3.20.0_toolchains//:cmake-3.20.0-windows-i386_toolchain", + "@cmake_3.20.0_toolchains//:cmake-3.20.0-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.20.0_toolchains", repos = { "cmake-3.20.0-linux-aarch64": [ @@ -8203,17 +8008,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.20.0_toolchains//:cmake-3.20.0-linux-aarch64_toolchain", - "@cmake_3.20.0_toolchains//:cmake-3.20.0-linux-x86_64_toolchain", - "@cmake_3.20.0_toolchains//:cmake-3.20.0-macos-universal_toolchain", - "@cmake_3.20.0_toolchains//:cmake-3.20.0-windows-i386_toolchain", - "@cmake_3.20.0_toolchains//:cmake-3.20.0-windows-x86_64_toolchain", - ) - - return - if "3.20.1" == version: maybe( http_archive, @@ -8285,9 +8079,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.20.1_toolchains//:cmake-3.20.1-linux-aarch64_toolchain", + "@cmake_3.20.1_toolchains//:cmake-3.20.1-linux-x86_64_toolchain", + "@cmake_3.20.1_toolchains//:cmake-3.20.1-macos-universal_toolchain", + "@cmake_3.20.1_toolchains//:cmake-3.20.1-windows-i386_toolchain", + "@cmake_3.20.1_toolchains//:cmake-3.20.1-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.20.1_toolchains", repos = { "cmake-3.20.1-linux-aarch64": [ @@ -8313,17 +8115,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.20.1_toolchains//:cmake-3.20.1-linux-aarch64_toolchain", - "@cmake_3.20.1_toolchains//:cmake-3.20.1-linux-x86_64_toolchain", - "@cmake_3.20.1_toolchains//:cmake-3.20.1-macos-universal_toolchain", - "@cmake_3.20.1_toolchains//:cmake-3.20.1-windows-i386_toolchain", - "@cmake_3.20.1_toolchains//:cmake-3.20.1-windows-x86_64_toolchain", - ) - - return - if "3.20.2" == version: maybe( http_archive, @@ -8395,13 +8186,21 @@ def _cmake_toolchains(version, register_toolchains): ), ) - # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, - name = "cmake_3.20.2_toolchains", - repos = { - "cmake-3.20.2-linux-aarch64": [ - "@platforms//cpu:aarch64", + if register_toolchains: + native.register_toolchains( + "@cmake_3.20.2_toolchains//:cmake-3.20.2-linux-aarch64_toolchain", + "@cmake_3.20.2_toolchains//:cmake-3.20.2-linux-x86_64_toolchain", + "@cmake_3.20.2_toolchains//:cmake-3.20.2-macos-universal_toolchain", + "@cmake_3.20.2_toolchains//:cmake-3.20.2-windows-i386_toolchain", + "@cmake_3.20.2_toolchains//:cmake-3.20.2-windows-x86_64_toolchain", + ) + + # buildifier: leave-alone + return maybe_prebuilt_toolchains_repository( + name = "cmake_3.20.2_toolchains", + repos = { + "cmake-3.20.2-linux-aarch64": [ + "@platforms//cpu:aarch64", "@platforms//os:linux", ], "cmake-3.20.2-linux-x86_64": [ @@ -8423,17 +8222,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.20.2_toolchains//:cmake-3.20.2-linux-aarch64_toolchain", - "@cmake_3.20.2_toolchains//:cmake-3.20.2-linux-x86_64_toolchain", - "@cmake_3.20.2_toolchains//:cmake-3.20.2-macos-universal_toolchain", - "@cmake_3.20.2_toolchains//:cmake-3.20.2-windows-i386_toolchain", - "@cmake_3.20.2_toolchains//:cmake-3.20.2-windows-x86_64_toolchain", - ) - - return - if "3.20.3" == version: maybe( http_archive, @@ -8505,9 +8293,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.20.3_toolchains//:cmake-3.20.3-linux-aarch64_toolchain", + "@cmake_3.20.3_toolchains//:cmake-3.20.3-linux-x86_64_toolchain", + "@cmake_3.20.3_toolchains//:cmake-3.20.3-macos-universal_toolchain", + "@cmake_3.20.3_toolchains//:cmake-3.20.3-windows-i386_toolchain", + "@cmake_3.20.3_toolchains//:cmake-3.20.3-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.20.3_toolchains", repos = { "cmake-3.20.3-linux-aarch64": [ @@ -8533,17 +8329,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.20.3_toolchains//:cmake-3.20.3-linux-aarch64_toolchain", - "@cmake_3.20.3_toolchains//:cmake-3.20.3-linux-x86_64_toolchain", - "@cmake_3.20.3_toolchains//:cmake-3.20.3-macos-universal_toolchain", - "@cmake_3.20.3_toolchains//:cmake-3.20.3-windows-i386_toolchain", - "@cmake_3.20.3_toolchains//:cmake-3.20.3-windows-x86_64_toolchain", - ) - - return - if "3.20.4" == version: maybe( http_archive, @@ -8615,9 +8400,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.20.4_toolchains//:cmake-3.20.4-linux-aarch64_toolchain", + "@cmake_3.20.4_toolchains//:cmake-3.20.4-linux-x86_64_toolchain", + "@cmake_3.20.4_toolchains//:cmake-3.20.4-macos-universal_toolchain", + "@cmake_3.20.4_toolchains//:cmake-3.20.4-windows-i386_toolchain", + "@cmake_3.20.4_toolchains//:cmake-3.20.4-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.20.4_toolchains", repos = { "cmake-3.20.4-linux-aarch64": [ @@ -8643,17 +8436,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.20.4_toolchains//:cmake-3.20.4-linux-aarch64_toolchain", - "@cmake_3.20.4_toolchains//:cmake-3.20.4-linux-x86_64_toolchain", - "@cmake_3.20.4_toolchains//:cmake-3.20.4-macos-universal_toolchain", - "@cmake_3.20.4_toolchains//:cmake-3.20.4-windows-i386_toolchain", - "@cmake_3.20.4_toolchains//:cmake-3.20.4-windows-x86_64_toolchain", - ) - - return - if "3.20.5" == version: maybe( http_archive, @@ -8725,9 +8507,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.20.5_toolchains//:cmake-3.20.5-linux-aarch64_toolchain", + "@cmake_3.20.5_toolchains//:cmake-3.20.5-linux-x86_64_toolchain", + "@cmake_3.20.5_toolchains//:cmake-3.20.5-macos-universal_toolchain", + "@cmake_3.20.5_toolchains//:cmake-3.20.5-windows-i386_toolchain", + "@cmake_3.20.5_toolchains//:cmake-3.20.5-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.20.5_toolchains", repos = { "cmake-3.20.5-linux-aarch64": [ @@ -8753,17 +8543,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.20.5_toolchains//:cmake-3.20.5-linux-aarch64_toolchain", - "@cmake_3.20.5_toolchains//:cmake-3.20.5-linux-x86_64_toolchain", - "@cmake_3.20.5_toolchains//:cmake-3.20.5-macos-universal_toolchain", - "@cmake_3.20.5_toolchains//:cmake-3.20.5-windows-i386_toolchain", - "@cmake_3.20.5_toolchains//:cmake-3.20.5-windows-x86_64_toolchain", - ) - - return - if "3.20.6" == version: maybe( http_archive, @@ -8835,9 +8614,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.20.6_toolchains//:cmake-3.20.6-linux-aarch64_toolchain", + "@cmake_3.20.6_toolchains//:cmake-3.20.6-linux-x86_64_toolchain", + "@cmake_3.20.6_toolchains//:cmake-3.20.6-macos-universal_toolchain", + "@cmake_3.20.6_toolchains//:cmake-3.20.6-windows-i386_toolchain", + "@cmake_3.20.6_toolchains//:cmake-3.20.6-windows-x86_64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.20.6_toolchains", repos = { "cmake-3.20.6-linux-aarch64": [ @@ -8863,17 +8650,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.20.6_toolchains//:cmake-3.20.6-linux-aarch64_toolchain", - "@cmake_3.20.6_toolchains//:cmake-3.20.6-linux-x86_64_toolchain", - "@cmake_3.20.6_toolchains//:cmake-3.20.6-macos-universal_toolchain", - "@cmake_3.20.6_toolchains//:cmake-3.20.6-windows-i386_toolchain", - "@cmake_3.20.6_toolchains//:cmake-3.20.6-windows-x86_64_toolchain", - ) - - return - if "3.19.0" == version: maybe( http_archive, @@ -8931,9 +8707,16 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.0_toolchains//:cmake-3.19.0-Darwin-x86_64_toolchain", + "@cmake_3.19.0_toolchains//:cmake-3.19.0-Linux-x86_64_toolchain", + "@cmake_3.19.0_toolchains//:cmake-3.19.0-win32-x86_toolchain", + "@cmake_3.19.0_toolchains//:cmake-3.19.0-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.0_toolchains", repos = { "cmake-3.19.0-Darwin-x86_64": [ @@ -8956,16 +8739,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.0_toolchains//:cmake-3.19.0-Darwin-x86_64_toolchain", - "@cmake_3.19.0_toolchains//:cmake-3.19.0-Linux-x86_64_toolchain", - "@cmake_3.19.0_toolchains//:cmake-3.19.0-win32-x86_toolchain", - "@cmake_3.19.0_toolchains//:cmake-3.19.0-win64-x64_toolchain", - ) - - return - if "3.19.1" == version: maybe( http_archive, @@ -9023,9 +8796,16 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.1_toolchains//:cmake-3.19.1-Darwin-x86_64_toolchain", + "@cmake_3.19.1_toolchains//:cmake-3.19.1-Linux-x86_64_toolchain", + "@cmake_3.19.1_toolchains//:cmake-3.19.1-win32-x86_toolchain", + "@cmake_3.19.1_toolchains//:cmake-3.19.1-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.1_toolchains", repos = { "cmake-3.19.1-Darwin-x86_64": [ @@ -9048,16 +8828,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.1_toolchains//:cmake-3.19.1-Darwin-x86_64_toolchain", - "@cmake_3.19.1_toolchains//:cmake-3.19.1-Linux-x86_64_toolchain", - "@cmake_3.19.1_toolchains//:cmake-3.19.1-win32-x86_toolchain", - "@cmake_3.19.1_toolchains//:cmake-3.19.1-win64-x64_toolchain", - ) - - return - if "3.19.2" == version: maybe( http_archive, @@ -9115,9 +8885,16 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.2_toolchains//:cmake-3.19.2-Linux-x86_64_toolchain", + "@cmake_3.19.2_toolchains//:cmake-3.19.2-macos-universal_toolchain", + "@cmake_3.19.2_toolchains//:cmake-3.19.2-win32-x86_toolchain", + "@cmake_3.19.2_toolchains//:cmake-3.19.2-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.2_toolchains", repos = { "cmake-3.19.2-Linux-x86_64": [ @@ -9139,16 +8916,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.2_toolchains//:cmake-3.19.2-Linux-x86_64_toolchain", - "@cmake_3.19.2_toolchains//:cmake-3.19.2-macos-universal_toolchain", - "@cmake_3.19.2_toolchains//:cmake-3.19.2-win32-x86_toolchain", - "@cmake_3.19.2_toolchains//:cmake-3.19.2-win64-x64_toolchain", - ) - - return - if "3.19.3" == version: maybe( http_archive, @@ -9220,9 +8987,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.3_toolchains//:cmake-3.19.3-Linux-aarch64_toolchain", + "@cmake_3.19.3_toolchains//:cmake-3.19.3-Linux-x86_64_toolchain", + "@cmake_3.19.3_toolchains//:cmake-3.19.3-macos-universal_toolchain", + "@cmake_3.19.3_toolchains//:cmake-3.19.3-win32-x86_toolchain", + "@cmake_3.19.3_toolchains//:cmake-3.19.3-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.3_toolchains", repos = { "cmake-3.19.3-Linux-aarch64": [ @@ -9248,17 +9023,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.3_toolchains//:cmake-3.19.3-Linux-aarch64_toolchain", - "@cmake_3.19.3_toolchains//:cmake-3.19.3-Linux-x86_64_toolchain", - "@cmake_3.19.3_toolchains//:cmake-3.19.3-macos-universal_toolchain", - "@cmake_3.19.3_toolchains//:cmake-3.19.3-win32-x86_toolchain", - "@cmake_3.19.3_toolchains//:cmake-3.19.3-win64-x64_toolchain", - ) - - return - if "3.19.4" == version: maybe( http_archive, @@ -9330,9 +9094,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.4_toolchains//:cmake-3.19.4-Linux-aarch64_toolchain", + "@cmake_3.19.4_toolchains//:cmake-3.19.4-Linux-x86_64_toolchain", + "@cmake_3.19.4_toolchains//:cmake-3.19.4-macos-universal_toolchain", + "@cmake_3.19.4_toolchains//:cmake-3.19.4-win32-x86_toolchain", + "@cmake_3.19.4_toolchains//:cmake-3.19.4-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.4_toolchains", repos = { "cmake-3.19.4-Linux-aarch64": [ @@ -9358,17 +9130,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.4_toolchains//:cmake-3.19.4-Linux-aarch64_toolchain", - "@cmake_3.19.4_toolchains//:cmake-3.19.4-Linux-x86_64_toolchain", - "@cmake_3.19.4_toolchains//:cmake-3.19.4-macos-universal_toolchain", - "@cmake_3.19.4_toolchains//:cmake-3.19.4-win32-x86_toolchain", - "@cmake_3.19.4_toolchains//:cmake-3.19.4-win64-x64_toolchain", - ) - - return - if "3.19.5" == version: maybe( http_archive, @@ -9440,9 +9201,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.5_toolchains//:cmake-3.19.5-Linux-aarch64_toolchain", + "@cmake_3.19.5_toolchains//:cmake-3.19.5-Linux-x86_64_toolchain", + "@cmake_3.19.5_toolchains//:cmake-3.19.5-macos-universal_toolchain", + "@cmake_3.19.5_toolchains//:cmake-3.19.5-win32-x86_toolchain", + "@cmake_3.19.5_toolchains//:cmake-3.19.5-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.5_toolchains", repos = { "cmake-3.19.5-Linux-aarch64": [ @@ -9468,17 +9237,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.5_toolchains//:cmake-3.19.5-Linux-aarch64_toolchain", - "@cmake_3.19.5_toolchains//:cmake-3.19.5-Linux-x86_64_toolchain", - "@cmake_3.19.5_toolchains//:cmake-3.19.5-macos-universal_toolchain", - "@cmake_3.19.5_toolchains//:cmake-3.19.5-win32-x86_toolchain", - "@cmake_3.19.5_toolchains//:cmake-3.19.5-win64-x64_toolchain", - ) - - return - if "3.19.6" == version: maybe( http_archive, @@ -9550,9 +9308,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.6_toolchains//:cmake-3.19.6-Linux-aarch64_toolchain", + "@cmake_3.19.6_toolchains//:cmake-3.19.6-Linux-x86_64_toolchain", + "@cmake_3.19.6_toolchains//:cmake-3.19.6-macos-universal_toolchain", + "@cmake_3.19.6_toolchains//:cmake-3.19.6-win32-x86_toolchain", + "@cmake_3.19.6_toolchains//:cmake-3.19.6-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.6_toolchains", repos = { "cmake-3.19.6-Linux-aarch64": [ @@ -9578,17 +9344,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.6_toolchains//:cmake-3.19.6-Linux-aarch64_toolchain", - "@cmake_3.19.6_toolchains//:cmake-3.19.6-Linux-x86_64_toolchain", - "@cmake_3.19.6_toolchains//:cmake-3.19.6-macos-universal_toolchain", - "@cmake_3.19.6_toolchains//:cmake-3.19.6-win32-x86_toolchain", - "@cmake_3.19.6_toolchains//:cmake-3.19.6-win64-x64_toolchain", - ) - - return - if "3.19.7" == version: maybe( http_archive, @@ -9660,9 +9415,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.7_toolchains//:cmake-3.19.7-Linux-aarch64_toolchain", + "@cmake_3.19.7_toolchains//:cmake-3.19.7-Linux-x86_64_toolchain", + "@cmake_3.19.7_toolchains//:cmake-3.19.7-macos-universal_toolchain", + "@cmake_3.19.7_toolchains//:cmake-3.19.7-win32-x86_toolchain", + "@cmake_3.19.7_toolchains//:cmake-3.19.7-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.7_toolchains", repos = { "cmake-3.19.7-Linux-aarch64": [ @@ -9688,17 +9451,6 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.7_toolchains//:cmake-3.19.7-Linux-aarch64_toolchain", - "@cmake_3.19.7_toolchains//:cmake-3.19.7-Linux-x86_64_toolchain", - "@cmake_3.19.7_toolchains//:cmake-3.19.7-macos-universal_toolchain", - "@cmake_3.19.7_toolchains//:cmake-3.19.7-win32-x86_toolchain", - "@cmake_3.19.7_toolchains//:cmake-3.19.7-win64-x64_toolchain", - ) - - return - if "3.19.8" == version: maybe( http_archive, @@ -9770,9 +9522,17 @@ def _cmake_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@cmake_3.19.8_toolchains//:cmake-3.19.8-Linux-aarch64_toolchain", + "@cmake_3.19.8_toolchains//:cmake-3.19.8-Linux-x86_64_toolchain", + "@cmake_3.19.8_toolchains//:cmake-3.19.8-macos-universal_toolchain", + "@cmake_3.19.8_toolchains//:cmake-3.19.8-win32-x86_toolchain", + "@cmake_3.19.8_toolchains//:cmake-3.19.8-win64-x64_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "cmake_3.19.8_toolchains", repos = { "cmake-3.19.8-Linux-aarch64": [ @@ -9798,20 +9558,19 @@ def _cmake_toolchains(version, register_toolchains): tool = "cmake", ) - if register_toolchains: - native.register_toolchains( - "@cmake_3.19.8_toolchains//:cmake-3.19.8-Linux-aarch64_toolchain", - "@cmake_3.19.8_toolchains//:cmake-3.19.8-Linux-x86_64_toolchain", - "@cmake_3.19.8_toolchains//:cmake-3.19.8-macos-universal_toolchain", - "@cmake_3.19.8_toolchains//:cmake-3.19.8-win32-x86_toolchain", - "@cmake_3.19.8_toolchains//:cmake-3.19.8-win64-x64_toolchain", - ) + fail("Unsupported version: " + str(version)) - return +# buildifier: disable=unnamed-macro +def ninja_toolchains(*, version, register_toolchains): + """Define repositories needed to register ninja toolchains for a given version. - fail("Unsupported version: " + str(version)) + Args: + version (string): The Ninja version to use. + register_toolchains (boolean): Whether to call native.register_toolchains or not -def _ninja_toolchains(version, register_toolchains): + Returns: + list: Toolchain definitions. + """ if "1.12.1" == version: maybe( http_archive, @@ -9883,9 +9642,17 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.12.1_toolchains//:ninja_1.12.1_linux_toolchain", + "@ninja_1.12.1_toolchains//:ninja_1.12.1_linux-aarch64_toolchain", + "@ninja_1.12.1_toolchains//:ninja_1.12.1_mac_toolchain", + "@ninja_1.12.1_toolchains//:ninja_1.12.1_mac_aarch64_toolchain", + "@ninja_1.12.1_toolchains//:ninja_1.12.1_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.12.1_toolchains", repos = { "ninja_1.12.1_linux": [ @@ -9912,17 +9679,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.12.1_toolchains//:ninja_1.12.1_linux_toolchain", - "@ninja_1.12.1_toolchains//:ninja_1.12.1_linux-aarch64_toolchain", - "@ninja_1.12.1_toolchains//:ninja_1.12.1_mac_toolchain", - "@ninja_1.12.1_toolchains//:ninja_1.12.1_mac_aarch64_toolchain", - "@ninja_1.12.1_toolchains//:ninja_1.12.1_win_toolchain", - ) - - return - if "1.12.0" == version: maybe( http_archive, @@ -9994,9 +9750,17 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.12.0_toolchains//:ninja_1.12.0_linux_toolchain", + "@ninja_1.12.0_toolchains//:ninja_1.12.0_linux-aarch64_toolchain", + "@ninja_1.12.0_toolchains//:ninja_1.12.0_mac_toolchain", + "@ninja_1.12.0_toolchains//:ninja_1.12.0_mac_aarch64_toolchain", + "@ninja_1.12.0_toolchains//:ninja_1.12.0_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.12.0_toolchains", repos = { "ninja_1.12.0_linux": [ @@ -10023,17 +9787,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.12.0_toolchains//:ninja_1.12.0_linux_toolchain", - "@ninja_1.12.0_toolchains//:ninja_1.12.0_linux-aarch64_toolchain", - "@ninja_1.12.0_toolchains//:ninja_1.12.0_mac_toolchain", - "@ninja_1.12.0_toolchains//:ninja_1.12.0_mac_aarch64_toolchain", - "@ninja_1.12.0_toolchains//:ninja_1.12.0_win_toolchain", - ) - - return - if "1.11.1" == version: maybe( http_archive, @@ -10091,9 +9844,16 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.11.1_toolchains//:ninja_1.11.1_linux_toolchain", + "@ninja_1.11.1_toolchains//:ninja_1.11.1_mac_toolchain", + "@ninja_1.11.1_toolchains//:ninja_1.11.1_mac_aarch64_toolchain", + "@ninja_1.11.1_toolchains//:ninja_1.11.1_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.11.1_toolchains", repos = { "ninja_1.11.1_linux": [ @@ -10116,16 +9876,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.11.1_toolchains//:ninja_1.11.1_linux_toolchain", - "@ninja_1.11.1_toolchains//:ninja_1.11.1_mac_toolchain", - "@ninja_1.11.1_toolchains//:ninja_1.11.1_mac_aarch64_toolchain", - "@ninja_1.11.1_toolchains//:ninja_1.11.1_win_toolchain", - ) - - return - if "1.11.0" == version: maybe( http_archive, @@ -10183,9 +9933,16 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.11.0_toolchains//:ninja_1.11.0_linux_toolchain", + "@ninja_1.11.0_toolchains//:ninja_1.11.0_mac_toolchain", + "@ninja_1.11.0_toolchains//:ninja_1.11.0_mac_aarch64_toolchain", + "@ninja_1.11.0_toolchains//:ninja_1.11.0_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.11.0_toolchains", repos = { "ninja_1.11.0_linux": [ @@ -10208,16 +9965,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.11.0_toolchains//:ninja_1.11.0_linux_toolchain", - "@ninja_1.11.0_toolchains//:ninja_1.11.0_mac_toolchain", - "@ninja_1.11.0_toolchains//:ninja_1.11.0_mac_aarch64_toolchain", - "@ninja_1.11.0_toolchains//:ninja_1.11.0_win_toolchain", - ) - - return - if "1.10.2" == version: maybe( http_archive, @@ -10275,9 +10022,16 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.10.2_toolchains//:ninja_1.10.2_linux_toolchain", + "@ninja_1.10.2_toolchains//:ninja_1.10.2_mac_toolchain", + "@ninja_1.10.2_toolchains//:ninja_1.10.2_mac_aarch64_toolchain", + "@ninja_1.10.2_toolchains//:ninja_1.10.2_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.10.2_toolchains", repos = { "ninja_1.10.2_linux": [ @@ -10300,16 +10054,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.10.2_toolchains//:ninja_1.10.2_linux_toolchain", - "@ninja_1.10.2_toolchains//:ninja_1.10.2_mac_toolchain", - "@ninja_1.10.2_toolchains//:ninja_1.10.2_mac_aarch64_toolchain", - "@ninja_1.10.2_toolchains//:ninja_1.10.2_win_toolchain", - ) - - return - if "1.10.1" == version: maybe( http_archive, @@ -10353,9 +10097,15 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.10.1_toolchains//:ninja_1.10.1_linux_toolchain", + "@ninja_1.10.1_toolchains//:ninja_1.10.1_mac_toolchain", + "@ninja_1.10.1_toolchains//:ninja_1.10.1_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.10.1_toolchains", repos = { "ninja_1.10.1_linux": [ @@ -10374,15 +10124,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.10.1_toolchains//:ninja_1.10.1_linux_toolchain", - "@ninja_1.10.1_toolchains//:ninja_1.10.1_mac_toolchain", - "@ninja_1.10.1_toolchains//:ninja_1.10.1_win_toolchain", - ) - - return - if "1.10.0" == version: maybe( http_archive, @@ -10426,9 +10167,15 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.10.0_toolchains//:ninja_1.10.0_linux_toolchain", + "@ninja_1.10.0_toolchains//:ninja_1.10.0_mac_toolchain", + "@ninja_1.10.0_toolchains//:ninja_1.10.0_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.10.0_toolchains", repos = { "ninja_1.10.0_linux": [ @@ -10447,15 +10194,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.10.0_toolchains//:ninja_1.10.0_linux_toolchain", - "@ninja_1.10.0_toolchains//:ninja_1.10.0_mac_toolchain", - "@ninja_1.10.0_toolchains//:ninja_1.10.0_win_toolchain", - ) - - return - if "1.9.0" == version: maybe( http_archive, @@ -10499,9 +10237,15 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.9.0_toolchains//:ninja_1.9.0_linux_toolchain", + "@ninja_1.9.0_toolchains//:ninja_1.9.0_mac_toolchain", + "@ninja_1.9.0_toolchains//:ninja_1.9.0_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.9.0_toolchains", repos = { "ninja_1.9.0_linux": [ @@ -10520,15 +10264,6 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.9.0_toolchains//:ninja_1.9.0_linux_toolchain", - "@ninja_1.9.0_toolchains//:ninja_1.9.0_mac_toolchain", - "@ninja_1.9.0_toolchains//:ninja_1.9.0_win_toolchain", - ) - - return - if "1.8.2" == version: maybe( http_archive, @@ -10572,9 +10307,15 @@ def _ninja_toolchains(version, register_toolchains): ), ) + if register_toolchains: + native.register_toolchains( + "@ninja_1.8.2_toolchains//:ninja_1.8.2_linux_toolchain", + "@ninja_1.8.2_toolchains//:ninja_1.8.2_mac_toolchain", + "@ninja_1.8.2_toolchains//:ninja_1.8.2_win_toolchain", + ) + # buildifier: leave-alone - maybe( - prebuilt_toolchains_repository, + return maybe_prebuilt_toolchains_repository( name = "ninja_1.8.2_toolchains", repos = { "ninja_1.8.2_linux": [ @@ -10593,13 +10334,4 @@ def _ninja_toolchains(version, register_toolchains): tool = "ninja", ) - if register_toolchains: - native.register_toolchains( - "@ninja_1.8.2_toolchains//:ninja_1.8.2_linux_toolchain", - "@ninja_1.8.2_toolchains//:ninja_1.8.2_mac_toolchain", - "@ninja_1.8.2_toolchains//:ninja_1.8.2_win_toolchain", - ) - - return - fail("Unsupported version: " + str(version)) diff --git a/toolchains/prebuilt_toolchains.py b/toolchains/prebuilt_toolchains.py index 6161b7ba9..ebb20e3f4 100755 --- a/toolchains/prebuilt_toolchains.py +++ b/toolchains/prebuilt_toolchains.py @@ -124,8 +124,7 @@ TOOLCHAIN_REPO_DEFINITION = """\ # buildifier: leave-alone -maybe( - prebuilt_toolchains_repository, +return maybe_prebuilt_toolchains_repository( name = "{name}", repos = {repos}, tool = "{tool}", @@ -148,7 +147,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("@rules_foreign_cc//toolchains:prebuilt_toolchains_repository.bzl", "prebuilt_toolchains_repository") +load("//toolchains:prebuilt_toolchains_repository.bzl", "maybe_prebuilt_toolchains_repository") _CMAKE_BUILD_FILE = \"\"\"\\ load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") @@ -212,13 +211,39 @@ def prebuilt_toolchains(cmake_version, ninja_version, register_toolchains): ninja_version (string): The target ninja-build version register_toolchains (boolean): Whether to call native.register_toolchains or not \"\"\" - _cmake_toolchains(cmake_version, register_toolchains) - _ninja_toolchains(ninja_version, register_toolchains) + cmake_toolchains( + version = cmake_version, + register_toolchains = register_toolchains + ) + ninja_toolchains( + version = ninja_version, + register_toolchains = register_toolchains, + ) + +# buildifier: disable=unnamed-macro +def cmake_toolchains(*, version, register_toolchains): + \"\"\"Define repositories needed to register cmake toolchains for a given version. -def _cmake_toolchains(version, register_toolchains): + Args: + version (string): The CMake version to use. + register_toolchains (boolean): Whether to call native.register_toolchains or not + + Returns: + list: Toolchain definitions. + \"\"\" {cmake_definitions} -def _ninja_toolchains(version, register_toolchains): +# buildifier: disable=unnamed-macro +def ninja_toolchains(*, version, register_toolchains): + \"\"\"Define repositories needed to register ninja toolchains for a given version. + + Args: + version (string): The Ninja version to use. + register_toolchains (boolean): Whether to call native.register_toolchains or not + + Returns: + list: Toolchain definitions. + \"\"\" {ninja_definitions} """ @@ -313,19 +338,6 @@ def get_cmake_definitions() -> str: for target, name in version_toolchains.items(): toolchains_repos.update({name: CMAKE_TARGETS[target]}) - archives.append( - indent( - TOOLCHAIN_REPO_DEFINITION.format( - name="cmake_{}_toolchains".format(version), - repos=indent( - json.dumps(toolchains_repos, indent=4), " " * 4 - ).lstrip(), - tool="cmake", - ), - " " * 8, - ) - ) - archives.append( indent( REGISTER_TOOLCHAINS.format( @@ -345,11 +357,17 @@ def get_cmake_definitions() -> str: ) ) - archives.extend( - [ - indent("return", " " * 8), - "", - ] + archives.append( + indent( + TOOLCHAIN_REPO_DEFINITION.format( + name="cmake_{}_toolchains".format(version), + repos=indent( + json.dumps(toolchains_repos, indent=4), " " * 4 + ).lstrip(), + tool="cmake", + ), + " " * 8, + ) ) archives.append(indent('fail("Unsupported version: " + str(version))', " " * 4)) @@ -440,19 +458,6 @@ def get_ninja_definitions() -> str: for target, name in version_toolchains.items(): toolchains_repos.update({name: NINJA_TARGETS[target]}) - archives.append( - indent( - TOOLCHAIN_REPO_DEFINITION.format( - name="ninja_{}_toolchains".format(version), - repos=indent( - json.dumps(toolchains_repos, indent=4), " " * 4 - ).lstrip(), - tool="ninja", - ), - " " * 8, - ) - ) - archives.append( indent( REGISTER_TOOLCHAINS.format( @@ -472,11 +477,17 @@ def get_ninja_definitions() -> str: ) ) - archives.extend( - [ - indent("return", " " * 8), - "", - ] + archives.append( + indent( + TOOLCHAIN_REPO_DEFINITION.format( + name="ninja_{}_toolchains".format(version), + repos=indent( + json.dumps(toolchains_repos, indent=4), " " * 4 + ).lstrip(), + tool="ninja", + ), + " " * 8, + ) ) archives.append(indent('fail("Unsupported version: " + str(version))', " " * 4)) diff --git a/toolchains/prebuilt_toolchains_repository.bzl b/toolchains/prebuilt_toolchains_repository.bzl index 2e7ec747a..c418a8a56 100644 --- a/toolchains/prebuilt_toolchains_repository.bzl +++ b/toolchains/prebuilt_toolchains_repository.bzl @@ -1,5 +1,7 @@ """A module defining a repository rule for housing toolchain definitions""" +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + _BUILD_FILE = """\ load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") @@ -70,3 +72,30 @@ prebuilt_toolchains_repository = repository_rule( ), }, ) + +def maybe_prebuilt_toolchains_repository(name, repos, tool): + """A wrapper for `prebuilt_toolchains_repository` used to support bzlmod. + + Args: + name (str): The name of the repository + repos (list): See `prebuilt_toolchains_repository` + tool (string): See `prebuilt_toolchains_repository` + + Returns: + list: A list of fully rendered toolchains. + """ + maybe( + prebuilt_toolchains_repository, + name = name, + repos = repos, + tool = tool, + ) + + return [ + _TOOLCHAIN.format( + repo = repo, + tool = tool, + exec_compatible_with = compat, + ) + for repo, compat in repos.items() + ] diff --git a/toolchains/preinstalled_toolchains.bzl b/toolchains/preinstalled_toolchains.bzl new file mode 100644 index 000000000..eafe6a866 --- /dev/null +++ b/toolchains/preinstalled_toolchains.bzl @@ -0,0 +1,61 @@ +"""Preinstalled toolchain definitions""" + +_TOOLCHAIN_TEMPLATE = """\ +native_tool_toolchain( + name = "preinstalled_{tool}", + env = select({{ + "@platforms//os:windows": {{"{env}": "{tool}.exe"}}, + "//conditions:default": {{"{env}": "{tool}"}}, + }}), + path = select({{ + "@platforms//os:windows": "{tool}.exe", + "//conditions:default": "{tool}", + }}), +) + +toolchain( + name = "preinstalled_{tool}_toolchain", + toolchain = ":preinstalled_{tool}", + toolchain_type = "@rules_foreign_cc//toolchains:{tool}_toolchain", +) +""" + +# Nmake is an odd toolchain for windows that for now +# we handle explicitly +_NMAKE = """\ +native_tool_toolchain( + name = "preinstalled_nmake", + path = "nmake.exe", +) +""" + +# buildifier: disable=unnamed-macro +def preinstalled_toolchains(register_toolchains = True): + """Register toolchains for various build tools expected to be installed on the exec host. + + Args: + register_toolchains (bool): Whether or not to register toolchains. + + Returns: + list: A list of toolchain definitions. + """ + if register_toolchains: + native.register_toolchains( + "@rules_foreign_cc//toolchains:preinstalled_cmake_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_make_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_ninja_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_meson_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_automake_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_m4_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain", + ) + + toolchains = [ + _TOOLCHAIN_TEMPLATE.format(tool = tool, env = tool.upper()) + for tool in ["m4", "autoconf", "automake"] + ] + + toolchains.append(_NMAKE) + + return toolchains diff --git a/toolchains/private/BUILD.bazel b/toolchains/private/BUILD.bazel index 4ccdeefb6..e69de29bb 100644 --- a/toolchains/private/BUILD.bazel +++ b/toolchains/private/BUILD.bazel @@ -1,175 +0,0 @@ -load("//foreign_cc/built_tools:cmake_build.bzl", "cmake_tool") -load("//foreign_cc/built_tools:make_build.bzl", "make_tool") -load("//foreign_cc/built_tools:meson_build.bzl", "meson_tool") -load("//foreign_cc/built_tools:ninja_build.bzl", "ninja_tool") -load("//foreign_cc/built_tools:pkgconfig_build.bzl", "pkgconfig_tool") -load("//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") - -package(default_visibility = ["//visibility:public"]) - -native_tool_toolchain( - name = "preinstalled_make", - path = select({ - "@platforms//os:windows": "make.exe", - "//conditions:default": "make", - }), -) - -native_tool_toolchain( - name = "preinstalled_nmake", - path = "nmake.exe", -) - -make_tool( - name = "make_tool", - srcs = "@gnumake_src//:all_srcs", - tags = ["manual"], -) - -native_tool_toolchain( - name = "built_make", - env = select({ - "@platforms//os:windows": {"MAKE": "$(execpath :make_tool)/bin/make.exe"}, - "//conditions:default": {"MAKE": "$(execpath :make_tool)/bin/make"}, - }), - path = select({ - "@platforms//os:windows": "$(execpath :make_tool)/bin/make.exe", - "//conditions:default": "$(execpath :make_tool)/bin/make", - }), - target = ":make_tool", -) - -native_tool_toolchain( - name = "preinstalled_cmake", - env = select({ - "@platforms//os:windows": {"CMAKE": "cmake.exe"}, - "//conditions:default": {"CMAKE": "cmake"}, - }), - path = select({ - "@platforms//os:windows": "cmake.exe", - "//conditions:default": "cmake", - }), -) - -cmake_tool( - name = "cmake_tool", - srcs = "@cmake_src//:all_srcs", - tags = ["manual"], -) - -native_tool_toolchain( - name = "built_cmake", - env = select({ - "@platforms//os:windows": {"CMAKE": "$(execpath :cmake_tool)/bin/cmake.exe"}, - "//conditions:default": {"CMAKE": "$(execpath :cmake_tool)/bin/cmake"}, - }), - path = select({ - "@platforms//os:windows": "$(execpath :cmake_tool)/bin/cmake.exe", - "//conditions:default": "$(execpath :cmake_tool)/bin/cmake", - }), - target = ":cmake_tool", -) - -native_tool_toolchain( - name = "preinstalled_ninja", - env = select({ - "@platforms//os:windows": {"NINJA": "ninja.exe"}, - "//conditions:default": {"NINJA": "ninja"}, - }), - path = select({ - "@platforms//os:windows": "ninja.exe", - "//conditions:default": "ninja", - }), -) - -ninja_tool( - name = "ninja_tool", - srcs = "@ninja_build_src//:all_srcs", - tags = ["manual"], -) - -native_tool_toolchain( - name = "built_ninja", - env = select({ - "@platforms//os:windows": {"NINJA": "$(execpath :ninja_tool)/bin/ninja.exe"}, - "//conditions:default": {"NINJA": "$(execpath :ninja_tool)/bin/ninja"}, - }), - path = select({ - "@platforms//os:windows": "$(execpath :ninja_tool)/bin/ninja.exe", - "//conditions:default": "$(execpath :ninja_tool)/bin/ninja", - }), - target = ":ninja_tool", -) - -native_tool_toolchain( - name = "preinstalled_meson", - path = select({ - "@platforms//os:windows": "meson.exe", - "//conditions:default": "meson", - }), -) - -meson_tool( - name = "meson_tool", - data = ["@meson_src//:runtime"], - main = "@meson_src//:meson.py", - tags = ["manual"], -) - -native_tool_toolchain( - name = "built_meson", - env = {"MESON": "$(execpath :meson_tool)"}, - path = "$(execpath :meson_tool)", - target = ":meson_tool", -) - -native_tool_toolchain( - name = "preinstalled_autoconf", - path = select({ - "@platforms//os:windows": "autoconf.exe", - "//conditions:default": "autoconf", - }), -) - -native_tool_toolchain( - name = "preinstalled_automake", - path = select({ - "@platforms//os:windows": "automake.exe", - "//conditions:default": "automake", - }), -) - -native_tool_toolchain( - name = "preinstalled_m4", - path = select({ - "@platforms//os:windows": "m4.exe", - "//conditions:default": "m4", - }), -) - -native_tool_toolchain( - name = "preinstalled_pkgconfig", - path = select({ - "@platforms//os:windows": "pkg-config.exe", - "//conditions:default": "pkg-config", - }), -) - -pkgconfig_tool( - name = "pkgconfig_tool", - srcs = "@pkgconfig_src//:all_srcs", - tags = ["manual"], -) - -native_tool_toolchain( - name = "built_pkgconfig", - env = select({ - "@platforms//os:windows": {"PKG_CONFIG": "$(execpath :pkgconfig_tool)"}, - "//conditions:default": {"PKG_CONFIG": "$(execpath :pkgconfig_tool)/bin/pkg-config"}, - }), - path = select({ - "@platforms//os:windows": "$(execpath :pkgconfig_tool)", - "//conditions:default": "$(execpath :pkgconfig_tool)/bin/pkg-config", - }), - target = ":pkgconfig_tool", -) diff --git a/toolchains/private/BUILD.legacy.bazel b/toolchains/private/BUILD.legacy.bazel new file mode 100644 index 000000000..2db3149aa --- /dev/null +++ b/toolchains/private/BUILD.legacy.bazel @@ -0,0 +1,185 @@ +load("@rules_foreign_cc//foreign_cc/built_tools:cmake_build.bzl", "cmake_tool") +load("@rules_foreign_cc//foreign_cc/built_tools:make_build.bzl", "make_tool") +load("@rules_foreign_cc//foreign_cc/built_tools:meson_build.bzl", "meson_tool") +load("@rules_foreign_cc//foreign_cc/built_tools:ninja_build.bzl", "ninja_tool") +load("@rules_foreign_cc//foreign_cc/built_tools:pkgconfig_build.bzl", "pkgconfig_tool") +load("@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl", "native_tool_toolchain") + +package(default_visibility = ["//visibility:public"]) + +native_tool_toolchain( + name = "preinstalled_make", + path = select({ + "@platforms//os:windows": "make.exe", + "//conditions:default": "make", + }), +) + +native_tool_toolchain( + name = "preinstalled_nmake", + path = "nmake.exe", +) + +make_tool( + name = "make_tool", + srcs = "@gnumake_src//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_make", + env = select({ + "@platforms//os:windows": {"MAKE": "$(execpath :make_tool)/bin/make.exe"}, + "//conditions:default": {"MAKE": "$(execpath :make_tool)/bin/make"}, + }), + path = select({ + "@platforms//os:windows": "$(execpath :make_tool)/bin/make.exe", + "//conditions:default": "$(execpath :make_tool)/bin/make", + }), + target = ":make_tool", +) + +native_tool_toolchain( + name = "preinstalled_cmake", + env = select({ + "@platforms//os:windows": {"CMAKE": "cmake.exe"}, + "//conditions:default": {"CMAKE": "cmake"}, + }), + path = select({ + "@platforms//os:windows": "cmake.exe", + "//conditions:default": "cmake", + }), +) + +cmake_tool( + name = "cmake_tool", + srcs = "@cmake_src//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_cmake", + env = select({ + "@platforms//os:windows": {"CMAKE": "$(execpath :cmake_tool)/bin/cmake.exe"}, + "//conditions:default": {"CMAKE": "$(execpath :cmake_tool)/bin/cmake"}, + }), + path = select({ + "@platforms//os:windows": "$(execpath :cmake_tool)/bin/cmake.exe", + "//conditions:default": "$(execpath :cmake_tool)/bin/cmake", + }), + target = ":cmake_tool", +) + +native_tool_toolchain( + name = "preinstalled_ninja", + env = select({ + "@platforms//os:windows": {"NINJA": "ninja.exe"}, + "//conditions:default": {"NINJA": "ninja"}, + }), + path = select({ + "@platforms//os:windows": "ninja.exe", + "//conditions:default": "ninja", + }), +) + +ninja_tool( + name = "ninja_tool", + srcs = "@ninja_build_src//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_ninja", + env = select({ + "@platforms//os:windows": {"NINJA": "$(execpath :ninja_tool)/bin/ninja.exe"}, + "//conditions:default": {"NINJA": "$(execpath :ninja_tool)/bin/ninja"}, + }), + path = select({ + "@platforms//os:windows": "$(execpath :ninja_tool)/bin/ninja.exe", + "//conditions:default": "$(execpath :ninja_tool)/bin/ninja", + }), + target = ":ninja_tool", +) + +native_tool_toolchain( + name = "preinstalled_meson", + path = select({ + "@platforms//os:windows": "meson.exe", + "//conditions:default": "meson", + }), +) + +alias( + name = "meson_runtime", + actual = "@meson_src//:runtime", +) + +alias( + name = "meson.py", + actual = "@meson_src//:meson.py", +) + +meson_tool( + name = "meson_tool", + data = [":meson_runtime"], + main = ":meson.py", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_meson", + env = {"MESON": "$(execpath :meson_tool)"}, + path = "$(execpath :meson_tool)", + target = ":meson_tool", +) + +native_tool_toolchain( + name = "preinstalled_autoconf", + path = select({ + "@platforms//os:windows": "autoconf.exe", + "//conditions:default": "autoconf", + }), +) + +native_tool_toolchain( + name = "preinstalled_automake", + path = select({ + "@platforms//os:windows": "automake.exe", + "//conditions:default": "automake", + }), +) + +native_tool_toolchain( + name = "preinstalled_m4", + path = select({ + "@platforms//os:windows": "m4.exe", + "//conditions:default": "m4", + }), +) + +native_tool_toolchain( + name = "preinstalled_pkgconfig", + path = select({ + "@platforms//os:windows": "pkg-config.exe", + "//conditions:default": "pkg-config", + }), +) + +pkgconfig_tool( + name = "pkgconfig_tool", + srcs = "@pkgconfig_src//:all_srcs", + tags = ["manual"], +) + +native_tool_toolchain( + name = "built_pkgconfig", + env = select({ + "@platforms//os:windows": {"PKG_CONFIG": "$(execpath :pkgconfig_tool)"}, + "//conditions:default": {"PKG_CONFIG": "$(execpath :pkgconfig_tool)/bin/pkg-config"}, + }), + path = select({ + "@platforms//os:windows": "$(execpath :pkgconfig_tool)", + "//conditions:default": "$(execpath :pkgconfig_tool)/bin/pkg-config", + }), + target = ":pkgconfig_tool", +) diff --git a/toolchains/toolchains.bzl b/toolchains/toolchains.bzl index a4491b682..f70388291 100644 --- a/toolchains/toolchains.bzl +++ b/toolchains/toolchains.bzl @@ -2,6 +2,7 @@ load(":built_toolchains.bzl", _built_toolchains = "built_toolchains") load(":prebuilt_toolchains.bzl", _prebuilt_toolchains = "prebuilt_toolchains") +load(":preinstalled_toolchains.bzl", _preinstalled_toolchains = "preinstalled_toolchains") # Re-expose the built toolchains macro built_toolchains = _built_toolchains @@ -9,19 +10,8 @@ built_toolchains = _built_toolchains # Re-expose the prebuilt toolchains macro prebuilt_toolchains = _prebuilt_toolchains -# buildifier: disable=unnamed-macro -def preinstalled_toolchains(): - """Register toolchains for various build tools expected to be installed on the exec host""" - native.register_toolchains( - "@rules_foreign_cc//toolchains:preinstalled_cmake_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_make_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_ninja_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_meson_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_automake_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_m4_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain", - ) +# Re-expose the preinstalled toolchains macro +preinstalled_toolchains = _preinstalled_toolchains def _current_toolchain_impl(ctx): toolchain = ctx.toolchains[ctx.attr._toolchain] diff --git a/toolchains/workspace_legacy.bzl b/toolchains/workspace_legacy.bzl new file mode 100644 index 000000000..2c7503157 --- /dev/null +++ b/toolchains/workspace_legacy.bzl @@ -0,0 +1,21 @@ +"""Legacy utilities for WORKSPACE compatibility""" + +_WORKSPACE_FILE = """\ +workspace(name = "{}") +""" + +def _foreign_cc_toolchain_legacy_repository_impl(repository_ctx): + repository_ctx.file("BUILD.bazel", repository_ctx.read(repository_ctx.path(repository_ctx.attr._build_file))) + repository_ctx.file("WORKSPACE.bazel", _WORKSPACE_FILE.format( + repository_ctx.name, + )) + +foreign_cc_toolchain_legacy_repository = repository_rule( + doc = "A rule for aliasing rules_foreign_cc toolchains.", + implementation = _foreign_cc_toolchain_legacy_repository_impl, + attrs = { + "_build_file": attr.label( + default = Label("//toolchains/private:BUILD.legacy.bazel"), + ), + }, +)