Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
195 lines (172 loc) · 7.45 KB
/
Copy pathMODULE.bazel
File metadata and controls
195 lines (172 loc) · 7.45 KB
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
# Copyright 2010-2025 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
module(
name = "or-tools",
version = "10.0",
)
# see https://registry.bazel.build/
# Bazel dependencies
bazel_dep(name = "bazel_skylib", version = "1.9.2")
bazel_dep(name = "contrib_rules_jvm", version = "0.32.0")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_cc", version = "0.2.25")
bazel_dep(name = "rules_go", version = "0.59.0")
bazel_dep(name = "rules_java", version = "9.6.1")
bazel_dep(name = "rules_jvm_external", version = "6.10")
bazel_dep(name = "rules_jni", version = "0.11.1")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_python", version = "2.2.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
# OR-Tools C++ dependencies
bazel_dep(name = "abseil-cpp", version = "20260817.0")
bazel_dep(name = "bzip2", version = "1.0.8.bcr.3")
bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
bazel_dep(name = "glpk", version = "5.0.bcr.4")
bazel_dep(name = "google_benchmark", version = "1.9.5")
bazel_dep(name = "googletest", version = "1.18.0")
bazel_dep(name = "highs", version = "1.16.0")
bazel_dep(name = "protobuf-matchers", version = "0.1.2")
bazel_dep(name = "protobuf", version = "35.1")
# Prefer archive_override with a pinned `integrity` hash over git_override:
# git_override runs `git fetch` directly into the output base and bypasses
# Bazel's content-addressable `--repository_cache`, whereas archive_override
# caches the downloaded tarball in `--repository_cache` (pre-populated in the
# CI container image), avoiding repeated network fetches and git clone flakes.
#
# To compute `integrity` when updating a commit:
# HASH=$(curl -fsSL <url> | openssl dgst -sha256 -binary | openssl base64 -A)
# echo "sha256-${HASH}"
archive_override(
module_name = "protobuf",
integrity = "sha256-+CZMblax/lnQaqG5nugfdiRu0rRs8shrilD4SC+gVmU=",
patch_strip = 1,
patches = ["//:patches/protobuf-v35.1.patch"],
strip_prefix = "protobuf-35cd01f9fe9afbeea38cc7b979a3b6bfcde82c03",
urls = ["https://github.com/protocolbuffers/protobuf/archive/35cd01f9fe9afbeea38cc7b979a3b6bfcde82c03.tar.gz"],
)
bazel_dep(name = "re2", version = "2025-11-05.bcr.1")
bazel_dep(name = "scip", version = "10.0.3")
bazel_dep(name = "zlib", version = "1.3.2")
# OR-Tools wrappers dependencies
bazel_dep(name = "gazelle", version = "0.47.0")
bazel_dep(name = "pybind11_bazel", version = "3.0.1")
bazel_dep(name = "pybind11_abseil", version = "202402.0")
# Use archive_override instead of git_override so `--repository_cache` caches the archive.
archive_override(
module_name = "pybind11_abseil",
integrity = "sha256-KPc6HpKkquQ9MBfG49fYKSU8DOHth+rMN/FsR4OQQjM=",
patch_strip = 1,
patches = ["//:patches/pybind11_abseil.patch"],
strip_prefix = "pybind11_abseil-70f8b693b3b70573ca785ef62d9f48054f45d786",
urls = ["https://github.com/pybind/pybind11_abseil/archive/70f8b693b3b70573ca785ef62d9f48054f45d786.tar.gz"],
)
bazel_dep(name = "pybind11_protobuf", version = "0.0.0-20240524-1d7a729")
# Use archive_override instead of git_override so `--repository_cache` caches the archive.
archive_override(
module_name = "pybind11_protobuf",
integrity = "sha256-bHEspfweFd8u0fVb2XTDKjBl5lhINhbz/adgdUbbM6s=",
patch_strip = 1,
patches = ["//:patches/pybind11_protobuf.patch"],
strip_prefix = "pybind11_protobuf-f02a2b7653bc50eb5119d125842a3870db95d251",
urls = ["https://github.com/pybind/pybind11_protobuf/archive/f02a2b7653bc50eb5119d125842a3870db95d251.tar.gz"],
)
bazel_dep(name = "swig", version = "4.3.0")
# Python
# https://rules-python.readthedocs.io/en/latest/toolchains.html#library-modules-with-dev-only-python-usage
DEFAULT_PYTHON = "3.12"
python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
python.defaults(python_version = DEFAULT_PYTHON)
python.toolchain(python_version = DEFAULT_PYTHON)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
[
pip.parse(
envsubst = ["PIP_INDEX_URL"],
experimental_index_url = "${PIP_INDEX_URL:-https://pypi.org/simple}",
hub_name = hub_name,
python_version = DEFAULT_PYTHON,
requirements_lock = requirements_lock,
)
for hub_name, requirements_lock in [
("ortools_pip_deps", "//bazel:ortools_requirements.txt"),
("ortools_notebook_deps", "//bazel:notebook_requirements.txt"),
]
]
use_repo(pip, pip_deps = "ortools_pip_deps")
use_repo(pip, "ortools_notebook_deps")
# Java
JUNIT_PLATFORM_VERSION = "1.9.2"
JUNIT_JUPITER_VERSION = "5.9.2"
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
"com.google.errorprone:error_prone_type_annotations:2.46.0",
"com.google.guava:guava:33.5.0-jre",
"com.google.protobuf:protobuf-java:4.35.1",
"com.google.protobuf:protobuf-java-util:4.35.1",
"com.google.truth:truth:1.4.2",
"com.google.truth.extensions:truth-proto-extension:1.4.2",
"net.java.dev.jna:jna:5.14.0",
"org.jspecify:jspecify:1.0.0",
"org.junit.platform:junit-platform-launcher:%s" % JUNIT_PLATFORM_VERSION,
"org.junit.platform:junit-platform-reporting:%s" % JUNIT_PLATFORM_VERSION,
"org.junit.jupiter:junit-jupiter-api:%s" % JUNIT_JUPITER_VERSION,
"org.junit.jupiter:junit-jupiter-params:%s" % JUNIT_JUPITER_VERSION,
"org.junit.jupiter:junit-jupiter-engine:%s" % JUNIT_JUPITER_VERSION,
],
repositories = [
"https://repo1.maven.org/maven2",
],
)
use_repo(maven, "maven")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.4")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.module(
path = "github.com/golang/glog",
sum = "h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I=",
version = "v1.2.5",
)
go_deps.module(
path = "github.com/golang/protobuf",
sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=",
version = "v1.5.4",
)
go_deps.module(
path = "github.com/google/go-cmp",
sum = "h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=",
version = "v0.6.0",
)
go_deps.module(
path = "google.golang.org/protobuf",
sum = "h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=",
version = "v1.36.5",
)
go_deps.module(
path = "golang.org/x/xerrors",
sum = "h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=",
version = "v0.0.0-20191204190536-9bdfabe68543",
)
use_repo(
go_deps,
"com_github_golang_glog",
"com_github_golang_protobuf",
"com_github_google_go_cmp",
"org_golang_google_protobuf",
"org_golang_x_xerrors",
)