koch.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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:nimUseLinenoise
  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. <#commands-boot-command>`_.
  38. temp command
  39. ------------
  40. The temp command builds the Nim compiler but with a different final name
  41. (``nim_temp``), so it doesn't overwrite your normal compiler. You can use
  42. this command to test different options, the same you would issue for the `boot
  43. command <#commands-boot-command>`_.
  44. test command
  45. ------------
  46. The `test`:idx: command can also be invoked with the alias ``tests``. This
  47. command will compile and run ``testament/tester.nim``, which is the main
  48. driver of Nim's test suite. You can pass options to the ``test`` command,
  49. they will be forwarded to the tester. See its source code for available
  50. options.
  51. web command
  52. -----------
  53. The `web`:idx: command converts the documentation in the ``doc`` directory
  54. from rst to HTML. It also repeats the same operation but places the result in
  55. the ``web/upload`` which can be used to update the website at
  56. https://nim-lang.org.
  57. By default the documentation will be built in parallel using the number of
  58. available CPU cores. If any documentation build sub commands fail, they will
  59. be rerun in serial fashion so that meaningful error output can be gathered for
  60. inspection. The ``--parallelBuild:n`` switch or configuration option can be
  61. used to force a specific number of parallel jobs or run everything serially
  62. from the start (``n == 1``).