Mercurial > hg
comparison rust/README.rst @ 44114:8a3b045d9086
rust: move hgcli's README out of the way
My understanding is that it's not meant to be used in the current
form.
Differential Revision: https://phab.mercurial-scm.org/D7951
author | Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> |
---|---|
date | Mon, 20 Jan 2020 17:44:03 -0500 |
parents | 964212780daf |
children | e1b8b4e4f496 |
comparison
equal
deleted
inserted
replaced
44113:e77b57e09bfa | 44114:8a3b045d9086 |
---|---|
15 $ cargo build | 15 $ cargo build |
16 | 16 |
17 If you prefer a non-debug / release configuration:: | 17 If you prefer a non-debug / release configuration:: |
18 | 18 |
19 $ cargo build --release | 19 $ cargo build --release |
20 | |
21 Features | |
22 -------- | |
23 | |
24 The following Cargo features are available: | |
25 | |
26 localdev (default) | |
27 Produce files that work with an in-source-tree build. | |
28 | |
29 In this mode, the build finds and uses a ``python2.7`` binary from | |
30 ``PATH``. The ``hg`` binary assumes it runs from ``rust/target/<target>hg`` | |
31 and it finds Mercurial files at ``dirname($0)/../../../``. | |
32 | |
33 Build Mechanism | |
34 --------------- | |
35 | |
36 The produced ``hg`` binary is *bound* to a CPython installation. The | |
37 binary links against and loads a CPython library that is discovered | |
38 at build time (by a ``build.rs`` Cargo build script). The Python | |
39 standard library defined by this CPython installation is also used. | |
40 | |
41 Finding the appropriate CPython installation to use is done by | |
42 the ``python27-sys`` crate's ``build.rs``. Its search order is:: | |
43 | |
44 1. ``PYTHON_SYS_EXECUTABLE`` environment variable. | |
45 2. ``python`` executable on ``PATH`` | |
46 3. ``python2`` executable on ``PATH`` | |
47 4. ``python2.7`` executable on ``PATH`` | |
48 | |
49 Additional verification of the found Python will be performed by our | |
50 ``build.rs`` to ensure it meets Mercurial's requirements. | |
51 | |
52 Details about the build-time configured Python are built into the | |
53 produced ``hg`` binary. This means that a built ``hg`` binary is only | |
54 suitable for a specific, well-defined role. These roles are controlled | |
55 by Cargo features (see above). | |
56 | |
57 Running | |
58 ======= | |
59 | |
60 The ``hgcli`` crate produces an ``hg`` binary. You can run this binary | |
61 via ``cargo run``:: | |
62 | |
63 $ cargo run --manifest-path hgcli/Cargo.toml | |
64 | |
65 Or directly:: | |
66 | |
67 $ target/debug/hg | |
68 $ target/release/hg | |
69 | |
70 You can also run the test harness with this binary:: | |
71 | |
72 $ ./run-tests.py --with-hg ../rust/target/debug/hg | |
73 | |
74 .. note:: | |
75 | |
76 Integration with the test harness is still preliminary. Remember to | |
77 ``cargo build`` after changes because the test harness doesn't yet | |
78 automatically build Rust code. |