koch.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ===============================
  2. Nim maintenance script
  3. ===============================
  4. :Version: |nimversion|
  5. .. contents::
  6. .. raw:: html
  7. <blockquote><p>
  8. "A great chef is an artist that I truly respect" -- Robert Stack.
  9. </p></blockquote>
  10. Introduction
  11. ============
  12. The `koch`:idx: program is Nim's maintenance script. It is a replacement
  13. for make and shell scripting with the advantage that it is much more portable.
  14. The word *koch* means *cook* in German. ``koch`` is used mainly to build the
  15. Nim compiler, but it can also be used for other tasks. This document
  16. describes the supported commands and their options.
  17. Commands
  18. ========
  19. boot command
  20. ------------
  21. The `boot`:idx: command bootstraps the compiler, and it accepts different
  22. options:
  23. -d:release
  24. By default a debug version is created, passing this option will
  25. force a release build, which is much faster and should be preferred
  26. unless you are debugging the compiler.
  27. -d:useLinenoise
  28. Use the linenoise library for interactive mode (not needed on Windows).
  29. After compilation is finished you will hopefully end up with the nim
  30. compiler in the ``bin`` directory. You can add Nim's ``bin`` directory to
  31. your ``$PATH`` or use the `install command`_ to place it where it will be
  32. found.
  33. csource command
  34. ---------------
  35. The `csource`:idx: command builds the C sources for installation. It accepts
  36. the same options as you would pass to the `boot command`_.
  37. temp command
  38. ------------
  39. The temp command builds the Nim compiler but with a different final name
  40. (``nim_temp``), so it doesn't overwrite your normal compiler. You can use
  41. this command to test different options, the same you would issue for the `boot
  42. command`_.
  43. test command
  44. ------------
  45. The `test`:idx: command can also be invoked with the alias ``tests``. This
  46. command will compile and run ``testament/tester.nim``, which is the main
  47. driver of Nim's test suite. You can pass options to the ``test`` command,
  48. they will be forwarded to the tester. See its source code for available
  49. options.
  50. web command
  51. -----------
  52. The `web`:idx: command converts the documentation in the ``doc`` directory
  53. from rst to HTML. It also repeats the same operation but places the result in
  54. the ``web/upload`` which can be used to update the website at
  55. https://nim-lang.org.
  56. By default the documentation will be built in parallel using the number of
  57. available CPU cores. If any documentation build sub commands fail, they will
  58. be rerun in serial fashion so that meaninful error output can be gathered for
  59. inspection. The ``--parallelBuild:n`` switch or configuration option can be
  60. used to force a specific number of parallel jobs or run everything serially
  61. from the start (``n == 1``).