Using Rust in Mercurial

Gregory Szorc gregory.szorc at gmail.com
Tue Dec 5 19:00:41 UTC 2017


Mercurial Packagers,

We would like to start using Rust in Mercurial. A brain dump is at
https://www.mercurial-scm.org/wiki/OxidationPlan. The anticipated sequence
of events is likely something like:

1) Replace exewrapper.c/hg.exe with a Rust binary on Windows
2) Rewrite existing C Python extensions in Rust
3) Make `hg` a Rust binary (instead of a Python script) on all platforms.
This requires the Rust binary to link against libpython and embed a Python
interpreter.

There is no timeline for these milestones. But I'd like to do #1 in the 4.5
release if possible and #2 and #3 as soon as possible after that.

The Mercurial Project itself is interested in shipping a
self-contained/standalone Mercurial distribution. This would include its
own bundled version of Python, including the standard library.

When we start requiring Rust to use Mercurial, I anticipate that downstream
packagers will want to package an "unbundled" Mercurial - one that links
against the system libpython2.7 and uses the system Python's standard
library. This is totally fine and shouldn't be difficult to support.

My question to packagers is: what is your current level of support for a)
Rust b) embedding CPython? e.g. what is the minimum version of Rust we can
target? Do you support a shared libpython2.7.so or only a static
libpython2.7.a?

I'll likely capture replies on the aforementioned OxidationPlan wiki page.
If you want to just add relevant info there (anywhere is fine - I'll see
the wiki updates and refactor if needed), feel free to do that.

I want to emphasize that nothing is yet set in stone. But adding Rust to
Mercurial is something we would very much like to do and we would like to
have as many packagers on board as possible.

Gregory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-packaging/attachments/20171205/ef1bd930/attachment.html>


More information about the Mercurial-packaging mailing list