-
Notifications
You must be signed in to change notification settings - Fork 393
/
WORKSPACE.bazel
129 lines (97 loc) · 4.18 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
118
119
120
121
122
123
124
125
126
127
128
129
workspace(name = "examples")
# Users of `rules_rust` will commonly be unable to load it
# using a `local_repository`. Instead, to setup the rules,
# please see https://bazelbuild.github.io/rules_rust/#setup
local_repository(
name = "rules_rust",
path = "..",
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
rules_rust_dependencies()
rust_register_toolchains(
edition = "2018",
include_rustc_srcs = True,
)
load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_repositories")
rust_bindgen_repositories()
load("@rules_rust//proto:repositories.bzl", "rust_proto_repositories")
rust_proto_repositories()
load("@rules_rust//proto:transitive_repositories.bzl", "rust_proto_transitive_repositories")
rust_proto_transitive_repositories()
load("@rules_rust//wasm_bindgen:repositories.bzl", "rust_wasm_bindgen_repositories")
rust_wasm_bindgen_repositories()
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
###############################################################################
# Workspace examples
###############################################################################
# buildifier: disable=same-origin-load
load("@rules_rust//rust:repositories.bzl", "rust_repository_set")
# `rust_repository_set` is the core repository rule for downloading and defining
# a rust_toolchain. Should there be a need for a customized toolchain, this macro can
# be used to define and register one.
rust_repository_set(
name = "fake_toolchain_for_test_of_sha256",
edition = "2018",
exec_triple = "x86_64-unknown-linux-gnu",
extra_target_triples = [],
rustfmt_version = "1.4.12",
sha256s = {
"rust-1.46.0-x86_64-unknown-linux-gnu": "e3b98bc3440fe92817881933f9564389eccb396f5f431f33d48b979fa2fbdcf5",
"rust-std-1.46.0-x86_64-unknown-linux-gnu": "ac04aef80423f612c0079829b504902de27a6997214eb58ab0765d02f7ec1dbc",
"rustfmt-1.4.12-x86_64-unknown-linux-gnu": "1894e76913303d66bf40885a601462844eec15fca9e76a6d13c390d7000d64b0",
},
version = "1.46.0",
)
###############################################################################
# Examples dependencies
###############################################################################
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
node_repositories()
http_archive(
name = "rules_foreign_cc",
sha256 = "69023642d5781c68911beda769f91fcbc8ca48711db935a75da7f6536b65047f",
strip_prefix = "rules_foreign_cc-0.6.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.6.0.tar.gz",
)
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()
load("//sys:sys_deps.bzl", "sys_deps")
sys_deps()
local_repository(
name = "rules_rust_example_cargo_manifest_dir",
path = "cargo_manifest_dir/external_crate",
)
_LIBC_BUILD_FILE_CONTENT = """\
load("@rules_rust//rust:defs.bzl", "rust_library")
rust_library(
name = "libc",
srcs = glob(["src/**/*.rs"]),
edition = "2015",
visibility = ["//visibility:public"],
)
"""
http_archive(
name = "libc",
build_file_content = _LIBC_BUILD_FILE_CONTENT,
sha256 = "1ac4c2ac6ed5a8fb9020c166bc63316205f1dc78d4b964ad31f4f21eb73f0c6d",
strip_prefix = "libc-0.2.20",
urls = [
"https://mirror.bazel.build/github.com/rust-lang/libc/archive/0.2.20.zip",
"https://github.com/rust-lang/libc/archive/0.2.20.zip",
],
)
###############################################################################
http_archive(
name = "bazel_toolchains",
sha256 = "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024",
strip_prefix = "bazel-toolchains-4.1.0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
],
)
load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
# Creates a default toolchain config for RBE.
# Use this as is if you are using the rbe_ubuntu16_04 container,
# otherwise refer to RBE docs.
rbe_autoconfig(name = "buildkite_config")