-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE.bazel
117 lines (94 loc) · 3.33 KB
/
WORKSPACE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
## RUST SECTION ##
http_archive(
name = "rules_rust",
sha256 = "d125fb75432dc3b20e9b5a19347b45ec607fabe75f98c6c4ba9badaab9c193ce",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.17.0/rules_rust-v0.17.0.tar.gz"],
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains", "rust_repository_set")
rules_rust_dependencies()
RUST_VERSION = "1.67.1"
rust_register_toolchains(
edition = "2021",
versions = [RUST_VERSION],
)
rust_repository_set(
name = "rust-linux-aarch64",
edition = "2021",
exec_triple = "x86_64-unknown-linux-gnu",
extra_target_triples = ["aarch64-unknown-linux-gnu"],
versions = [RUST_VERSION],
)
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
crate_universe_dependencies()
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
crates_repository(
name = "crate_index",
cargo_lockfile = "//:Cargo.Bazel.lock",
annotations = {
"openssl-sys": [crate.annotation(
build_script_data = [
"@org_ll_sysroot_linux_aarch64//:sysroot",
],
build_script_env = {
"PKG_CONFIG_ALLOW_CROSS": "1",
"PKG_CONFIG_SYSROOT_DIR": "$(execpath @org_ll_sysroot_linux_aarch64//:sysroot)",
"PKG_CONFIG_PATH": "$(execpath @org_ll_sysroot_linux_aarch64//:sysroot)/usr/lib/pkgconfig",
},
)]
},
lockfile = "//:cargo-bazel-lock.json",
manifests = [
"//:Cargo.toml",
],
rust_version = RUST_VERSION,
)
load("@crate_index//:defs.bzl", "crate_repositories")
crate_repositories()
## END RUST SECTION ##
## GRAIL LLVM ##
BAZEL_TOOLCHAIN_TAG = "0.8.2"
BAZEL_TOOLCHAIN_SHA = "0fc3a2b0c9c929920f4bed8f2b446a8274cad41f5ee823fd3faa0d7641f20db0"
http_archive(
name = "com_grail_bazel_toolchain",
canonical_id = BAZEL_TOOLCHAIN_TAG,
sha256 = BAZEL_TOOLCHAIN_SHA,
strip_prefix = "bazel-toolchain-{tag}".format(tag = BAZEL_TOOLCHAIN_TAG),
url = "https://github.com/grailbio/bazel-toolchain/archive/refs/tags/{tag}.tar.gz".format(tag = BAZEL_TOOLCHAIN_TAG),
)
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
bazel_toolchain_dependencies()
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "15.0.6",
)
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
llvm_register_toolchains()
http_archive(
name = "org_ll_sysroot_linux_aarch64",
build_file_content = """
filegroup(
name = "sysroot",
srcs = ["."],
visibility = ["//visibility:public"],
)
""",
sha256 = "4e8ac81cd231108f441a7eea7ce958ef0a69727f2ce7a0b0cd9dd00d49d0fc95",
urls = ["https://github.com/fmorency/test-sysroot/releases/download/v1.0.0/debian_bullseye_arm64_sysroot_ll.tar.xz"],
)
# Toolchain with sysroot
llvm_toolchain(
name = "llvm_toolchain_with_sysroot",
llvm_versions = {
"": "15.0.6",
},
sysroot = {
"linux-aarch64": "@org_ll_sysroot_linux_aarch64//:sysroot",
},
# We can share the downloaded LLVM distribution with the first configuration.
toolchain_roots = {
"": "@llvm_toolchain_llvm//",
},
)
## END GRAIL LLVM ##