Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 1 | # 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 | |
Googler | 13ecdf5 | 2024-01-02 12:15:30 -0800 | [diff] [blame] | 18 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") |
Yun Peng | 849da31 | 2024-01-30 10:16:17 -0800 | [diff] [blame] | 19 | load("//src/tools/bzlmod:utils.bzl", "get_canonical_repo_name") |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 20 | |
| 21 | ################################################################################## |
| 22 | # |
| 23 | # The list of repositories required while bootstrapping Bazel offline |
| 24 | # |
| 25 | ################################################################################## |
| 26 | DIST_ARCHIVE_REPOS = [get_canonical_repo_name(repo) for repo in [ |
Fabian Meumertzheim | b9a0578 | 2024-05-13 09:18:57 -0700 | [diff] [blame] | 27 | # keep sorted |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 28 | "abseil-cpp", |
| 29 | "apple_support", |
| 30 | "bazel_skylib", |
| 31 | "blake3", |
| 32 | "c-ares", |
| 33 | "com_github_grpc_grpc", |
| 34 | "com_google_protobuf", |
| 35 | "io_bazel_skydoc", |
| 36 | "platforms", |
| 37 | "rules_cc", |
| 38 | "rules_go", |
Fabian Meumertzheim | b9a0578 | 2024-05-13 09:18:57 -0700 | [diff] [blame] | 39 | "rules_graalvm", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 40 | "rules_java", |
| 41 | "rules_jvm_external", |
Yun Peng | 849da31 | 2024-01-30 10:16:17 -0800 | [diff] [blame] | 42 | "rules_kotlin", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 43 | "rules_license", |
| 44 | "rules_pkg", |
| 45 | "rules_proto", |
| 46 | "rules_python", |
Googler | 8ef7b70 | 2024-04-25 05:46:55 -0700 | [diff] [blame] | 47 | "sqlite3", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 48 | "upb", |
| 49 | "zlib", |
| 50 | "zstd-jni", |
| 51 | ]] + [(get_canonical_repo_name("com_github_grpc_grpc") + suffix) for suffix in [ |
| 52 | # Extra grpc dependencies introduced via its module extension |
| 53 | "~grpc_repo_deps_ext~bazel_gazelle", # TODO: Should be a bazel_dep |
| 54 | "~grpc_repo_deps_ext~bazel_skylib", # TODO: Should be removed |
| 55 | "~grpc_repo_deps_ext~com_envoyproxy_protoc_gen_validate", |
| 56 | "~grpc_repo_deps_ext~com_github_cncf_udpa", |
| 57 | "~grpc_repo_deps_ext~com_google_googleapis", |
| 58 | "~grpc_repo_deps_ext~envoy_api", |
| 59 | "~grpc_repo_deps_ext~rules_cc", # TODO: Should be removed |
Yun Peng | 849da31 | 2024-01-30 10:16:17 -0800 | [diff] [blame] | 60 | ]] + [ |
| 61 | # TODO(pcloudy): Remove after https://github.com/bazelbuild/rules_kotlin/issues/1106 is fixed |
| 62 | get_canonical_repo_name("rules_kotlin") + "~rules_kotlin_extensions~com_github_jetbrains_kotlin", |
Xdng Yng | 6d840d1 | 2024-05-21 14:01:28 -0700 | [diff] [blame] | 63 | ] + ["bazel_features~"] |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 64 | |
| 65 | ################################################################################## |
| 66 | # |
| 67 | # Make sure all URLs below are mirrored to https://mirror.bazel.build |
| 68 | # |
| 69 | ################################################################################## |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 70 | |
| 71 | def embedded_jdk_repositories(): |
| 72 | """OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK.""" |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 73 | http_file( |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 74 | name = "openjdk_linux_vanilla", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 75 | sha256 = "0c0eadfbdc47a7ca64aeab51b9c061f71b6e4d25d2d87674512e9b6387e9e3a6", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 76 | downloaded_file_path = "zulu-linux-vanilla.tar.gz", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 77 | url = "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 78 | ) |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 79 | http_file( |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 80 | name = "openjdk_linux_aarch64_vanilla", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 81 | sha256 = "1fb64b8036c5d463d8ab59af06bf5b6b006811e6012e3b0eb6bccf57f1c55835", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 82 | downloaded_file_path = "zulu-linux-aarch64-vanilla.tar.gz", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 83 | url = "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 84 | ) |
| 85 | |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 86 | http_file( |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 87 | name = "openjdk_linux_s390x_vanilla", |
Zheng Wei Tan | e771e66 | 2024-02-01 05:04:01 -0800 | [diff] [blame] | 88 | sha256 = "0d5676c50821e0d0b951bf3ffd717e7a13be2a89d8848a5c13b4aedc6f982c78", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 89 | downloaded_file_path = "adoptopenjdk-s390x-vanilla.tar.gz", |
Zheng Wei Tan | e771e66 | 2024-02-01 05:04:01 -0800 | [diff] [blame] | 90 | url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_s390x_linux_hotspot_21.0.2_13.tar.gz", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 91 | ) |
| 92 | |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 93 | # JDK21 unavailable so use JDK19 instead for linux ppc64le. |
| 94 | http_file( |
| 95 | name = "openjdk_linux_ppc64le_vanilla", |
Zheng Wei Tan | e771e66 | 2024-02-01 05:04:01 -0800 | [diff] [blame] | 96 | sha256 = "d08de863499d8851811c893e8915828f2cd8eb67ed9e29432a6b4e222d80a12f", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 97 | downloaded_file_path = "adoptopenjdk-ppc64le-vanilla.tar.gz", |
Zheng Wei Tan | e771e66 | 2024-02-01 05:04:01 -0800 | [diff] [blame] | 98 | url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.2_13.tar.gz", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 99 | ) |
| 100 | http_file( |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 101 | name = "openjdk_macos_x86_64_vanilla", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 102 | sha256 = "9639b87db586d0c89f7a9892ae47f421e442c64b97baebdff31788fbe23265bd", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 103 | downloaded_file_path = "zulu-macos-vanilla.tar.gz", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 104 | url = "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 105 | ) |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 106 | http_file( |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 107 | name = "openjdk_macos_aarch64_vanilla", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 108 | sha256 = "2a7a99a3ea263dbd8d32a67d1e6e363ba8b25c645c826f5e167a02bbafaff1fa", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 109 | downloaded_file_path = "zulu-macos-aarch64-vanilla.tar.gz", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 110 | url = "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 111 | ) |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 112 | http_file( |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 113 | name = "openjdk_win_vanilla", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 114 | sha256 = "e9959d500a0d9a7694ac243baf657761479da132f0f94720cbffd092150bd802", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 115 | downloaded_file_path = "zulu-win-vanilla.zip", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 116 | url = "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 117 | ) |
| 118 | |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 119 | # JDK21 unavailable from zulu, we'll use Microsoft's OpenJDK build instead. |
| 120 | http_file( |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 121 | name = "openjdk_win_arm64_vanilla", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 122 | sha256 = "975603e684f2ec5a525b3b5336d6aa0b09b5b7d2d0d9e271bd6a9892ad550181", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 123 | downloaded_file_path = "zulu-win-arm64.zip", |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 124 | url = "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-windows-aarch64.zip", |
| 125 | ) |
| 126 | |
Yun Peng | c1f2aff | 2023-11-07 09:51:02 -0800 | [diff] [blame] | 127 | def android_deps_repos(): |
| 128 | """Required by building the android tools.""" |
| 129 | http_archive( |
| 130 | name = "desugar_jdk_libs", |
| 131 | sha256 = "ef71be474fbb3b3b7bd70cda139f01232c63b9e1bbd08c058b00a8d538d4db17", |
| 132 | strip_prefix = "desugar_jdk_libs-24dcd1dead0b64aae3d7c89ca9646b5dc4068009", |
| 133 | url = "https://github.com/google/desugar_jdk_libs/archive/24dcd1dead0b64aae3d7c89ca9646b5dc4068009.zip", |
Googler | 3c84aa8 | 2023-04-11 09:40:31 -0700 | [diff] [blame] | 134 | ) |