|
1 | 1 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 2 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 3 | + |
| 4 | +http_archive( |
| 5 | + name = "rules_rust", |
| 6 | + sha256 = "36ab8f9facae745c9c9c1b33d225623d976e78f2cc3f729b7973d8c20934ab95", |
| 7 | + urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.31.0/rules_rust-v0.31.0.tar.gz"], |
| 8 | +) |
| 9 | + |
| 10 | +load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") |
| 11 | + |
| 12 | +rules_rust_dependencies() |
| 13 | + |
| 14 | +rust_register_toolchains( |
| 15 | + edition = "2021", |
| 16 | + versions = ["1.79.0"], |
| 17 | +) |
| 18 | + |
| 19 | +###################################################################### |
| 20 | + |
| 21 | +# Use to generate rust-project.json. |
| 22 | +# Use bazel run @rules_rust//tools/rust_analyzer:gen_rust_project |
| 23 | + |
| 24 | +load( |
| 25 | + "@rules_rust//tools/rust_analyzer:deps.bzl", |
| 26 | + "rust_analyzer_dependencies", |
| 27 | +) |
| 28 | + |
| 29 | +rust_analyzer_dependencies() |
| 30 | + |
| 31 | +###################################################################### |
| 32 | + |
| 33 | +# This is how to generate new lock files. At the project outset, you must |
| 34 | +# (1) create the empty files `//third_party/cargo:Cargo.lock`, and |
| 35 | +# `//third_party/cargo:Cargo.Bazel.lock`. |
| 36 | +# (2) Run `env CARGO_BAZEL_REPI=true bazel build //...` to initialize the |
| 37 | +# lockfiles. |
| 38 | +load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository", "render_config") |
| 39 | + |
| 40 | +crates_repository( |
| 41 | + name = "crate_index", |
| 42 | + cargo_lockfile = "//:Cargo.lock", |
| 43 | + lockfile = "//:Cargo.Bazel.lock", |
| 44 | + packages = { |
| 45 | + # Add any other crates you need here. |
| 46 | + "bumpalo": crate.spec( |
| 47 | + version = "3.6.1", |
| 48 | + ), |
| 49 | + "libc": crate.spec( |
| 50 | + version = "0.2.34", |
| 51 | + ), |
| 52 | + "paste": crate.spec( |
| 53 | + version = "1.0", |
| 54 | + ), |
| 55 | + "anyhow": crate.spec( |
| 56 | + version = "1.0.72", |
| 57 | + ), |
| 58 | + "bindgen": crate.spec( |
| 59 | + version = "0.59.2", |
| 60 | + ), |
| 61 | + "lazy_static": crate.spec( |
| 62 | + version = "1.4.0", |
| 63 | + ), |
| 64 | + }, |
| 65 | + render_config = render_config( |
| 66 | + default_package_name = "", |
| 67 | + ), |
| 68 | +) |
| 69 | + |
| 70 | +load("@crate_index//:defs.bzl", "crate_repositories") |
| 71 | + |
| 72 | +crate_repositories() |
| 73 | + |
| 74 | +###################################################################### |
2 | 75 |
|
3 | 76 | http_archive( |
4 | 77 | name = "icu_74", |
5 | | - strip_prefix = "icu-release-74-2", |
6 | | - integrity = "sha256-J7hlCpTfb5Rcs7aGvjvjIMKjLt8+zimBZyv5i7O6qeE=", |
7 | 78 | build_file = "//third_party/icu_74:icu.BUILD.bazel", |
8 | | - urls = [ |
9 | | - "https://github.com/unicode-org/icu/archive/refs/tags/release-74-2.tar.gz", |
10 | | - "https://github.com/unicode-org/icu/archive/refs/tags/release-74-2.zip", |
| 79 | + integrity = "sha256-J7hlCpTfb5Rcs7aGvjvjIMKjLt8+zimBZyv5i7O6qeE=", |
| 80 | + patch_args = [ |
| 81 | + "-p1", |
| 82 | + # Without this flag, the bazel build files just get emptied, but not |
| 83 | + # removed. This is not enough. |
| 84 | + "--remove-empty-files", |
11 | 85 | ], |
12 | 86 | patches = [ |
13 | 87 | # ICU has a nascent bazel build, which messes up our build based on |
14 | 88 | # the configure_make rule from rules_foreign_cc. So we remove them. |
15 | 89 | "//third_party/icu_74:0001-fix-removes-BUILD-files.patch", |
16 | 90 | ], |
17 | | - patch_args = [ |
18 | | - "-p1", |
19 | | - # Without this flag, the bazel build files just get emptied, but not |
20 | | - # removed. This is not enough. |
21 | | - "--remove-empty-files", |
22 | | - ] |
| 91 | + strip_prefix = "icu-release-74-2", |
| 92 | + urls = [ |
| 93 | + "https://github.com/unicode-org/icu/archive/refs/tags/release-74-2.tar.gz", |
| 94 | + "https://github.com/unicode-org/icu/archive/refs/tags/release-74-2.zip", |
| 95 | + ], |
23 | 96 | ) |
24 | 97 |
|
25 | 98 | http_archive( |
26 | 99 | name = "icu_73", |
27 | | - strip_prefix = "icu-release-73-1", |
28 | | - integrity = "sha256-57a1QMiB6D0kC0oSty+8l+9frTDY0A8u9nS6GOO/NkA=", |
29 | 100 | build_file = "//third_party/icu_73:icu.BUILD.bazel", |
30 | | - urls = [ |
31 | | - "https://github.com/unicode-org/icu/archive/refs/tags/release-73-1.tar.gz", |
32 | | - "https://github.com/unicode-org/icu/archive/refs/tags/release-73-1.zip", |
| 101 | + integrity = "sha256-57a1QMiB6D0kC0oSty+8l+9frTDY0A8u9nS6GOO/NkA=", |
| 102 | + patch_args = [ |
| 103 | + "-p1", |
| 104 | + "--remove-empty-files", |
33 | 105 | ], |
34 | 106 | patches = [ |
35 | 107 | "//third_party/icu_73:0001-fix-removes-BUILD-files.patch", |
36 | 108 | ], |
37 | | - patch_args = [ |
38 | | - "-p1", |
39 | | - "--remove-empty-files", |
40 | | - ] |
| 109 | + strip_prefix = "icu-release-73-1", |
| 110 | + urls = [ |
| 111 | + "https://github.com/unicode-org/icu/archive/refs/tags/release-73-1.tar.gz", |
| 112 | + "https://github.com/unicode-org/icu/archive/refs/tags/release-73-1.zip", |
| 113 | + ], |
41 | 114 | ) |
42 | 115 |
|
43 | 116 | http_archive( |
44 | 117 | name = "icu_72", |
45 | | - strip_prefix = "icu-release-72-1", |
46 | | - integrity = "sha256-Q8utYo2Y83o/lfbDRXn5FE70veYCSPpgBKTwBtdIfmk=", |
47 | 118 | build_file = "//third_party/icu_72:icu.BUILD.bazel", |
48 | | - urls = [ |
49 | | - "https://github.com/unicode-org/icu/archive/refs/tags/release-72-1.tar.gz", |
50 | | - "https://github.com/unicode-org/icu/archive/refs/tags/release-72-1.zip", |
| 119 | + integrity = "sha256-Q8utYo2Y83o/lfbDRXn5FE70veYCSPpgBKTwBtdIfmk=", |
| 120 | + patch_args = [ |
| 121 | + "-p1", |
| 122 | + "--remove-empty-files", |
51 | 123 | ], |
52 | 124 | patches = [ |
53 | 125 | "//third_party/icu_72:0001-fix-removes-BUILD-files.patch", |
54 | 126 | ], |
55 | | - patch_args = [ |
56 | | - "-p1", |
57 | | - "--remove-empty-files", |
58 | | - ] |
| 127 | + strip_prefix = "icu-release-72-1", |
| 128 | + urls = [ |
| 129 | + "https://github.com/unicode-org/icu/archive/refs/tags/release-72-1.tar.gz", |
| 130 | + "https://github.com/unicode-org/icu/archive/refs/tags/release-72-1.zip", |
| 131 | + ], |
59 | 132 | ) |
0 commit comments