Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 1 | # Copyright 2020 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 | """List the distribution dependencies we need to build Bazel.""" |
| 15 | |
| 16 | DIST_DEPS = { |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 17 | ######################################## |
| 18 | # |
| 19 | # Runtime language dependencies |
| 20 | # |
| 21 | ######################################## |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 22 | "platforms": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 23 | "archive": "platforms-0.0.4.tar.gz", |
| 24 | "sha256": "079945598e4b6cc075846f7fd6a9d0857c33a7afc0de868c2ccb96405225135d", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 25 | "urls": [ |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 26 | "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", |
| 27 | "https://github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 28 | ], |
| 29 | "used_in": [ |
| 30 | "additional_distfiles", |
| 31 | "test_WORKSPACE_files", |
| 32 | ], |
| 33 | }, |
Chi Wang | 26b94ff | 2021-09-28 23:42:26 -0700 | [diff] [blame] | 34 | "bazelci_rules": { |
| 35 | "archive": "bazelci_rules-1.0.0.tar.gz", |
| 36 | "sha256": "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e", |
| 37 | "strip_prefix": "bazelci_rules-1.0.0", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 38 | "urls": [ |
Chi Wang | 26b94ff | 2021-09-28 23:42:26 -0700 | [diff] [blame] | 39 | "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 40 | ], |
| 41 | "used_in": [ |
| 42 | "additional_distfiles", |
| 43 | ], |
| 44 | }, |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 45 | # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/cc_configure.WORKSPACE. |
| 46 | # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. |
| 47 | # Note: This is not in sync with src/test/java/com/google/devtools/build/lib/blackbox/framework/BlackBoxTestEnvironment.java. |
| 48 | # Perhaps it should be. |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 49 | "rules_cc": { |
| 50 | "archive": "b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 51 | "sha256": "d0c573b94a6ef20ef6ff20154a23d0efcb409fb0e1ff0979cec318dfe42f0cdd", |
| 52 | "strip_prefix": "rules_cc-b1c40e1de81913a3c40e5948f78719c28152486d", |
| 53 | "urls": [ |
| 54 | "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 55 | "https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 56 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 57 | "used_in": [ |
| 58 | "additional_distfiles", |
| 59 | "test_WORKSPACE_files", |
| 60 | ], |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 61 | }, |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 62 | "rules_java": { |
| 63 | "archive": "7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", |
| 64 | "sha256": "bc81f1ba47ef5cc68ad32225c3d0e70b8c6f6077663835438da8d5733f917598", |
| 65 | "strip_prefix": "rules_java-7cf3cefd652008d0a64a419c34c13bdca6c8f178", |
| 66 | "urls": [ |
| 67 | "https://mirror.bazel.build/github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", |
| 68 | "https://github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", |
| 69 | ], |
| 70 | "used_in": [ |
| 71 | "additional_distfiles", |
| 72 | "test_WORKSPACE_files", |
| 73 | ], |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 74 | }, |
Tony Aiuto | 320bc94 | 2021-01-14 07:43:21 -0800 | [diff] [blame] | 75 | # TODO(aiuto): Update src/test/java/com/google/devtools/build/lib/blackbox/framework/BlackBoxTestEnvironment.java to use |
| 76 | # this dynamically. |
| 77 | "rules_proto": { |
| 78 | "archive": "7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", |
| 79 | "sha256": "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da", |
| 80 | "strip_prefix": "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488", |
| 81 | "urls": [ |
| 82 | "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", |
| 83 | "https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", |
| 84 | ], |
| 85 | "used_in": [ |
| 86 | "additional_distfiles", |
| 87 | "test_WORKSPACE_files", |
| 88 | ], |
| 89 | }, |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 90 | ################################################# |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 91 | # |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 92 | # Dependencies which are part of the Bazel binary |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 93 | # |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 94 | ################################################# |
| 95 | "com_google_protobuf": { |
| 96 | "archive": "v3.13.0.tar.gz", |
| 97 | "sha256": "9b4ee22c250fe31b16f1a24d61467e40780a3fbb9b91c3b65be2a376ed913a1a", |
| 98 | "strip_prefix": "protobuf-3.13.0", |
| 99 | "urls": [ |
| 100 | "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz", |
| 101 | "https://github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz", |
| 102 | ], |
| 103 | "patch_args": ["-p1"], |
| 104 | "patches": ["//third_party/protobuf:3.13.0.patch"], |
| 105 | "used_in": [ |
| 106 | "additional_distfiles", |
| 107 | "test_WORKSPACE_files", |
| 108 | ], |
| 109 | }, |
Tony Aiuto | 320bc94 | 2021-01-14 07:43:21 -0800 | [diff] [blame] | 110 | "protocolbuffers": { |
| 111 | "archive": "382d5afc60e05470c23e8de19b19fc5ad231e732.tar.gz", |
| 112 | "sha256": "7992217989f3156f8109931c1fc6db3434b7414957cb82371552377beaeb9d6c", |
| 113 | "urls": [ |
| 114 | "https://mirror.bazel.build/github.com/protocolbuffers/upb/archive/382d5afc60e05470c23e8de19b19fc5ad231e732.tar.gz", |
| 115 | "https://github.com/protocolbuffers/upb/archive/382d5afc60e05470c23e8de19b19fc5ad231e732.tar.gz", |
| 116 | ], |
| 117 | "used_in": [ |
| 118 | "additional_distfiles", |
| 119 | "test_WORKSPACE_files", |
| 120 | ], |
| 121 | }, |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 122 | "com_github_grpc_grpc": { |
Lauri Peltonen | 2df3d39 | 2021-02-26 04:37:48 -0800 | [diff] [blame] | 123 | "archive": "v1.33.1.tar.gz", |
| 124 | "sha256": "58eaee5c0f1bd0b92ebe1fa0606ec8f14798500620e7444726afcaf65041cb63", |
| 125 | "strip_prefix": "grpc-1.33.1", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 126 | "urls": [ |
Lauri Peltonen | 2df3d39 | 2021-02-26 04:37:48 -0800 | [diff] [blame] | 127 | "https://mirror.bazel.build/github.com/grpc/grpc/archive/v1.33.1.tar.gz", |
| 128 | "https://github.com/grpc/grpc/archive/v1.33.1.tar.gz", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 129 | ], |
| 130 | "patch_args": ["-p1"], |
| 131 | "patches": [ |
Lauri Peltonen | 2df3d39 | 2021-02-26 04:37:48 -0800 | [diff] [blame] | 132 | "//third_party/grpc:grpc_1.33.1.patch", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 133 | ], |
| 134 | "used_in": [ |
| 135 | "additional_distfiles", |
| 136 | "test_WORKSPACE_files", |
| 137 | ], |
| 138 | }, |
| 139 | "c-ares": { |
| 140 | "archive": "e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", |
| 141 | "sha256": "e8c2751ddc70fed9dc6f999acd92e232d5846f009ee1674f8aee81f19b2b915a", |
| 142 | "urls": [ |
| 143 | "https://mirror.bazel.build/github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", |
| 144 | "https://github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", |
| 145 | ], |
| 146 | "used_in": [ |
| 147 | "additional_distfiles", |
| 148 | "test_WORKSPACE_files", |
| 149 | ], |
| 150 | }, |
| 151 | "re2": { |
| 152 | "archive": "aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", |
| 153 | "sha256": "9f385e146410a8150b6f4cb1a57eab7ec806ced48d427554b1e754877ff26c3e", |
| 154 | "urls": [ |
| 155 | "https://mirror.bazel.build/github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", |
| 156 | "https://github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", |
| 157 | ], |
| 158 | "used_in": [ |
| 159 | "additional_distfiles", |
| 160 | "test_WORKSPACE_files", |
| 161 | ], |
| 162 | }, |
| 163 | "abseil-cpp": { |
| 164 | "archive": "df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", |
| 165 | "sha256": "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a", |
| 166 | "urls": [ |
| 167 | "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", |
| 168 | "https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", |
| 169 | ], |
| 170 | "used_in": [ |
| 171 | "additional_distfiles", |
| 172 | "test_WORKSPACE_files", |
| 173 | ], |
| 174 | }, |
| 175 | ################################################### |
| 176 | # |
| 177 | # Build time dependencies for testing and packaging |
| 178 | # |
| 179 | ################################################### |
Tony Aiuto | 2b7ec5c | 2021-01-11 07:50:26 -0800 | [diff] [blame] | 180 | "bazel_skylib": { |
| 181 | "archive": "bazel-skylib-1.0.3.tar.gz", |
| 182 | "sha256": "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", |
| 183 | "urls": [ |
| 184 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", |
| 185 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", |
| 186 | ], |
| 187 | "used_in": [ |
| 188 | "additional_distfiles", |
| 189 | "test_WORKSPACE_files", |
| 190 | ], |
| 191 | }, |
| 192 | "io_bazel_skydoc": { |
| 193 | "archive": "1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", |
| 194 | "sha256": "5a725b777976b77aa122b707d1b6f0f39b6020f66cd427bb111a585599c857b1", |
| 195 | "urls": [ |
| 196 | "https://mirror.bazel.build/github.com/bazelbuild/stardoc/archive/1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", |
| 197 | "https://github.com/bazelbuild/stardoc/archive/1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", |
| 198 | ], |
| 199 | "used_in": [ |
| 200 | "additional_distfiles", |
| 201 | ], |
| 202 | "strip_prefix": "stardoc-1ef781ced3b1443dca3ed05dec1989eca1a4e1cd", |
| 203 | }, |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 204 | "rules_pkg": { |
Tony Aiuto | 99079b3 | 2021-04-06 06:41:17 -0700 | [diff] [blame] | 205 | "archive": "rules_pkg-0.4.0.tar.gz", |
| 206 | "sha256": "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d", |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 207 | "urls": [ |
Tony Aiuto | 99079b3 | 2021-04-06 06:41:17 -0700 | [diff] [blame] | 208 | "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz", |
| 209 | "https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz", |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 210 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 211 | "used_in": [ |
| 212 | "additional_distfiles", |
| 213 | ], |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 214 | }, |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 215 | # for Stardoc |
| 216 | "io_bazel_rules_sass": { |
| 217 | "archive": "1.25.0.zip", |
| 218 | "sha256": "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", |
| 219 | "strip_prefix": "rules_sass-1.25.0", |
| 220 | "urls": [ |
| 221 | "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| 222 | "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| 223 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 224 | "used_in": [ |
| 225 | "additional_distfiles", |
| 226 | ], |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 227 | }, |
| 228 | # for Stardoc |
| 229 | "build_bazel_rules_nodejs": { |
| 230 | "archive": "rules_nodejs-2.2.2.tar.gz", |
| 231 | "sha256": "f2194102720e662dbf193546585d705e645314319554c6ce7e47d8b59f459e9c", |
| 232 | "urls": [ |
| 233 | "https://mirror.bazel.build/github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| 234 | "https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| 235 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 236 | "used_in": [ |
| 237 | "additional_distfiles", |
| 238 | ], |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 239 | }, |
menny | f431b0c | 2021-01-13 09:18:29 -0800 | [diff] [blame] | 240 | "desugar_jdk_libs": { |
Menny Even Danan | 29cfb0b | 2021-03-31 15:21:30 -0700 | [diff] [blame] | 241 | # Commit 5847d6a06302136d95a14b4cbd4b55a9c9f1436e of 2021-03-10 |
| 242 | "archive": "5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", |
| 243 | "sha256": "299452e6f4a4981b2e6d22357f7332713382a63e4c137f5fd6b89579f6d610cb", |
| 244 | "strip_prefix": "desugar_jdk_libs-5847d6a06302136d95a14b4cbd4b55a9c9f1436e", |
menny | f431b0c | 2021-01-13 09:18:29 -0800 | [diff] [blame] | 245 | "urls": [ |
Menny Even Danan | 29cfb0b | 2021-03-31 15:21:30 -0700 | [diff] [blame] | 246 | "https://mirror.bazel.build/github.com/google/desugar_jdk_libs/archive/5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", |
| 247 | "https://github.com/google/desugar_jdk_libs/archive/5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", |
menny | f431b0c | 2021-01-13 09:18:29 -0800 | [diff] [blame] | 248 | ], |
| 249 | "used_in": [ |
| 250 | "additional_distfiles", |
| 251 | ], |
| 252 | }, |
aiuto | bbeb1da | 2021-01-15 06:50:56 -0800 | [diff] [blame] | 253 | "remote_coverage_tools": { |
| 254 | "archive": "coverage_output_generator-v2.5.zip", |
| 255 | "sha256": "cd14f1cb4559e4723e63b7e7b06d09fcc3bd7ba58d03f354cdff1439bd936a7d", |
| 256 | "urls": [ |
| 257 | "https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.5.zip", |
| 258 | ], |
| 259 | "used_in": [ |
| 260 | "additional_distfiles", |
| 261 | "test_WORKSPACE_files", |
| 262 | ], |
| 263 | }, |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 264 | "remote_java_tools": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 265 | "aliases": [ |
| 266 | "remote_java_tools_test", |
| 267 | "remote_java_tools_for_testing", |
| 268 | ], |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 269 | "archive": "java_tools-v11.5.zip", |
| 270 | "sha256": "b763ee80e5754e593fd6d5be6d7343f905bc8b73d661d36d842b024ca11b6793", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 271 | "urls": [ |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 272 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.5/java_tools-v11.5.zip", |
| 273 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.5/java_tools-v11.5.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 274 | ], |
| 275 | "used_in": [ |
| 276 | "additional_distfiles", |
| 277 | "test_WORKSPACE_files", |
| 278 | ], |
| 279 | }, |
| 280 | "remote_java_tools_linux": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 281 | "aliases": [ |
| 282 | "remote_java_tools_test_linux", |
| 283 | "remote_java_tools_linux_for_testing", |
| 284 | ], |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 285 | "archive": "java_tools_linux-v11.5.zip", |
| 286 | "sha256": "ae1eca4546eac6487c6e565f9b409536609c273207220c51e5c94f2a058a5a56", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 287 | "urls": [ |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 288 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.5/java_tools_linux-v11.5.zip", |
| 289 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.5/java_tools_linux-v11.5.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 290 | ], |
| 291 | "used_in": [ |
| 292 | "additional_distfiles", |
| 293 | "test_WORKSPACE_files", |
| 294 | ], |
| 295 | }, |
| 296 | "remote_java_tools_windows": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 297 | "aliases": [ |
| 298 | "remote_java_tools_test_windows", |
| 299 | "remote_java_tools_windows_for_testing", |
| 300 | ], |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 301 | "archive": "java_tools_windows-v11.5.zip", |
| 302 | "sha256": "36766802f7ec684cecb1a14c122428de6be9784e88419e2ab5912ad4b59a8c7d", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 303 | "urls": [ |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 304 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.5/java_tools_windows-v11.5.zip", |
| 305 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.5/java_tools_windows-v11.5.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 306 | ], |
| 307 | "used_in": [ |
| 308 | "additional_distfiles", |
| 309 | "test_WORKSPACE_files", |
| 310 | ], |
| 311 | }, |
| 312 | "remote_java_tools_darwin": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 313 | "aliases": [ |
| 314 | "remote_java_tools_test_darwin", |
| 315 | "remote_java_tools_darwin_for_testing", |
| 316 | ], |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 317 | "archive": "java_tools_darwin-v11.5.zip", |
| 318 | "sha256": "792bc1352e736073b152528175ed424687f86a9f6f5f461f07d8b26806762738", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 319 | "urls": [ |
hvadehra | 902e4bb | 2021-10-06 11:34:24 -0700 | [diff] [blame] | 320 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.5/java_tools_darwin-v11.5.zip", |
| 321 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.5/java_tools_darwin-v11.5.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 322 | ], |
| 323 | "used_in": [ |
| 324 | "additional_distfiles", |
| 325 | "test_WORKSPACE_files", |
| 326 | ], |
| 327 | }, |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 328 | } |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 329 | |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 330 | # Add aliased names |
| 331 | DEPS_BY_NAME = {} |
| 332 | |
| 333 | def _create_index(): |
| 334 | for repo_name in DIST_DEPS: |
| 335 | repo = DIST_DEPS[repo_name] |
| 336 | DEPS_BY_NAME[repo_name] = repo |
| 337 | aliases = repo.get("aliases") |
| 338 | if aliases: |
| 339 | for alias in aliases: |
| 340 | DEPS_BY_NAME[alias] = repo |
| 341 | |
| 342 | _create_index() |
| 343 | |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 344 | def _gen_workspace_stanza_impl(ctx): |
| 345 | if ctx.attr.template and (ctx.attr.preamble or ctx.attr.postamble): |
| 346 | fail("Can not use template with either preamble or postamble") |
| 347 | |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 348 | if ctx.attr.use_maybe: |
| 349 | repo_clause = """ |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 350 | maybe( |
| 351 | http_archive, |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 352 | name = "{repo}", |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 353 | sha256 = "{sha256}", |
| 354 | strip_prefix = {strip_prefix}, |
| 355 | urls = {urls}, |
| 356 | ) |
| 357 | """ |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 358 | else: |
| 359 | repo_clause = """ |
| 360 | http_archive( |
| 361 | name = "{repo}", |
| 362 | sha256 = "{sha256}", |
| 363 | strip_prefix = {strip_prefix}, |
| 364 | urls = {urls}, |
| 365 | ) |
| 366 | """ |
| 367 | |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 368 | repo_stanzas = {} |
| 369 | for repo in ctx.attr.repos: |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 370 | info = DEPS_BY_NAME[repo] |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 371 | strip_prefix = info.get("strip_prefix") |
| 372 | if strip_prefix: |
| 373 | strip_prefix = "\"%s\"" % strip_prefix |
| 374 | else: |
| 375 | strip_prefix = "None" |
| 376 | |
| 377 | repo_stanzas["{%s}" % repo] = repo_clause.format( |
| 378 | repo = repo, |
| 379 | archive = info["archive"], |
| 380 | sha256 = str(info["sha256"]), |
| 381 | strip_prefix = strip_prefix, |
| 382 | urls = info["urls"], |
| 383 | ) |
| 384 | |
| 385 | if ctx.attr.template: |
| 386 | ctx.actions.expand_template( |
| 387 | output = ctx.outputs.out, |
| 388 | template = ctx.file.template, |
| 389 | substitutions = repo_stanzas, |
| 390 | ) |
| 391 | else: |
| 392 | content = "\n".join([p.strip() for p in ctx.attr.preamble.strip().split("\n")]) |
| 393 | content += "\n" |
| 394 | content += "".join(repo_stanzas.values()) |
| 395 | content += "\n" |
| 396 | content += "\n".join([p.strip() for p in ctx.attr.postamble.strip().split("\n")]) |
| 397 | content += "\n" |
| 398 | ctx.actions.write(ctx.outputs.out, content) |
| 399 | |
| 400 | return [DefaultInfo(files = depset([ctx.outputs.out]))] |
| 401 | |
| 402 | gen_workspace_stanza = rule( |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 403 | attrs = { |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 404 | "repos": attr.string_list(doc = "Set of repos to include."), |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 405 | "out": attr.output(mandatory = True), |
| 406 | "preamble": attr.string(doc = "Preamble."), |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 407 | "postamble": attr.string(doc = "Set of rules to follow repos."), |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 408 | "template": attr.label( |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 409 | doc = "Template WORKSPACE file. May not be used with preamble or postamble." + |
| 410 | "Repo stanzas can be included using the syntax '{repo name}'.", |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 411 | allow_single_file = True, |
| 412 | mandatory = False, |
| 413 | ), |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 414 | "use_maybe": attr.bool(doc = "Use maybe() invocation instead of http_archive."), |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 415 | }, |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 416 | doc = "Use specifications from DIST_DEPS to generate WORKSPACE http_archive stanzas or to" + |
| 417 | "drop them into a template.", |
| 418 | implementation = _gen_workspace_stanza_impl, |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 419 | ) |