Debian Codegraph @

utils/bazel/WORKSPACE

raw
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt 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 load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
7
8 SKYLIB_VERSION = "1.3.0"
9
10 http_archive(
11 name = "bazel_skylib",
12 sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
13 urls = [
14 "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION),
15 "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION),
16 ],
17 )
18
19 new_local_repository(
20 name = "llvm-raw",
21 build_file_content = "# empty",
22 path = "../../",
23 )
24
25 load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
26
27 llvm_configure(name = "llvm-project")
28
29 maybe(
30 http_archive,
31 name = "rules_python",
32 sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
33 strip_prefix = "rules_python-0.34.0",
34 url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
35 )
36
37 maybe(
38 http_archive,
39 name = "llvm_zlib",
40 build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
41 sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
42 strip_prefix = "zlib-ng-2.0.7",
43 urls = [
44 "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
45 ],
46 )
47
48 maybe(
49 http_archive,
50 name = "vulkan_headers",
51 build_file = "@llvm-raw//utils/bazel/third_party_build:vulkan_headers.BUILD",
52 sha256 = "19f491784ef0bc73caff877d11c96a48b946b5a1c805079d9006e3fbaa5c1895",
53 strip_prefix = "Vulkan-Headers-9bd3f561bcee3f01d22912de10bb07ce4e23d378",
54 urls = [
55 "https://github.com/KhronosGroup/Vulkan-Headers/archive/9bd3f561bcee3f01d22912de10bb07ce4e23d378.tar.gz",
56 ],
57 )
58
59 load("@llvm-raw//utils/bazel:vulkan_sdk.bzl", "vulkan_sdk_setup")
60
61 maybe(
62 vulkan_sdk_setup,
63 name = "vulkan_sdk",
64 )
65
66 http_archive(
67 name = "build_bazel_apple_support",
68 sha256 = "c4bb2b7367c484382300aee75be598b92f847896fb31bbd22f3a2346adf66a80",
69 url = "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz",
70 )
71
72 load(
73 "@build_bazel_apple_support//lib:repositories.bzl",
74 "apple_support_dependencies",
75 )
76
77 apple_support_dependencies()
78
79 # llvm libc math tests reply on `mpfr`.
80 # The availability of `mpfr` is controlled by a flag and can be either `disable`, `system` or `external`.
81 # Continuous integration uses `system` to speed up the build process (see .bazelrc).
82 # Otherwise by default it is set to `external`: `mpfr` and `gmp` are built from source by using `rules_foreign_cc`.
83 # Note: that building from source requires `m4` to be installed on the host machine.
84 # This is a known issue: https://github.com/bazelbuild/rules_foreign_cc/issues/755.
85
86 http_archive(
87 name = "rules_foreign_cc",
88 sha256 = "4b33d62cf109bcccf286b30ed7121129cc34cf4f4ed9d8a11f38d9108f40ba74",
89 strip_prefix = "rules_foreign_cc-0.11.1",
90 url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.11.1/rules_foreign_cc-0.11.1.tar.gz",
91 )
92
93 load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
94
95 rules_foreign_cc_dependencies()
96
97 maybe(
98 http_archive,
99 name = "gmp",
100 build_file = "@llvm-raw//utils/bazel/third_party_build:gmp.BUILD",
101 sha256 = "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2",
102 strip_prefix = "gmp-6.2.1",
103 urls = [
104 "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz",
105 "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz",
106 ],
107 )
108
109 # https://www.mpfr.org/mpfr-current/
110 #
111 # When updating to a newer version, don't use URLs with "mpfr-current" in them.
112 # Instead, find a stable URL like the one used currently.
113 maybe(
114 http_archive,
115 name = "mpfr",
116 build_file = "@llvm-raw//utils/bazel/third_party_build:mpfr.BUILD",
117 sha256 = "9cbed5d0af0d9ed5e9f8dd013e17838eb15e1db9a6ae0d371d55d35f93a782a7",
118 strip_prefix = "mpfr-4.1.1",
119 urls = ["https://www.mpfr.org/mpfr-4.1.1/mpfr-4.1.1.tar.gz"],
120 )
121
122 maybe(
123 http_archive,
124 name = "pfm",
125 build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD",
126 sha256 = "d18b97764c755528c1051d376e33545d0eb60c6ebf85680436813fa5b04cc3d1",
127 strip_prefix = "libpfm-4.13.0",
128 urls = ["https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.13.0.tar.gz"],
129 )
130
131 maybe(
132 http_archive,
133 name = "llvm_zstd",
134 build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
135 sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
136 strip_prefix = "zstd-1.5.2",
137 urls = [
138 "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
139 ],
140 )
141
142 maybe(
143 http_archive,
144 name = "pybind11",
145 build_file = "@llvm-raw//utils/bazel/third_party_build:pybind.BUILD",
146 sha256 = "201966a61dc826f1b1879a24a3317a1ec9214a918c8eb035be2f30c3e9cfbdcb",
147 strip_prefix = "pybind11-2.10.3",
148 url = "https://github.com/pybind/pybind11/archive/v2.10.3.zip",
149 )
150
151 load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
152
153 py_repositories()
154
155 python_register_toolchains(
156 name = "python_3_12",
157 python_version = "3.12",
158 )