From c308bf811efab24d26246364185610c8532cb00a Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Fri, 15 Nov 2024 09:54:19 +0100 Subject: [PATCH] bazel: cleanup --- bazel/scip.BUILD.bazel | 13 +++++++------ ortools/algorithms/BUILD.bazel | 5 +++-- ortools/bop/BUILD.bazel | 5 +++-- ortools/glop/BUILD.bazel | 5 +++-- ortools/graph/BUILD.bazel | 5 +++-- ortools/gscip/BUILD.bazel | 4 +++- ortools/linear_solver/BUILD.bazel | 5 +++-- ortools/math_opt/solvers/BUILD.bazel | 7 +++++-- ortools/scheduling/BUILD.bazel | 5 +++-- ortools/util/BUILD.bazel | 10 +++++++++- patches/BUILD.bazel | 3 ++- 11 files changed, 44 insertions(+), 23 deletions(-) diff --git a/bazel/scip.BUILD.bazel b/bazel/scip.BUILD.bazel index 8271c09fb9..b42efddc5a 100644 --- a/bazel/scip.BUILD.bazel +++ b/bazel/scip.BUILD.bazel @@ -49,7 +49,7 @@ PLATFORM_FLAGS = select({ "/DSYM=none", "/DSCIP_NO_SIGACTION", "/DSCIP_NO_STRTOK_R", - ], + ], "//conditions:default": [], }) @@ -99,11 +99,12 @@ cc_library( "src/scip/sorttpl.c", ], exclude = - [ - #"src/scip/prop_symmetry.h", - "src/scip/*_xyz.h", - ]), - copts = [ + [ + #"src/scip/prop_symmetry.h", + "src/scip/*_xyz.h", + ], + ), + copts = [ "$(STACK_FRAME_UNLIMITED)", # src/scip/reader_cnf.c #"-DTPI_TNY", # src/tpi/type_tpi_tnycthrd.h "-DTPI_NONE", # src/tpi/type_tpi_none.h diff --git a/ortools/algorithms/BUILD.bazel b/ortools/algorithms/BUILD.bazel index b773091dc1..5209bca838 100644 --- a/ortools/algorithms/BUILD.bazel +++ b/ortools/algorithms/BUILD.bazel @@ -12,8 +12,9 @@ # limitations under the License. load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:proto.bzl", "py_proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/bop/BUILD.bazel b/ortools/bop/BUILD.bazel index 47209902d2..c57099ecb8 100644 --- a/ortools/bop/BUILD.bazel +++ b/ortools/bop/BUILD.bazel @@ -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_library", "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:proto.bzl", "py_proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/glop/BUILD.bazel b/ortools/glop/BUILD.bazel index 687c48d363..90a694714e 100644 --- a/ortools/glop/BUILD.bazel +++ b/ortools/glop/BUILD.bazel @@ -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_library", "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:proto.bzl", "py_proto_library") package( diff --git a/ortools/graph/BUILD.bazel b/ortools/graph/BUILD.bazel index 58fd430169..407178ed3b 100644 --- a/ortools/graph/BUILD.bazel +++ b/ortools/graph/BUILD.bazel @@ -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_library", "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/gscip/BUILD.bazel b/ortools/gscip/BUILD.bazel index d9494838b3..1d3579d00c 100644 --- a/ortools/gscip/BUILD.bazel +++ b/ortools/gscip/BUILD.bazel @@ -11,7 +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//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:proto.bzl", "py_proto_library") package( diff --git a/ortools/linear_solver/BUILD.bazel b/ortools/linear_solver/BUILD.bazel index 618e1921a6..74f2a32945 100644 --- a/ortools/linear_solver/BUILD.bazel +++ b/ortools/linear_solver/BUILD.bazel @@ -13,8 +13,9 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@bazel_skylib//rules:copy_file.bzl", "copy_file") -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:proto.bzl", "py_proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/math_opt/solvers/BUILD.bazel b/ortools/math_opt/solvers/BUILD.bazel index 023e966a49..36b4a291d1 100644 --- a/ortools/math_opt/solvers/BUILD.bazel +++ b/ortools/math_opt/solvers/BUILD.bazel @@ -11,7 +11,8 @@ # 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//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") load("@rules_python//python:proto.bzl", "py_proto_library") package(default_visibility = ["//ortools/math_opt:__subpackages__"]) @@ -311,9 +312,9 @@ cc_test( cc_test( name = "cp_sat_solver_test", + timeout = "eternal", srcs = ["cp_sat_solver_test.cc"], shard_count = 10, - timeout = "eternal", deps = [ ":cp_sat_solver", "//ortools/base:gmock_main", @@ -660,10 +661,12 @@ py_proto_library( proto_library( name = "highs_proto", srcs = ["highs.proto"], + visibility = ["//visibility:public"], ) cc_proto_library( name = "highs_cc_proto", + visibility = ["//visibility:public"], deps = [":highs_proto"], ) diff --git a/ortools/scheduling/BUILD.bazel b/ortools/scheduling/BUILD.bazel index d2c0ef005d..3c961cff2b 100644 --- a/ortools/scheduling/BUILD.bazel +++ b/ortools/scheduling/BUILD.bazel @@ -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("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:proto.bzl", "py_proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/ortools/util/BUILD.bazel b/ortools/util/BUILD.bazel index 420738a84b..2baac1d127 100644 --- a/ortools/util/BUILD.bazel +++ b/ortools/util/BUILD.bazel @@ -11,7 +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//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:proto.bzl", "py_proto_library") package(default_visibility = ["//visibility:public"]) @@ -126,6 +128,12 @@ cc_library( name = "piecewise_linear_function", srcs = ["piecewise_linear_function.cc"], hdrs = ["piecewise_linear_function.h"], + copts = select({ + "on_linux": [], + "on_macos": [], + "on_windows": ["/Zc:preprocessor"], + "//conditions:default": [], + }), deps = [ ":saturated_arithmetic", "//ortools/base", diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel index 901dac9f92..9adce1f26c 100644 --- a/patches/BUILD.bazel +++ b/patches/BUILD.bazel @@ -13,11 +13,12 @@ exports_files([ "abseil-cpp-20240722.0.patch", - "highs.patch", + "highs-v1.8.0.patch", "protobuf-v26.1.patch", "protobuf-v28.3.patch", "pybind11_abseil.patch", "pybind11_bazel.patch", "pybind11_protobuf.patch", "pybind11.patch", + "scip-v900.patch", ])