Repository navigation
0.28.0: rules-python, Python bindings for C++23 modules - #72
Shinonome-Ryoko14 wants to merge 1 commit into
Conversation
d6ce23a to
58146c4
Compare
58146c4 to
3c41c24
Compare
Review: rules-python (0.28.0)CI is green (6/6) and this is a strong first slice: the two backends are cleanly separated, the source module stays untouched, reflection syntax stays out of the plugin source, and the fixtures cover ctypes, nanobind, reflection, a C++ consumer and the exception path. I recommend request changes before merge. Blocking
Important
Nits
I did not rerun the matrix locally; the six CI checks are green and this review is from the diff plus the engine and tool conventions. |
3c41c24 to
43ec744
Compare
|
Addressed all blocking, important, and nit items in
|
Re-review:
|
|
@Sunrisepeak 感谢建议,关于三层分层设计和对应的tradeoff我这边梳理了一套统一方案,麻烦跟我对齐一下标准,确认下是否按这个方向落地: 1. SDK 归属与开关(收口到
|
整体方向没有问题, 可能技术实现上 要深度分析 实现的策略 以及 问题 能不能通过设计 优雅的解决, 默认尽量减少开发者的负担,又能支持自定义的控制, 且有明确的优先级处理关系 |
Adds
mcpp.rules.python(features = ["rules-python"]), binding a C++23 module's surface to Python frombuild.mcppwithout modifying the C++ module source.Part of #71 (M1 slice:
mcpp.rules.pythoncore withctypes,nanobind, and explicit GCC 16reflectbackends).Summary
rules/python.cppm):binding::nanobind: generates theNB_MODULEtranslation unit overmcpplibs.mwrap.nanobind(published inmcpplibs/mcpp-indexas3.1.0), resolves the Python SDK (python_include_dir/ env overrides /xim:python/uv/ host), emits host link directives, stages<module><EXT_SUFFIX>, and optionally emits<module>.pyi. Supportsdiscovery::explicit_list,discovery::reflect(GCC 16 C++26 P2996-freflection), anddiscovery::manual.binding::ctypes: zero-Python-build-dependency path generating anextern "C"bridge and a typed.pywrapper beside the shared library so C++ and Python consumers share the same artifact.tests/all-rules-compile: exercises all pure renderers andvalidatepaths.tests/python-consumer: end-to-endctypesfixture with an unchanged C++ consumer (cpp-app) and Python round-trip checks on Linux, macOS, and Windows.tests/python-nanobind-consumer: end-to-end native CPython extension fixture (discovery::explicit_list) enabled on Linux, macOS, and Windows against publishedmcpplibs.mwrap.nanobind3.1.0.tests/python-reflect-consumer: end-to-end P2996 reflection fixture (discovery::reflect) enabled on Linux GCC 16.0.27.0->0.28.0(mcpp.toml,src/plugins.cppm).docs/13-rules-python.mdand updatesdocs/README.md,docs/00-engine-and-rules.md,docs/10-rules.md,README.md, andREADME.zh-CN.md.