##// END OF EJS Templates
rust: move hgcli's README out of the way...
Valentin Gatien-Baron -
r44573:8a3b045d default
parent child Browse files
Show More
@@ -17,62 +17,3 b' To build the Rust components::'
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.
@@ -1,23 +1,3 b''
1 ===================
2 Mercurial Rust Code
3 ===================
4
5 This directory contains various Rust code for the Mercurial project.
6
7 The top-level ``Cargo.toml`` file defines a workspace containing
8 all primary Mercurial crates.
9
10 Building
11 ========
12
13 To build the Rust components::
14
15 $ cargo build
16
17 If you prefer a non-debug / release configuration::
18
19 $ cargo build --release
20
21 Features
1 Features
22 --------
2 --------
23
3
General Comments 0
You need to be logged in to leave comments. Login now