Details
- Reviewers
quark durham - Group Reviewers
Restricted Project - Commits
- rFBHGXb77a9dc92b31: distutils_rust: add distutils extension to compile Rust extension modules
Diff Detail
- Repository
- rFBHGX Facebook Mercurial Extensions
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Maybe also add from __future__ import absolute_import stuff. But otherwise looks pretty good to me.
distutils_rust/__init__.py | ||
---|---|---|
56 | Should this be None or False? |
Cool series! I was curious what your plans are to support Windows. That's the part that has been tripping me up in my quest to integrate Rust into the core Mercurial project. Keep in mind that official distributions of Python 2.7 are compiled with MSVC 2008 and link against its CRT. So there are CRT implications depending on how the Rust code is built.
Also, what about PyPy and other non-CPython distributions? Is it necessary to use Python extensions (as opposed to ctypes or cffi) for performance?
From my experience, it's not only about performance but also code cleanness. I tried the C API + Cython (could replace Cython with cffi) approach. Error handling is much less pleasant (Rust Err -> C special return value -> Python exception) than just implementing Into<PyErr>.
The plan is to support Windows with the caveat that compatibly compiled Python interpreter is used. It's fairly commonplace on the Windows platform to ship programs with their interpreter precompiled alongside the source, so we're expecting that to be acceptable for Windows users. We don't have any details yet, however.
Also, we ship our windows version of Mercurial with a Python 2.7 that has been built against MSVC 2015. Not sure if that helps.
Should this be None or False?