In particular to explain how to build any of the rust. It's neither
obvious, nor easy to find out, nor easy to determine if you did it
right without some documentation.
My general feeling is that I'd like to deprecate HGWITHRUSTEXT.
We now have python setup.py --rust [build|install|etc] and the coincidental make local PURE=--rust (works because $PURE, while meant to be for --pure is inserted blindly at the right place in the setup.py command.
Maybe this is a good time to decide of a better make variable ? EXTENSION_TYPE ? COMPILE_OPTIONS ? BUILD_OPTIONS ?
It's obviously a good thing to have official instructions, thank you Valentin for raising the subject.
HGMODULEPOLICY is for runtime, it can be rust+c or rust+c-allow.
"deprecate" was a bit too strong. Actually I'd like to downgrade HGWITHRUSTEXT to be something that'll be useful to play with alternative ways of building the Rust extension(s). Example: if someone wants to experiment with PyO3.
I didn't mention setup.py --rust because the toplevel readme doesn't mention setup.py, so I don't really know if that's really how mercurial is intended to be built or an implementation detail.
Both Raphaël and I were saying the same thin, perhaps a bit partially.
Here's the whole picture:
This policy system is actuallly not specific to Rust, it's also in use with the C extensions, the major difference being that C extensions are built by default.
For example, if one does not build the C extensions and use HGMODULEPOLICY=c, that's a hard error. With HGMODULEPOLICY=allow, one gets a fallback to the pure implementation.
Same with Rust: rust+c gives a hard error is Rust isn't built, while rust+c-allow fallbacks to C extensions only