diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel index ec66b9e0f0..7ec0db8fa5 100644 --- a/patches/BUILD.bazel +++ b/patches/BUILD.bazel @@ -16,7 +16,6 @@ exports_files([ "highs-v1.8.1.patch", "protobuf-v29.1.patch", "pybind11_abseil.patch", - "pybind11_bazel.patch", "pybind11_protobuf.patch", "pybind11.patch", "scip-v920.patch", diff --git a/patches/pybind11_bazel.patch b/patches/pybind11_bazel.patch deleted file mode 100644 index c570bea7a5..0000000000 --- a/patches/pybind11_bazel.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/build_defs.bzl b/build_defs.bzl -index 503ce33..e233bb0 100644 ---- a/build_defs.bzl -+++ b/build_defs.bzl -@@ -5,8 +5,6 @@ - - """Build rules for pybind11.""" - --load("@bazel_skylib//rules:copy_file.bzl", "copy_file") -- - def register_extension_info(**kwargs): - pass - -@@ -42,12 +40,19 @@ def pybind_extension( - linkopts = [], - tags = [], - deps = [], -+ py_deps = [], -+ visibility = None, - **kwargs): - # Mark common dependencies as required for build_cleaner. - tags = tags + ["req_dep=%s" % dep for dep in PYBIND_DEPS] - - native.cc_binary( - name = name + ".so", -+ target_compatible_with = select({ -+ "@platforms//os:windows": ["@platforms//:incompatible"], -+ "//conditions:default": [], -+ }), -+ visibility = visibility, - copts = copts + PYBIND_COPTS + select({ - Label("@pybind11//:msvc_compiler"): [], - "//conditions:default": ["-fvisibility=hidden"], -@@ -64,19 +69,42 @@ def pybind_extension( - **kwargs - ) - -- copy_file( -- name = name + "_copy_so_to_pyd", -- src = name + ".so", -- out = name + ".pyd", -- testonly = kwargs.get("testonly") -+ native.cc_binary( -+ name = name + ".dll", -+ target_compatible_with = select({ -+ "@platforms//os:windows": [], -+ "//conditions:default": ["@platforms//:incompatible"], -+ }), -+ copts = copts + PYBIND_COPTS, -+ features = features + PYBIND_FEATURES, -+ linkopts = linkopts, -+ linkshared = 1, -+ tags = tags, -+ deps = deps + PYBIND_DEPS, -+ visibility = visibility, -+ **kwargs -+ ) -+ -+ native.genrule( -+ name = name + "_pyd", -+ target_compatible_with = select({ -+ "@platforms//os:windows": [], -+ "//conditions:default": ["@platforms//:incompatible"], -+ }), -+ srcs = [name + ".dll"], -+ outs = [name + ".pyd"], -+ cmd = "cp $< $@", -+ visibility = visibility, - ) - -- native.alias( -+ native.py_library( - name = name, -- actual = select({ -- "@platforms//os:windows": name + ".pyd", -- "//conditions:default": name + ".so", -+ data = select({ -+ "@platforms//os:windows": [":" + name + ".pyd"], -+ "//conditions:default": [":" + name + ".so"], - }), -+ deps = py_deps, -+ visibility = visibility, - ) - - # Builds a pybind11 compatible library. This can be linked to a pybind_extension.