bazel: Fix build

This commit is contained in:
Mizux Seiha
2023-04-01 02:42:04 +02:00
committed by Corentin Le Molgat
parent 59878dd6de
commit 2de7d6fbac
13 changed files with 43 additions and 41 deletions

View File

@@ -175,16 +175,15 @@ git_repository(
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
# Create a central external repo, @ortools_deps, that contains Bazel targets for all the
# Create a central external repo, @pip_deps, that contains Bazel targets for all the
# third-party packages specified in the python_deps.txt file.
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
name = "ortools_deps",
name = "pip_deps",
requirements = "//bazel:ortools_requirements.txt",
)
load("@ortools_deps//:requirements.bzl", "install_deps")
load("@pip_deps//:requirements.bzl", "install_deps")
install_deps()
# Add a second repo @ortools_notebook_deps for jupyter notebooks.

View File

@@ -13,7 +13,7 @@
"""Helper macro to compile and test code samples."""
load("@ortools_deps//:requirements.bzl", "requirement")
load("@pip_deps//:requirements.bzl", "requirement")
PYTHON_DEPS = [
"//ortools/linear_solver/python:model_builder",

View File

@@ -11,20 +11,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_python//python:proto.bzl", "py_proto_library")
package(default_visibility = ["//visibility:public"])
cc_proto_library(
name = "bop_parameters_cc_proto",
deps = ["bop_parameters_proto"],
)
proto_library(
name = "bop_parameters_proto",
srcs = ["bop_parameters.proto"],
)
cc_proto_library(
name = "bop_parameters_cc_proto",
deps = ["bop_parameters_proto"],
)
cc_library(
name = "bop_types",
hdrs = ["bop_types.h"],

View File

@@ -13,7 +13,9 @@
# Home of constraint solver constraint_solver
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_python//python:proto.bzl", "py_proto_library")
package(default_visibility = ["//visibility:public"])

View File

@@ -11,8 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_python//python:proto.bzl", "py_proto_library")
package(
default_visibility = ["//visibility:public"],
@@ -233,6 +234,11 @@ cc_library(
# Glop parameters.
proto_library(
name = "parameters_proto",
srcs = ["parameters.proto"],
)
cc_proto_library(
name = "parameters_cc_proto",
deps = [":parameters_proto"],
@@ -240,12 +246,7 @@ cc_proto_library(
py_proto_library(
name = "parameters_py_pb2",
srcs = ["parameters.proto"],
)
proto_library(
name = "parameters_proto",
srcs = ["parameters.proto"],
deps = [":parameters_proto"],
)
# Dual edge norms.

View File

@@ -13,7 +13,7 @@
"""Helper macro to compile and test code samples."""
load("@ortools_deps//:requirements.bzl", "requirement")
load("@pip_deps//:requirements.bzl", "requirement")
def code_sample_cc(name):
native.cc_binary(

View File

@@ -12,7 +12,7 @@
# limitations under the License.
# Python wrapper for model_builder.
load("@ortools_deps//:requirements.bzl", "requirement")
load("@pip_deps//:requirements.bzl", "requirement")
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
load("@rules_python//python:defs.bzl", "py_library", "py_test")

View File

@@ -13,7 +13,7 @@
"""Helper macro to compile and test code samples."""
load("@ortools_deps//:requirements.bzl", "requirement")
load("@pip_deps//:requirements.bzl", "requirement")
def code_sample_cc(name):
native.cc_binary(

View File

@@ -11,8 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_python//python:proto.bzl", "py_proto_library")
package(default_visibility = ["//visibility:public"])
@@ -29,8 +30,7 @@ cc_proto_library(
py_proto_library(
name = "solve_log_py_pb2",
srcs = ["solve_log.proto"],
deps = [":solvers_py_pb2"],
deps = [":solve_log_proto"],
)
proto_library(
@@ -46,8 +46,9 @@ cc_proto_library(
py_proto_library(
name = "solvers_py_pb2",
srcs = ["solvers.proto"],
deps = ["//ortools/glop:parameters_py_pb2"],
deps = [
":solvers_proto",
],
)
cc_library(

View File

@@ -15,7 +15,7 @@
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
load("@rules_python//python:defs.bzl", "py_test")
load("@ortools_deps//:requirements.bzl", "requirement")
load("@pip_deps//:requirements.bzl", "requirement")
pybind_extension(
name = "pywrap_pdlp",

View File

@@ -35,26 +35,24 @@ cc_proto_library(
py_proto_library(
name = "sat_parameters_py_pb2",
visibility = ["//visibility:public"],
deps = [":sat_parameters_proto"],
)
java_proto_library(
name = "sat_parameters_java_proto",
visibility = ["//visibility:public"],
deps = [":sat_parameters_proto"],
)
cc_proto_library(
name = "boolean_problem_cc_proto",
deps = [":boolean_problem_proto"],
)
proto_library(
name = "boolean_problem_proto",
srcs = ["boolean_problem.proto"],
)
cc_proto_library(
name = "boolean_problem_cc_proto",
deps = [":boolean_problem_proto"],
)
proto_library(
name = "cp_model_proto",
srcs = ["cp_model.proto"],
@@ -67,7 +65,6 @@ cc_proto_library(
py_proto_library(
name = "cp_model_py_pb2",
visibility = ["//visibility:public"],
deps = [":cp_model_proto"],
)
@@ -277,7 +274,7 @@ cc_library(
":drat_checker",
":drat_proof_handler",
":feasibility_jump",
":feasibility_pump",
":feasibility_pump",
":integer",
":integer_expr",
":integer_search",

View File

@@ -13,7 +13,7 @@
# Python wrapper for cp_model.
load("@ortools_deps//:requirements.bzl", "requirement")
load("@pip_deps//:requirements.bzl", "requirement")
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
load("@rules_python//python:defs.bzl", "py_library")

View File

@@ -13,7 +13,7 @@
"""Helper macro to compile and test code samples."""
load("@ortools_deps//:requirements.bzl", "requirement")
load("@pip_deps//:requirements.bzl", "requirement")
def code_sample_cc(name):
native.cc_binary(