This instance will be upgraded to Heptapod 0.23.2 on 2021-08-05 at 11:00 UTC+2 (a few minutes of down time)

Commit a6e31ad0 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

INSTALL_HEPTAPOD: Mercurial with Rust code

From now on, we'll be using two pip requirement files.

The options to disable Rust in Heptapod Rails and Heptapod Shell
are not yet available at this point (see #386)

--HG--
branch : heptapod
parent 2f318d0250a6
......@@ -94,6 +94,9 @@ dependencies, it's very unlikely it'll clash with system libraries) or with
`pip install --user` or in a virtualenv. What matters for proper operation is
that they are all importable from the final Mercurial executable.
Note: if you're interested in using Mercurial enhanced with Rust,
you have to preinstall it (see next section about that)
Install the Python packages to be taken from pypi.org using the
[requirements file](python/requirements.txt):
......@@ -104,6 +107,70 @@ $PIP install -U -r python/requirements.txt
where `$PIP` is `pip --user` or `some/virtualenv/bin/pip` according to your
choice.
#### Variant: Mercurial enhanced with Rust
This provides some serious performances boosts, some of them activated by
boolean flags that can be set, e.g., in the global HGRC file.
The Mercurial source distribution includes the Rust code,
but `pip` won't compile it by default.
Here are the steps do to that:
- prerequisite: Rust toolchain (cargo, rustc), version ≥ 1.41.1 as of
Mercurial 5.6. The general policy of Mercurial is to depend on the version
available in Debian stable at the time of the Mercurial release.
- use the requirements file intended for Rust instead of the standard one:
```
$PIP install -r python/requirements-rust.txt
```
- check: `/path/to/just/installed/hg debuginstall`. Here's an excerpt of
the expected output:
```
checking Python security support (sni,tls1.0,tls1.1,tls1.2)
checking Rust extensions (installed)
checking Mercurial version (5.6.1)
checking Mercurial custom build ()
checking module policy (rust+c)
```
"module policy" is the configuration for the runtime usage of native Python
modules:
- `rust+c`: use both Python modules written in C and Rust – fail if they
are missing. This is the default configuration for Mercurial compiled with
Rust.
- `c`: use only Python modules written in C – fail if they are missing.
This is the default configuration for the default compilation of Mercurial
(C modules, no Rust).
#### Disabling the Rust parts of Mercurial at run time
The Rust parts of Mercurial are still considered experimental.
In some cases, you may want to disable them. This could be for bug
investigation or simply to use a single build script for
installations with different policies.
The resulting Mercurial runs the Rust code by default, but this can be
disabled at runtime.
1. Run the internal Mercurial HTTP service, and in HGitaly with the
following environment variable:
```
HGMODULEPOLICY=c
```
2. In the `mercurial` section of the Heptapod Shell *and* Heptapod Rails
configuration files, add this:
```
mercurial:
module_policy: c
```
### Configuration
You need to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment