koch.rst 3.0 KB

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