From 845e6db75c307a317607e622b359cecaf402244c Mon Sep 17 00:00:00 2001 From: James Sharpe Date: Thu, 11 Apr 2024 21:35:27 +0000 Subject: [PATCH] chore(deps): Add ninja 1.12.0 and latest versions of cmake --- MODULE.bazel | 4 +- foreign_cc/extensions.bzl | 2 +- foreign_cc/repositories.bzl | 2 +- toolchains/built_toolchains.bzl | 13 + toolchains/cmake_versions.bzl | 35 ++ toolchains/prebuilt_toolchains.bzl | 661 +++++++++++++++++++++++++++++ toolchains/prebuilt_toolchains.py | 16 + 7 files changed, 729 insertions(+), 4 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index b098b9243..2b9a0b172 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -30,7 +30,7 @@ use_repo( "glib_src", "gnumake_src", "meson_src", - "ninja_1.11.1_toolchains", + "ninja_1.12.0_toolchains", "ninja_build_src", "pkgconfig_src", "rules_foreign_cc_framework_toolchains", @@ -39,7 +39,7 @@ use_repo( register_toolchains( "@rules_foreign_cc_framework_toolchains//:all", "@cmake_3.23.2_toolchains//:all", - "@ninja_1.11.1_toolchains//:all", + "@ninja_1.12.0_toolchains//:all", "@python_3_9//:all", "@rules_foreign_cc//toolchains:all", ) diff --git a/foreign_cc/extensions.bzl b/foreign_cc/extensions.bzl index 23fd14bfc..ca2392417 100644 --- a/foreign_cc/extensions.bzl +++ b/foreign_cc/extensions.bzl @@ -4,7 +4,7 @@ load("//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") load("//toolchains:prebuilt_toolchains.bzl", "prebuilt_toolchains") _DEFAULT_CMAKE_VERSION = "3.23.2" -_DEFAULT_NINJA_VERSION = "1.11.1" +_DEFAULT_NINJA_VERSION = "1.12.0" cmake_toolchain_version = tag_class(attrs = { "version": attr.string(doc = "The cmake version", default = _DEFAULT_CMAKE_VERSION), diff --git a/foreign_cc/repositories.bzl b/foreign_cc/repositories.bzl index 3f6aa0437..3350993a5 100644 --- a/foreign_cc/repositories.bzl +++ b/foreign_cc/repositories.bzl @@ -11,7 +11,7 @@ def rules_foreign_cc_dependencies( register_default_tools = True, cmake_version = "3.23.2", make_version = "4.4.1", - ninja_version = "1.11.1", + ninja_version = "1.12.0", meson_version = "1.1.1", pkgconfig_version = "0.29.2", register_preinstalled_tools = True, diff --git a/toolchains/built_toolchains.bzl b/toolchains/built_toolchains.bzl index 1a33be272..7f1ecbba2 100644 --- a/toolchains/built_toolchains.bzl +++ b/toolchains/built_toolchains.bzl @@ -135,6 +135,19 @@ def _ninja_toolchain(version, register_toolchains): native.register_toolchains( "@rules_foreign_cc//toolchains:built_ninja_toolchain", ) + if version == "1.12.0": + maybe( + http_archive, + name = "ninja_build_src", + build_file_content = _ALL_CONTENT, + integrity = "sha256-iyyGzUg9x/y3l1xexzKRNdIQCZqJvH2wWQoHsLv+SaU=", + strip_prefix = "ninja-1.12.0", + urls = [ + "https://mirror.bazel.build/github.com/ninja-build/ninja/archive/v1.12.0.tar.gz", + "https://github.com/ninja-build/ninja/archive/v1.12.0.tar.gz", + ], + ) + return if version == "1.11.1": maybe( http_archive, diff --git a/toolchains/cmake_versions.bzl b/toolchains/cmake_versions.bzl index d7edf0922..c1dce37bb 100644 --- a/toolchains/cmake_versions.bzl +++ b/toolchains/cmake_versions.bzl @@ -510,6 +510,41 @@ CMAKE_SRCS = { "cmake-3.28.1", "15e94f83e647f7d620a140a7a5da76349fc47a1bfed66d0f5cdee8e7344079ad", ], + "3.28.2": [ + [ + "https://github.com/Kitware/CMake/releases/download/v3.28.2/cmake-3.28.2.tar.gz", + ], + "cmake-3.28.2", + "1466f872dc1c226f373cf8fba4230ed216a8f108bd54b477b5ccdfd9ea2d124a", + ], + "3.28.3": [ + [ + "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3.tar.gz", + ], + "cmake-3.28.3", + "72b7570e5c8593de6ac4ab433b73eab18c5fb328880460c86ce32608141ad5c1", + ], + "3.28.4": [ + [ + "https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4.tar.gz", + ], + "cmake-3.28.4", + "eb9c787e078848dc493f4f83f8a4bbec857cd1f38ab6425ce8d2776a9f6aa6fb", + ], + "3.29.0": [ + [ + "https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0.tar.gz", + ], + "cmake-3.29.0", + "a0669630aae7baa4a8228048bf30b622f9e9fd8ee8cedb941754e9e38686c778", + ], + "3.29.1": [ + [ + "https://github.com/Kitware/CMake/releases/download/v3.29.1/cmake-3.29.1.tar.gz", + ], + "cmake-3.29.1", + "7fb02e8f57b62b39aa6b4cf71e820148ba1a23724888494735021e32ab0eefcc", + ], "3.3.2": [ [ "https://github.com/Kitware/CMake/releases/download/v3.3.2/cmake-3.3.2.tar.gz", diff --git a/toolchains/prebuilt_toolchains.bzl b/toolchains/prebuilt_toolchains.bzl index a882e1545..6b94adb2a 100644 --- a/toolchains/prebuilt_toolchains.bzl +++ b/toolchains/prebuilt_toolchains.bzl @@ -73,6 +73,556 @@ def prebuilt_toolchains(cmake_version, ninja_version, register_toolchains): _ninja_toolchains(ninja_version, register_toolchains) def _cmake_toolchains(version, register_toolchains): + if "3.29.1" == version: + maybe( + http_archive, + name = "cmake-3.29.1-linux-aarch64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.1/cmake-3.29.1-linux-aarch64.tar.gz", + ], + sha256 = "14130b1eaae0dfcc1c148926d6cc2792556c1b5cca71abef443eab4dea54115f", + strip_prefix = "cmake-3.29.1-linux-aarch64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.1-linux-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.1/cmake-3.29.1-linux-x86_64.tar.gz", + ], + sha256 = "751bbe7ccabb78179335a75b88999b1c52afcd4d8a4cd03217d367d8bb2c5100", + strip_prefix = "cmake-3.29.1-linux-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.1-macos-universal", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.1/cmake-3.29.1-macos-universal.tar.gz", + ], + sha256 = "203ac4392fff68e3456b2f6b0251a2727766d16cf4e49d2725869e88051372fc", + strip_prefix = "cmake-3.29.1-macos-universal/CMake.app/Contents", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.1-windows-i386", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.1/cmake-3.29.1-windows-i386.zip", + ], + sha256 = "4c832bbd9bb7a6756b13743956b87a9ae0ba869cb2e1a139bb540e456fd919ee", + strip_prefix = "cmake-3.29.1-windows-i386", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.1-windows-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.1/cmake-3.29.1-windows-x86_64.zip", + ], + sha256 = "c8cf6ed50551d00ad8cd1f3b232810cd0a8b43b4a1d4f1393f0a575d423884dc", + strip_prefix = "cmake-3.29.1-windows-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + # buildifier: leave-alone + maybe( + prebuilt_toolchains_repository, + name = "cmake_3.29.1_toolchains", + repos = { + "cmake-3.29.1-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], + "cmake-3.29.1-linux-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + "cmake-3.29.1-macos-universal": [ + "@platforms//os:macos", + ], + "cmake-3.29.1-windows-i386": [ + "@platforms//cpu:x86_32", + "@platforms//os:windows", + ], + "cmake-3.29.1-windows-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + }, + 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.0" == version: + maybe( + http_archive, + name = "cmake-3.29.0-linux-aarch64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0-linux-aarch64.tar.gz", + ], + sha256 = "2cb768a14b28a4478bb931d917dbc419305b82433bdecc046df98e7c336225fa", + strip_prefix = "cmake-3.29.0-linux-aarch64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.0-linux-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0-linux-x86_64.tar.gz", + ], + sha256 = "f06258f52c5649752dfb10c4c2e1d8167c760c8826f078c6f5c332fa9d976bf8", + strip_prefix = "cmake-3.29.0-linux-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.0-macos-universal", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0-macos-universal.tar.gz", + ], + sha256 = "4adc9d97242e18b47a4c4fa4c7d09200e4b9550cba6116e4522a7525639f436a", + strip_prefix = "cmake-3.29.0-macos-universal/CMake.app/Contents", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.0-windows-i386", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0-windows-i386.zip", + ], + sha256 = "db687afa0b1d0e0c5a2641b31fab050b5e2c044189b6f022ea5a09adba6cf4f5", + strip_prefix = "cmake-3.29.0-windows-i386", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.29.0-windows-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0-windows-x86_64.zip", + ], + sha256 = "9ab28eba1ab7911a0e57ab274f5990a283fffa1d22eb711792d5562e5869f9ef", + strip_prefix = "cmake-3.29.0-windows-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + # buildifier: leave-alone + maybe( + prebuilt_toolchains_repository, + name = "cmake_3.29.0_toolchains", + repos = { + "cmake-3.29.0-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], + "cmake-3.29.0-linux-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + "cmake-3.29.0-macos-universal": [ + "@platforms//os:macos", + ], + "cmake-3.29.0-windows-i386": [ + "@platforms//cpu:x86_32", + "@platforms//os:windows", + ], + "cmake-3.29.0-windows-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + }, + 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.28.4" == version: + maybe( + http_archive, + name = "cmake-3.28.4-linux-aarch64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-linux-aarch64.tar.gz", + ], + sha256 = "74edb3d6f7d179dc5021bd9f3c4ac59c72bb2c4e6bea9abd8297d8ce0a385228", + strip_prefix = "cmake-3.28.4-linux-aarch64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.4-linux-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-linux-x86_64.tar.gz", + ], + sha256 = "1f74731c80cbba3263c64fca6f6af0fb8dd1d06365425e404f79564773080d11", + strip_prefix = "cmake-3.28.4-linux-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.4-macos-universal", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-macos-universal.tar.gz", + ], + sha256 = "ad47a7e8e3da180b7cff69efe337f4285305052a77f28960cd40ca66f2f5c894", + strip_prefix = "cmake-3.28.4-macos-universal/CMake.app/Contents", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.4-windows-i386", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-windows-i386.zip", + ], + sha256 = "8008dfe27cd59c7550365b56f8d1f708ec2063fd807226ba0822531faee91efc", + strip_prefix = "cmake-3.28.4-windows-i386", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.4-windows-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-windows-x86_64.zip", + ], + sha256 = "7690887b57d3d4138dc78e88200236eec137314047334a30e4fecda614c5a079", + strip_prefix = "cmake-3.28.4-windows-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + # buildifier: leave-alone + maybe( + prebuilt_toolchains_repository, + name = "cmake_3.28.4_toolchains", + repos = { + "cmake-3.28.4-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], + "cmake-3.28.4-linux-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + "cmake-3.28.4-macos-universal": [ + "@platforms//os:macos", + ], + "cmake-3.28.4-windows-i386": [ + "@platforms//cpu:x86_32", + "@platforms//os:windows", + ], + "cmake-3.28.4-windows-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + }, + 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.3" == version: + maybe( + http_archive, + name = "cmake-3.28.3-linux-aarch64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-aarch64.tar.gz", + ], + sha256 = "bbf023139f944cefe731d944f2864d8ea3ea0c4f9310b46ac72b3cb4e314b023", + strip_prefix = "cmake-3.28.3-linux-aarch64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.3-linux-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz", + ], + sha256 = "804d231460ab3c8b556a42d2660af4ac7a0e21c98a7f8ee3318a74b4a9a187a6", + strip_prefix = "cmake-3.28.3-linux-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.3-macos-universal", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-macos-universal.tar.gz", + ], + sha256 = "d9e2c22fec920a4d1f6b0d0683c035d799475c179c91e41e1a7fbfab610a0305", + strip_prefix = "cmake-3.28.3-macos-universal/CMake.app/Contents", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.3-windows-i386", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-windows-i386.zip", + ], + sha256 = "411812b6b29ac793faf69bdbd36c612f72659363c5491b9f0a478915db3fc58c", + strip_prefix = "cmake-3.28.3-windows-i386", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.3-windows-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-windows-x86_64.zip", + ], + sha256 = "cac7916f7e1e73a25de857704c94fd5b72ba9fe2f055356b5602d2f960e50e5b", + strip_prefix = "cmake-3.28.3-windows-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + # buildifier: leave-alone + maybe( + prebuilt_toolchains_repository, + name = "cmake_3.28.3_toolchains", + repos = { + "cmake-3.28.3-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], + "cmake-3.28.3-linux-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + "cmake-3.28.3-macos-universal": [ + "@platforms//os:macos", + ], + "cmake-3.28.3-windows-i386": [ + "@platforms//cpu:x86_32", + "@platforms//os:windows", + ], + "cmake-3.28.3-windows-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + }, + 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.2" == version: + maybe( + http_archive, + name = "cmake-3.28.2-linux-aarch64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.2/cmake-3.28.2-linux-aarch64.tar.gz", + ], + sha256 = "1140177a9e32f15f06dcb9cc7ad3946cfd0a7ba5eed5194d76064133fadfd96d", + strip_prefix = "cmake-3.28.2-linux-aarch64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.2-linux-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.2/cmake-3.28.2-linux-x86_64.tar.gz", + ], + sha256 = "3c67150b288657d156c261757f715e646c08e855f907af8930f36a378cd25163", + strip_prefix = "cmake-3.28.2-linux-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.2-macos-universal", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.2/cmake-3.28.2-macos-universal.tar.gz", + ], + sha256 = "6213c7710e5e20e7d4a295321b8b0ec0036c63914f52e71df1d0db84932f8058", + strip_prefix = "cmake-3.28.2-macos-universal/CMake.app/Contents", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.2-windows-i386", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.2/cmake-3.28.2-windows-i386.zip", + ], + sha256 = "dabdd59fb8ecdf90f91a161bef502652f07a4b0ed741b2039f2e86eea97db27b", + strip_prefix = "cmake-3.28.2-windows-i386", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "cmake-3.28.2-windows-x86_64", + urls = [ + "https://github.com/Kitware/CMake/releases/download/v3.28.2/cmake-3.28.2-windows-x86_64.zip", + ], + sha256 = "f4c751bc3ee070a59977206d6e2896c97217bbf48ba60939603b38112c31f1bd", + strip_prefix = "cmake-3.28.2-windows-x86_64", + build_file_content = _CMAKE_BUILD_FILE.format( + bin = "cmake.exe", + env = "{\"CMAKE\": \"$(execpath :cmake_bin)\"}", + ), + ) + + # buildifier: leave-alone + maybe( + prebuilt_toolchains_repository, + name = "cmake_3.28.2_toolchains", + repos = { + "cmake-3.28.2-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], + "cmake-3.28.2-linux-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + "cmake-3.28.2-macos-universal": [ + "@platforms//os:macos", + ], + "cmake-3.28.2-windows-i386": [ + "@platforms//cpu:x86_32", + "@platforms//os:windows", + ], + "cmake-3.28.2-windows-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + }, + 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.1" == version: maybe( http_archive, @@ -8272,6 +8822,117 @@ def _cmake_toolchains(version, register_toolchains): fail("Unsupported version: " + str(version)) def _ninja_toolchains(version, register_toolchains): + if "1.12.0" == version: + maybe( + http_archive, + name = "ninja_1.12.0_linux", + urls = [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.0/ninja-linux.zip", + ], + sha256 = "ddc96efa3c7c9d41de733d15e2eda07a8a212555cb43f35d727e080d2ca687ab", + strip_prefix = "", + build_file_content = _NINJA_BUILD_FILE.format( + bin = "ninja", + env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "ninja_1.12.0_linux-aarch64", + urls = [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.0/ninja-linux-aarch64.zip", + ], + sha256 = "375a49c79095334c88338ff15f90730e08a4d03997ef660f48f11ee7e450db7a", + strip_prefix = "", + build_file_content = _NINJA_BUILD_FILE.format( + bin = "ninja", + env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "ninja_1.12.0_mac", + urls = [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.0/ninja-mac.zip", + ], + sha256 = "19806019c9623a062c3d9fa0d5f45b633a3d150f88e73fbd6c0ff6ea5534df10", + strip_prefix = "", + build_file_content = _NINJA_BUILD_FILE.format( + bin = "ninja", + env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "ninja_1.12.0_mac_aarch64", + urls = [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.0/ninja-mac.zip", + ], + sha256 = "19806019c9623a062c3d9fa0d5f45b633a3d150f88e73fbd6c0ff6ea5534df10", + strip_prefix = "", + build_file_content = _NINJA_BUILD_FILE.format( + bin = "ninja", + env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}", + ), + ) + + maybe( + http_archive, + name = "ninja_1.12.0_win", + urls = [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.0/ninja-win.zip", + ], + sha256 = "51d99be9ceea8835edf536d52d47fa4c316aa332e57f71a08df5bd059da11417", + strip_prefix = "", + build_file_content = _NINJA_BUILD_FILE.format( + bin = "ninja.exe", + env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}", + ), + ) + + # buildifier: leave-alone + maybe( + prebuilt_toolchains_repository, + name = "ninja_1.12.0_toolchains", + repos = { + "ninja_1.12.0_linux": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + "ninja_1.12.0_linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], + "ninja_1.12.0_mac": [ + "@platforms//cpu:x86_64", + "@platforms//os:macos", + ], + "ninja_1.12.0_mac_aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:macos", + ], + "ninja_1.12.0_win": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + }, + 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, diff --git a/toolchains/prebuilt_toolchains.py b/toolchains/prebuilt_toolchains.py index 290e01af3..52d472210 100755 --- a/toolchains/prebuilt_toolchains.py +++ b/toolchains/prebuilt_toolchains.py @@ -10,6 +10,11 @@ CMAKE_URL_TEMPLATE = "https://github.com/Kitware/CMake/releases/download/v{full}/{file}" CMAKE_VERSIONS = [ + "3.29.1", + "3.29.0", + "3.28.4", + "3.28.3", + "3.28.2", "3.28.1", "3.28.0", "3.27.9", @@ -142,6 +147,10 @@ "@platforms//cpu:x86_64", "@platforms//os:linux", ], + "linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], "mac": [ "@platforms//cpu:x86_64", "@platforms//os:macos", @@ -157,6 +166,7 @@ } NINJA_VERSIONS = ( + "1.12.0", "1.11.1", "1.11.0", "1.10.2", @@ -422,11 +432,15 @@ def get_ninja_definitions() -> str: for version in NINJA_VERSIONS: + supports_linux_aarch64 = not version in ["1.8.2", "1.9.0", "1.10.0", "1.10.1", "1.10.2", "1.11.0", "1.11.1"] supports_mac_universal = not version in ["1.8.2", "1.9.0", "1.10.0", "1.10.1"] version_archives = [] version_toolchains = {} for target in NINJA_TARGETS.keys(): + if not supports_linux_aarch64 and target == "linux-aarch64": + continue + if not supports_mac_universal and target == "mac_aarch64": continue @@ -435,6 +449,8 @@ def get_ninja_definitions() -> str: target="mac" if target == "mac_aarch64" else target, ) + print(f"fetching {url}") + # Get sha256 (can be slow) remote = urllib.request.urlopen(url) total_read = 0