blob: 7d289569ca62ad04edee4ef38dec670de714cce6 [file] [log] [blame]
Googler3c84aa82023-04-11 09:40:31 -07001# Copyright 2023 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14"""Macros for defining dependencies we need to build Bazel.
15
16"""
17
Googlerc1d753e2024-10-04 13:59:07 -070018load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
Yun Peng849da312024-01-30 10:16:17 -080019load("//src/tools/bzlmod:utils.bzl", "get_canonical_repo_name")
Yun Pengc1f2aff2023-11-07 09:51:02 -080020
21##################################################################################
22#
23# The list of repositories required while bootstrapping Bazel offline
24#
25##################################################################################
26DIST_ARCHIVE_REPOS = [get_canonical_repo_name(repo) for repo in [
Fabian Meumertzheimb9a05782024-05-13 09:18:57 -070027 # keep sorted
Yun Pengc1f2aff2023-11-07 09:51:02 -080028 "abseil-cpp",
29 "apple_support",
30 "bazel_skylib",
31 "blake3",
32 "c-ares",
33 "com_github_grpc_grpc",
Xdng Yngc46b9ce2024-10-01 14:21:54 -070034 "googleapis",
35 "grpc-java",
Yun Pengc1f2aff2023-11-07 09:51:02 -080036 "io_bazel_skydoc",
37 "platforms",
Googler6f935542024-10-24 13:59:33 -070038 "protobuf",
Yun Pengc1f2aff2023-11-07 09:51:02 -080039 "rules_cc",
40 "rules_go",
Fabian Meumertzheimb9a05782024-05-13 09:18:57 -070041 "rules_graalvm",
Yun Pengc1f2aff2023-11-07 09:51:02 -080042 "rules_java",
43 "rules_jvm_external",
Yun Peng849da312024-01-30 10:16:17 -080044 "rules_kotlin",
Yun Pengc1f2aff2023-11-07 09:51:02 -080045 "rules_license",
46 "rules_pkg",
47 "rules_proto",
48 "rules_python",
Googlerb89ec432024-10-07 10:05:35 -070049 "rules_shell",
Yun Pengc1f2aff2023-11-07 09:51:02 -080050 "zlib",
51 "zstd-jni",
Xdng Yngc46b9ce2024-10-01 14:21:54 -070052]] + [(get_canonical_repo_name("com_github_grpc_grpc") + "+grpc_repo_deps_ext+" + suffix) for suffix in [
Yun Pengc1f2aff2023-11-07 09:51:02 -080053 # Extra grpc dependencies introduced via its module extension
Xdng Yngc46b9ce2024-10-01 14:21:54 -070054 "com_envoyproxy_protoc_gen_validate",
55 "com_github_cncf_xds",
56 "envoy_api",
57 "google_cloud_cpp",
58 "io_opencensus_cpp",
59]] + [
60 "bazel_features+",
61 "rules_apple+",
62 "rules_foreign_cc+",
63 "rules_fuzzing+",
64 "rules_swift+",
65]
Yun Pengc1f2aff2023-11-07 09:51:02 -080066
67##################################################################################
68#
69# Make sure all URLs below are mirrored to https://mirror.bazel.build
70#
71##################################################################################
Googler3c84aa82023-04-11 09:40:31 -070072
73def embedded_jdk_repositories():
74 """OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK."""
Yun Pengc1f2aff2023-11-07 09:51:02 -080075 http_file(
Googler3c84aa82023-04-11 09:40:31 -070076 name = "openjdk_linux_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070077 integrity = "sha256-MY0MLtPIdvt+oslSlFzc997PtSZMpRrs4VnmNaxT1UQ=",
Googler3c84aa82023-04-11 09:40:31 -070078 downloaded_file_path = "zulu-linux-vanilla.tar.gz",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070079 url = "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-linux_x64.tar.gz",
Googler3c84aa82023-04-11 09:40:31 -070080 )
Yun Pengc1f2aff2023-11-07 09:51:02 -080081 http_file(
Googler3c84aa82023-04-11 09:40:31 -070082 name = "openjdk_linux_aarch64_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070083 integrity = "sha256-2jwtfbM2cLz2ZTJEGut/M9zw0ifI2v5841zuZ/aCnEw=",
Googler3c84aa82023-04-11 09:40:31 -070084 downloaded_file_path = "zulu-linux-aarch64-vanilla.tar.gz",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070085 url = "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-linux_aarch64.tar.gz",
Googler3c84aa82023-04-11 09:40:31 -070086 )
Yun Pengc1f2aff2023-11-07 09:51:02 -080087 http_file(
Googler3c84aa82023-04-11 09:40:31 -070088 name = "openjdk_linux_s390x_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070089 integrity = "sha256-yQDI1k+rHlMnSXT6Skxzalo3VEhaXFb0lHKBSAdzZYo=",
Googler3c84aa82023-04-11 09:40:31 -070090 downloaded_file_path = "adoptopenjdk-s390x-vanilla.tar.gz",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070091 url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_s390x_linux_hotspot_21.0.4_7.tar.gz",
Googler3c84aa82023-04-11 09:40:31 -070092 )
Yun Pengc1f2aff2023-11-07 09:51:02 -080093 http_file(
94 name = "openjdk_linux_ppc64le_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070095 integrity = "sha256-wgjND7kFYGRKkPkoZn0vU7/kCMlXpeNiBlha2HRCd2E=",
Yun Pengc1f2aff2023-11-07 09:51:02 -080096 downloaded_file_path = "adoptopenjdk-ppc64le-vanilla.tar.gz",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -070097 url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.4_7.tar.gz",
Yun Pengc1f2aff2023-11-07 09:51:02 -080098 )
99 http_file(
Googler3c84aa82023-04-11 09:40:31 -0700100 name = "openjdk_macos_x86_64_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700101 integrity = "sha256-XOdaaiR8cCm3TEynz29g/SstaM4eiVb7RI0phDFrX+o=",
Googler3c84aa82023-04-11 09:40:31 -0700102 downloaded_file_path = "zulu-macos-vanilla.tar.gz",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700103 url = "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-macosx_x64.tar.gz",
Googler3c84aa82023-04-11 09:40:31 -0700104 )
Yun Pengc1f2aff2023-11-07 09:51:02 -0800105 http_file(
Googler3c84aa82023-04-11 09:40:31 -0700106 name = "openjdk_macos_aarch64_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700107 integrity = "sha256-vCdQ+BoWbMbpwwroqrpU8lOoyOydjPwEpVX+IHEse/8=",
Googler3c84aa82023-04-11 09:40:31 -0700108 downloaded_file_path = "zulu-macos-aarch64-vanilla.tar.gz",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700109 url = "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-macosx_aarch64.tar.gz",
Googler3c84aa82023-04-11 09:40:31 -0700110 )
Yun Pengc1f2aff2023-11-07 09:51:02 -0800111 http_file(
Googler3c84aa82023-04-11 09:40:31 -0700112 name = "openjdk_win_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700113 integrity = "sha256-13Ha0Q0/C0QMNobR89K2izIIAqyXshLYdnGvPy7viEg=",
Googler3c84aa82023-04-11 09:40:31 -0700114 downloaded_file_path = "zulu-win-vanilla.zip",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700115 url = "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-win_x64.zip",
Googler3c84aa82023-04-11 09:40:31 -0700116 )
Yun Pengc1f2aff2023-11-07 09:51:02 -0800117 http_file(
Googler3c84aa82023-04-11 09:40:31 -0700118 name = "openjdk_win_arm64_vanilla",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700119 integrity = "sha256-n4c+zPAwsdPch57B6w/14Rv3YALcgcXGRMNGK/bFFGs=",
Googler3c84aa82023-04-11 09:40:31 -0700120 downloaded_file_path = "zulu-win-arm64.zip",
Fabian Meumertzheim78b88712024-10-10 04:51:13 -0700121 url = "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-win_aarch64.zip",
Yun Pengc1f2aff2023-11-07 09:51:02 -0800122 )