sapling/exec
Kostia Balytskyi 4629e800fa hgmain: implement a binary entry point for Mercurial
Summary:
This crate compiles in a binary entry-point for Mercurial.
The way the binary works at first:
- dynamically link to the Python's shared library (Linux, Windows) or Python
  Framework (OSX)
- find the location of `hgexe.py` (this is what's currently known as `hg` and
  what serves as a shebang entrypoint on OSX and Linux today)
- call `Py_Main` with `hgexe.py` and the rest of the supplied arguments

A couple of decisions that someone might find controversial:
- all strings are expected to be correctly conversible to/from Rust String
- in particular, this means that we're limiting the command line arguments (and
  therefore the repo file names) to the valid Unicode strings. This is not much
  of a limitation on Windows, but it is on Linux.
- `build.rs` takes linker path hints from the environment, to be supplied by
  the `setup.py` later
- `hgexe.py` is expected to live either alongside the resulting binary or in
  the `libexec` dir, that is a sister to one of the binary's parents.

Reviewed By: quark-zju

Differential Revision: D9218066

fbshipit-source-id: ff6e01d06f118cd6bc1a20fbab6b5d17fe51b531
2018-08-17 10:51:47 -07:00
..
hgmain hgmain: implement a binary entry point for Mercurial 2018-08-17 10:51:47 -07:00
scm_daemon scmdaemon: use io::Write on osx 2018-07-30 11:36:51 -07:00