Skip to content

Try fixing dynamic library .pyd support for windows#501

Closed
Mizux wants to merge 3 commits into
bazelbuild:mainfrom
Mizux:mizux/pyd
Closed

Try fixing dynamic library .pyd support for windows#501
Mizux wants to merge 3 commits into
bazelbuild:mainfrom
Mizux:mizux/pyd

Conversation

@Mizux

@Mizux Mizux commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

On windows .pyd is used as extension for python native module.

Currently pybind11_bazel struggle to provide a consistent support on windows since bazel (i.e. rules_cc) do not support .pyd as a shared dynamic library extension...

This is a first draft to move in the correct direction to fix:

EDIT: may be blocked by bazelbuild/bazel#17117

Mizux added a commit to Mizux/bazel that referenced this pull request Oct 28, 2025
Mizux added a commit to Mizux/bazel that referenced this pull request Oct 28, 2025
@Mizux

Mizux commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

note these fixes are nearly impossible to test because all code path are disable until bazel 9.0 is out

rules_cc/MODULE.bazel

Lines 12 to 13 in 22c49c3

cc_configure = use_extension("//cc:extensions.bzl", "cc_configure_extension")
use_repo(cc_configure, "local_config_cc", "local_config_cc_toolchains")

def _compatibility_proxy_repo_impl(rctx):
if _bazel_version_ge("9.0.0-pre.20250911"):

so in // try to fix current bazel's native rules too here:

copybara-service Bot pushed a commit that referenced this pull request Oct 31, 2025
* should address the example listed in #17117
* related to #501
* needed to fix pybind/pybind11_bazel#124

Closes #27434.

PiperOrigin-RevId: 826451549
Change-Id: Ib649bb2e38e057a1a4de6b660f41d4dd13192e06
copybara-service Bot pushed a commit to bazelbuild/bazel that referenced this pull request Oct 31, 2025
* should address the example listed in #17117
* related to bazelbuild/rules_cc#501
* needed to fix pybind/pybind11_bazel#124

Closes #27434.

PiperOrigin-RevId: 826451549
Change-Id: I79872e654fdc7c73a5e05f3befdc734bd82c4f07
@Mizux

Mizux commented Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

has been merged as 5a09443

@Mizux Mizux closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant