-
Notifications
You must be signed in to change notification settings - Fork 2
/
WORKSPACE.bzlmod
199 lines (147 loc) · 5.18 KB
/
WORKSPACE.bzlmod
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# See:
# - https://docs.bazel.build/versions/main/build-ref.html#workspace
# - https://www.youtube.com/watch?v=2Nn71RV_yhI
# - https://bazel.build/external/overview#blzmod
# - https://docs.aspect.build/rules/aspect_bazel_lib/
# - https://github.com/aspect-build/bazel-examples/blob/main/oci_python_image/MODULE.bazel
# NOTE:
# - This overrides WORKSPACE.bazel.
# - This needs to be symlinked to WORKSPACE for Skaffold.
# Declares that this directory is the root of a Bazel workspace.
workspace(
# How this workspace would be referenced with absolute labels from another workspace
name = "monorepo",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
#
# BuildBuddy
#
# See:
# - https://www.buildbuddy.io/docs/rbe-setup#configuring-your-workspace
# - https://github.com/buildbuddy-io/buildbuddy-toolchain
# - https://github.com/buildbuddy-io/buildbuddy-toolchain#ubuntu-2004-image-experimental
http_archive(
name = "io_buildbuddy_buildbuddy_toolchain",
sha256 = "e899f235b36cb901b678bd6f55c1229df23fcbc7921ac7a3585d29bff2bf9cfd",
strip_prefix = "buildbuddy-toolchain-fd351ca8f152d66fc97f9d98009e0ae000854e8f",
urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/fd351ca8f152d66fc97f9d98009e0ae000854e8f.tar.gz"],
)
load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps")
buildbuddy_deps()
load("@io_buildbuddy_buildbuddy_toolchain//:rules.bzl", "buildbuddy", "UBUNTU20_04_IMAGE")
buildbuddy(name = "buildbuddy_toolchain", container_image = UBUNTU20_04_IMAGE)
#
# Salesforce rules_spring
#
# See:
# - https://github.com/salesforce/rules_spring/issues/153
http_archive(
name = "rules_spring",
sha256 = "01426d0a67c32ba0de0b0f3baa2b0810087789c6260c0c06741c1733956158a3",
urls = ["https://github.com/salesforce/rules_spring/releases/download/2.2.4/rules-spring-2.2.4.zip"],
)
#
# Deprecate everything below!
#
#
# Local python approach with workaround support for multi-version
#
### Python Setup (https://github.com/bazelbuild/rules_python/blob/main/examples/pip_install/WORKSPACE)
### Goal: Hermeticity (https://bazel.build/basics/hermeticity)
# load("@rules_python//python:repositories.bzl", "py_repositories")
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains")
py_repositories()
load("@rules_python//python/pip_install:repositories.bzl", "pip_install_dependencies")
pip_install_dependencies()
# TODO: Currently needs to match with python version in MODULE.bazel
default_python_version = "3.11"
python_register_multi_toolchains(
name = "python",
default_version = default_python_version,
python_versions = [
"3.11",
"3.10",
"3.9",
"3.8",
],
register_coverage_tool = True,
)
load("@python//:pip.bzl", "multi_pip_parse")
load("@python//3.11:defs.bzl", interpreter_3_11 = "interpreter")
load("@python//3.10:defs.bzl", interpreter_3_10 = "interpreter")
load("@python//3.9:defs.bzl", interpreter_3_9 = "interpreter")
load("@python//3.8:defs.bzl", interpreter_3_8 = "interpreter")
multi_pip_parse(
name = "pip_deps",
default_version = default_python_version,
python_interpreter_target = {
"3.11": interpreter_3_11,
"3.10": interpreter_3_10,
"3.9": interpreter_3_9,
"3.8": interpreter_3_8,
},
requirements_lock = {
"3.11": "//third_party/python:requirements_lock_3_11.txt",
"3.10": "//third_party/python:requirements_lock_3_10.txt",
"3.9": "//third_party/python:requirements_lock_3_9.txt",
"3.8": "//third_party/python:requirements_lock_3_8.txt",
},
# extra_pip_args = [
# "--extra-index-url", "https://pip.corp.flyrlabs.com/repo"
# ],
#download_only = True,
)
load("@pip_deps//:requirements.bzl", "install_deps")
install_deps()
#
# rules_java
#
# load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
# rules_java_dependencies()
# rules_java_toolchains()
#
# rules_docker
#
# http_archive(
# name = "io_bazel_rules_docker",
# sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
# urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
# )
#
# Golang (rules_docker - go_image)
#
# load("@rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
# go_rules_dependencies()
# go_register_toolchains(
# go_version = "1.20.2",
# )
# load(
# "@io_bazel_rules_docker//repositories:repositories.bzl",
# container_repositories = "repositories",
# )
# container_repositories()
# load(
# "@io_bazel_rules_docker//repositories:deps.bzl",
# container_deps = "deps",
# )
# container_deps()
# load(
# "@io_bazel_rules_docker//go:image.bzl",
# _go_image_repos = "repositories",
# )
# _go_image_repos()
#
# rules_oci (newer than rules_docker; but without using gazelle)
#
#
# Golang (rules_oci - oci_go_image)
#
# load("@rules_oci//oci:pull.bzl", "oci_pull")
# oci_pull(
# name = "go_base",
# image = "index.docker.io/library/golang",
# digest = "sha256:690e4135bf2a4571a572bfd5ddfa806b1cb9c3dea0446ebadaf32bc2ea09d4f9",
# platforms = [
# "linux/amd64",
# ],
# )