Add PersistentMode class

This adds a Ninja-specific wrapper on top of the generic
PersistentService class. It provides ways to check that the
client and the server have a compatible build plan configuration,
to verify that the input .ninja files have not changed, and to
run a query on the server.

NOTE: PersistentMode does not work on Win32 due to technical
limitations of StdioRedirector that will be fixed in a future
CL!

Fuchsia-Topic: persistent-mode
Original-Change-Id: I997f8f6a35131bcb1cf47ed71b6bbab43417d726
Original-Change-Id: I5a2306c0e4147ca1c2123cff5072772eff6b348b
Original-Change-Id: I4dab1c319234b078895c1e0f02a89d6b2a8bdd88
Original-Change-Id: Iadf60f56d9217c7be0556f0d5b3b60eca98b05a6
Original-Change-Id: I9b71545c8188ed326e2b68254900cefa364d3ad9
Original-Change-Id: Id5a3fa7f2d7595a0091029996809a2049e940c63
Original-Change-Id: I97c658cc234e5f979aaa506246b4032893ba4fee
Original-Change-Id: Ic9514dcb946494f342b1ed1623c8ac2f5ec5f41f
Original-Change-Id: I9cba704c81426276536f4b85bcf7acb48e343ce3
Original-Change-Id: I955a30f0cd19572e30ef4b4054ec8122eeefc91e
Original-Change-Id: Ia9dea4e0d5c5cfdfa83e8fed237df886d51c3cee
Original-Change-Id: I8df3c2b5354f01162407cce3367ee3d404d87331
Original-Change-Id: I2535cb53e3f1b048d3fa245799515b909ec97392
Original-Change-Id: I71d08cfdc8e97007fc96ec32a9ef918302b6ee82
Change-Id: I1889c6ccfa8d8373aa74320d7dd2bb471ea06c18
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/github.com/ninja-build/ninja/+/981653
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: David Fang <fangism@google.com>
9 files changed
tree: a101c3b086ab8bb650fc675f1330e29e479de15a
  1. .github/
  2. doc/
  3. misc/
  4. src/
  5. windows/
  6. .clang-format
  7. .clang-tidy
  8. .editorconfig
  9. .gitignore
  10. appveyor.yml
  11. CMakeLists.txt
  12. configure.py
  13. CONTRIBUTING.md
  14. COPYING
  15. README.fuchsia
  16. README.md
  17. RELEASING.md
README.md

Ninja

Ninja is a small build system with a focus on speed. https://ninja-build.org/

See the manual or doc/manual.asciidoc included in the distribution for background and more details.

Binaries for Linux, Mac and Windows are available on GitHub. Run ./ninja -h for Ninja help.

Installation is not necessary because the only required file is the resulting ninja binary. However, to enable features like Bash completion and Emacs and Vim editing modes, some files in misc/ must be copied to appropriate locations.

If you're interested in making changes to Ninja, read CONTRIBUTING.md first.

Building Ninja itself

You can either build Ninja via the custom generator script written in Python or via CMake. For more details see the wiki.

Python

./configure.py --bootstrap

This will generate the ninja binary and a build.ninja file you can now use to build Ninja with itself.

CMake

cmake -Bbuild-cmake
cmake --build build-cmake

The ninja binary will now be inside the build-cmake directory (you can choose any other name you like).

To run the unit tests:

./build-cmake/ninja_test