Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 1 | # Part of the Crubit project, under the Apache License v2.0 with LLVM |
| 2 | # Exceptions. See /LICENSE for license information. |
| 3 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 | |
| 5 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 6 | |
Teddy Katz | adb0c17 | 2022-11-23 01:02:01 -0800 | [diff] [blame] | 7 | # https://github.com/bazelbuild/bazel-skylib/releases/tag/1.3.0 |
| 8 | |
| 9 | http_archive( |
Jing Lu | 031ff6a | 2023-08-23 03:24:29 -0700 | [diff] [blame] | 10 | name = "platforms", |
| 11 | sha256 = "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51", |
| 12 | urls = [ |
| 13 | "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", |
| 14 | "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", |
| 15 | ], |
| 16 | ) |
| 17 | |
| 18 | http_archive( |
Teddy Katz | adb0c17 | 2022-11-23 01:02:01 -0800 | [diff] [blame] | 19 | name = "bazel_skylib", |
| 20 | sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", |
| 21 | urls = [ |
| 22 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", |
| 23 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", |
| 24 | ], |
| 25 | ) |
| 26 | |
| 27 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 28 | |
| 29 | bazel_skylib_workspace() |
| 30 | |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 31 | http_archive( |
Lukasz Anforowicz | aaa2a0f | 2023-04-11 09:01:14 -0700 | [diff] [blame] | 32 | name = "rules_license", |
| 33 | sha256 = "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381", |
| 34 | urls = [ |
| 35 | "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz", |
| 36 | "https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz", |
| 37 | ], |
| 38 | ) |
| 39 | |
| 40 | http_archive( |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 41 | name = "rules_rust", |
Jing Lu | 2ecfa60 | 2023-08-02 01:47:01 -0700 | [diff] [blame] | 42 | patch_args = [ |
| 43 | "-p1", |
| 44 | ], |
| 45 | patches = [ |
| 46 | # copybara:strip_begin(Google-internal) |
| 47 | # The patch is based on the copybara transformations here: |
| 48 | # http://google3/third_party/bazel_rules/rules_rust/copy.bara.sky;l=398;rcl=549936350 |
| 49 | # copybara:strip_end |
| 50 | "@@//bazel/rules_rust:attach_rust_bindings_from_cc_aspect.patch", |
| 51 | ], |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 52 | sha256 = "4a9cb4fda6ccd5b5ec393b2e944822a62e050c7c06f1ea41607f14c4fdec57a2", |
| 53 | urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.25.1/rules_rust-v0.25.1.tar.gz"], |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 54 | ) |
| 55 | |
| 56 | load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") |
| 57 | |
| 58 | rules_rust_dependencies() |
| 59 | |
Yongheng Chen | 9081265 | 2024-07-24 15:43:21 -0700 | [diff] [blame] | 60 | RUST_TOOLCHAIN_VERSION = "nightly/2024-07-20" |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 61 | |
Marcel Hlopko | 84aeda4 | 2022-07-08 02:38:30 -0700 | [diff] [blame] | 62 | rust_register_toolchains( |
Jing Lu | d476b75 | 2023-07-27 09:25:47 -0700 | [diff] [blame] | 63 | allocator_library = "@//common:rust_allocator_shims", |
Lukasz Anforowicz | c3f27f6 | 2023-04-13 13:43:30 -0700 | [diff] [blame] | 64 | dev_components = True, |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 65 | edition = "2021", |
| 66 | versions = [ |
| 67 | RUST_TOOLCHAIN_VERSION, |
| 68 | ], |
Lukasz Anforowicz | c3f27f6 | 2023-04-13 13:43:30 -0700 | [diff] [blame] | 69 | ) |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 70 | |
| 71 | load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") |
| 72 | |
| 73 | crate_universe_dependencies() |
| 74 | |
| 75 | load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository", "render_config") |
| 76 | |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 77 | # after changing `packages`, re-generate Cargo.lock: |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 78 | # CARGO_BAZEL_REPIN=1 bazelisk sync --only=crate_index |
| 79 | crates_repository( |
| 80 | name = "crate_index", |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 81 | cargo_lockfile = "//:Cargo.lock", |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 82 | packages = { |
| 83 | "anyhow": crate.spec( |
| 84 | version = ">0.0.0", |
| 85 | ), |
Lukasz Anforowicz | 459800d | 2023-04-13 07:08:27 -0700 | [diff] [blame] | 86 | "clap": crate.spec( |
| 87 | features = [ |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 88 | "derive", |
Lukasz Anforowicz | 459800d | 2023-04-13 07:08:27 -0700 | [diff] [blame] | 89 | "color", |
| 90 | "derive", |
| 91 | "env", |
Lukasz Anforowicz | 459800d | 2023-04-13 07:08:27 -0700 | [diff] [blame] | 92 | "std", |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 93 | "string", |
Lukasz Anforowicz | 459800d | 2023-04-13 07:08:27 -0700 | [diff] [blame] | 94 | "suggestions", |
Lukasz Anforowicz | 459800d | 2023-04-13 07:08:27 -0700 | [diff] [blame] | 95 | ], |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 96 | version = ">=4.3.12", |
Lukasz Anforowicz | 459800d | 2023-04-13 07:08:27 -0700 | [diff] [blame] | 97 | ), |
| 98 | "either": crate.spec( |
| 99 | version = ">1.0.0", |
| 100 | ), |
Devin Jeanpierre | 6ed0f60 | 2023-03-01 17:22:54 -0800 | [diff] [blame] | 101 | "flagset": crate.spec( |
| 102 | version = ">0.0.0", |
| 103 | ), |
Devin Jeanpierre | 656d716 | 2024-08-20 13:42:33 -0700 | [diff] [blame] | 104 | "googletest": crate.spec( |
| 105 | version = ">0.0.0", |
| 106 | ), |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 107 | "itertools": crate.spec( |
| 108 | version = ">0.0.0", |
| 109 | ), |
| 110 | "maplit": crate.spec( |
| 111 | version = ">0.0.0", |
| 112 | ), |
Michael VanBemmel | 5014b3e | 2022-08-03 16:27:34 -0700 | [diff] [blame] | 113 | "once_cell": crate.spec( |
| 114 | version = ">0.0.0", |
| 115 | ), |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 116 | "pin-project": crate.spec( |
| 117 | version = ">0.0.0", |
| 118 | ), |
| 119 | "proc-macro2": crate.spec( |
| 120 | version = ">0.0.0", |
| 121 | ), |
| 122 | "quote": crate.spec( |
| 123 | version = ">0.0.0", |
| 124 | ), |
Jing Lu | 04f9f5c | 2023-07-27 11:09:26 -0700 | [diff] [blame] | 125 | "regex": crate.spec( |
| 126 | version = ">=1.6.0", |
| 127 | ), |
Marcel Hlopko | 3a95e02 | 2022-07-08 00:26:16 -0700 | [diff] [blame] | 128 | "salsa": crate.spec( |
| 129 | version = ">0.0.0", |
| 130 | ), |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 131 | "serde": crate.spec( |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 132 | features = [ |
| 133 | "derive", |
| 134 | "rc", |
| 135 | ], |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 136 | version = ">0.0.0", |
| 137 | ), |
| 138 | "serde_json": crate.spec( |
| 139 | version = ">0.0.0", |
| 140 | ), |
Marcel Hlopko | 9bcf75d | 2022-06-03 02:22:46 -0700 | [diff] [blame] | 141 | "static_assertions": crate.spec( |
Marcel Hlopko | 9bcf75d | 2022-06-03 02:22:46 -0700 | [diff] [blame] | 142 | version = ">0.0.0", |
| 143 | ), |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 144 | "syn": crate.spec( |
| 145 | features = ["extra-traits"], |
| 146 | version = ">0.0.0", |
| 147 | ), |
Jing Lu | 04f9f5c | 2023-07-27 11:09:26 -0700 | [diff] [blame] | 148 | "tempfile": crate.spec( |
| 149 | version = "=3.4.0", |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 150 | ), |
Lukasz Anforowicz | 9fca6b4 | 2023-04-11 12:02:59 -0700 | [diff] [blame] | 151 | "unicode-ident": crate.spec( |
Lukasz Anforowicz | f22cf76 | 2023-04-06 15:08:17 -0700 | [diff] [blame] | 152 | version = ">0.0.0", |
| 153 | ), |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 154 | }, |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 155 | render_config = render_config( |
| 156 | default_package_name = "", |
| 157 | ), |
Jing Lu | ba67ca7 | 2023-07-18 04:55:56 -0700 | [diff] [blame] | 158 | rust_version = RUST_TOOLCHAIN_VERSION, |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 159 | ) |
| 160 | |
| 161 | load("@crate_index//:defs.bzl", "crate_repositories") |
| 162 | |
| 163 | crate_repositories() |
| 164 | |
Luca Versari | c21d92f | 2022-05-25 00:56:30 -0700 | [diff] [blame] | 165 | # https://google.github.io/googletest/quickstart-bazel.html |
Luca Versari | c21d92f | 2022-05-25 00:56:30 -0700 | [diff] [blame] | 166 | http_archive( |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 167 | name = "com_google_googletest", |
| 168 | sha256 = "7fda611bceb5a793824a3c63ecbf68d2389e70c38f5763e9b1d415ca24912f44", |
| 169 | strip_prefix = "googletest-1336c4b6d1a6f4bc6beebccb920e5ff858889292", |
| 170 | urls = ["https://github.com/google/googletest/archive/1336c4b6d1a6f4bc6beebccb920e5ff858889292.zip"], |
Luca Versari | c21d92f | 2022-05-25 00:56:30 -0700 | [diff] [blame] | 171 | ) |
| 172 | |
Lukasz Anforowicz | 88328ed | 2023-04-13 06:50:41 -0700 | [diff] [blame] | 173 | # zstd is a dependency of llvm. See https://reviews.llvm.org/D143344#4232172 |
| 174 | http_archive( |
| 175 | name = "llvm_zstd", |
| 176 | build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD", |
| 177 | sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0", |
| 178 | strip_prefix = "zstd-1.5.2", |
| 179 | urls = [ |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 180 | "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz", |
Lukasz Anforowicz | 88328ed | 2023-04-13 06:50:41 -0700 | [diff] [blame] | 181 | ], |
| 182 | ) |
| 183 | |
Jing Lu | d905a5f | 2023-05-31 09:23:01 -0700 | [diff] [blame] | 184 | # @llvm-project//llvm:Support needs zlib. |
| 185 | http_archive( |
| 186 | name = "llvm_zlib", |
| 187 | build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD", |
| 188 | sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731", |
| 189 | strip_prefix = "zlib-ng-2.0.7", |
| 190 | urls = [ |
| 191 | "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip", |
| 192 | ], |
| 193 | ) |
| 194 | |
Matthew Riley | 03a01e3 | 2022-05-24 10:16:04 -0700 | [diff] [blame] | 195 | # Create the "loader" repository, then use it to configure the desired LLVM |
| 196 | # repository. For more details, see the comment in bazel/llvm.bzl. |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 197 | |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 198 | load("//bazel:llvm.bzl", "llvm_loader_repository", "llvm_loader_repository_dependencies") |
| 199 | |
Matthew Riley | 03a01e3 | 2022-05-24 10:16:04 -0700 | [diff] [blame] | 200 | llvm_loader_repository_dependencies() |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 201 | |
Matthew Riley | 03a01e3 | 2022-05-24 10:16:04 -0700 | [diff] [blame] | 202 | llvm_loader_repository(name = "llvm-loader") |
Googler | 75c7ad0 | 2022-05-23 13:27:49 -0700 | [diff] [blame] | 203 | |
Matthew Riley | 03a01e3 | 2022-05-24 10:16:04 -0700 | [diff] [blame] | 204 | load("@llvm-loader//:llvm.bzl", "llvm_repository") |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 205 | |
Matthew Riley | 03a01e3 | 2022-05-24 10:16:04 -0700 | [diff] [blame] | 206 | llvm_repository(name = "llvm-project") |
Sam McCall | 000d1c6 | 2023-06-23 14:10:13 -0700 | [diff] [blame] | 207 | |
| 208 | # protobuf (used in nullability/; crubit proper should not depend on it) |
| 209 | http_archive( |
| 210 | name = "rules_proto", |
| 211 | sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", |
| 212 | strip_prefix = "rules_proto-5.3.0-21.7", |
| 213 | urls = [ |
| 214 | "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", |
| 215 | ], |
| 216 | ) |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 217 | |
Sam McCall | 000d1c6 | 2023-06-23 14:10:13 -0700 | [diff] [blame] | 218 | load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 219 | |
Sam McCall | 000d1c6 | 2023-06-23 14:10:13 -0700 | [diff] [blame] | 220 | rules_proto_dependencies() |
Googler | caa102f | 2023-07-28 04:26:51 -0700 | [diff] [blame] | 221 | |
Sam McCall | 000d1c6 | 2023-06-23 14:10:13 -0700 | [diff] [blame] | 222 | rules_proto_toolchains() |