[GH-ISSUE #132] nanobind 3.0 fails with Clang targeting Windows: dllimport vectorcall aliases are not constant expressions #42

Open
opened 2026-10-26 22:19:35 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @contentis on GitHub (Aug 23, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/132

nanobind 3.0.0 fails to compile with Clang targeting the Windows/MSVC ABI. The failure occurs in the new vectorcall aliases:

inline constexpr ret (*name) args = ⌖

On Windows, PyObject_Vectorcall and PyObject_VectorcallMethod are imported functions. Clang does not consider their addresses constant expressions.

The MSVC-compiled CUDA extension succeeds; the same nanobind backend fails when compiled by ROCm Clang.

Pinning nanobind<3 resolves the build failure but is only a WAR that might get lost over time.

Originally created by @contentis on GitHub (Aug 23, 2026). Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/132 nanobind 3.0.0 fails to compile with Clang targeting the Windows/MSVC ABI. The failure occurs in the new vectorcall aliases: ```cpp inline constexpr ret (*name) args = &target; ``` On Windows, PyObject_Vectorcall and PyObject_VectorcallMethod are imported functions. Clang does not consider their addresses constant expressions. The MSVC-compiled CUDA extension succeeds; the same nanobind backend fails when compiled by ROCm Clang. Pinning nanobind<3 resolves the build failure but is only a WAR that might get lost over time.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-kitchen#42
No description provided.