koch.rst 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. -d:leanCompiler Produce a compiler without JS codegen or
  31. documentation generator in order to use less RAM
  32. for bootstrapping.
  33. After compilation is finished you will hopefully end up with the nim
  34. compiler in the `bin` directory. You can add Nim's `bin` directory to
  35. your `$PATH` or use the install command to place it where it will be
  36. found.
  37. csource command
  38. ---------------
  39. The `csource`:idx: command builds the C sources for installation. It accepts
  40. the same options as you would pass to the `boot command
  41. <#commands-boot-command>`_.
  42. temp command
  43. ------------
  44. The temp command builds the Nim compiler but with a different final name
  45. (`nim_temp`:cmd:), so it doesn't overwrite your normal compiler. You can use
  46. this command to test different options, the same you would issue for the `boot
  47. command <#commands-boot-command>`_.
  48. test command
  49. ------------
  50. The `test`:idx: command can also be invoked with the alias `tests`:option:. This
  51. command will compile and run ``testament/tester.nim``, which is the main
  52. driver of Nim's test suite. You can pass options to the `test`:option: command,
  53. they will be forwarded to the tester. See its source code for available
  54. options.
  55. web command
  56. -----------
  57. The `web`:idx: command converts the documentation in the `doc` directory
  58. from rst to HTML. It also repeats the same operation but places the result in
  59. the ``web/upload`` which can be used to update the website at
  60. https://nim-lang.org.
  61. By default, the documentation will be built in parallel using the number of
  62. available CPU cores. If any documentation build sub-commands fail, they will
  63. be rerun in serial fashion so that meaningful error output can be gathered for
  64. inspection. The `--parallelBuild:n`:option: switch or configuration option can be
  65. used to force a specific number of parallel jobs or run everything serially
  66. from the start (`n == 1`).
  67. pdf command
  68. -----------
  69. The `pdf`:idx: command builds PDF versions of Nim documentation: Manual,
  70. Tutorial and a few other documents. To run it one needs to
  71. `install Latex/xelatex <https://www.latex-project.org/get>`_ first.