koch.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>Nim maintenance script</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">Nim maintenance script</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <div class="search-groupby">
  49. Group by:
  50. <select onchange="groupBy(this.value)">
  51. <option value="section">Section</option>
  52. <option value="type">Type</option>
  53. </select>
  54. </div>
  55. <ul class="simple simple-toc" id="toc-list">
  56. <li><a class="reference" id="introduction_toc" href="#introduction">Introduction</a></li>
  57. <li><a class="reference" id="commands_toc" href="#commands">Commands</a></li>
  58. <ul class="simple"><li><a class="reference" id="commands-boot-command_toc" href="#commands-boot-command">boot command</a></li>
  59. <li><a class="reference" id="commands-csource-command_toc" href="#commands-csource-command">csource command</a></li>
  60. <li><a class="reference" id="commands-temp-command_toc" href="#commands-temp-command">temp command</a></li>
  61. <li><a class="reference" id="commands-test-command_toc" href="#commands-test-command">test command</a></li>
  62. <li><a class="reference" id="commands-web-command_toc" href="#commands-web-command">web command</a></li>
  63. <li><a class="reference" id="commands-pdf-command_toc" href="#commands-pdf-command">pdf command</a></li>
  64. </ul>
  65. </ul>
  66. </div>
  67. <div class="nine columns" id="content">
  68. <a href="https://github.com/nim-lang/Nim/tree/devel/doc/koch.md#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  69. <a href="https://github.com/nim-lang/Nim/edit/devel/doc/koch.md#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  70. <div id="tocRoot"></div>
  71. <p class="module-desc"><table class="docinfo" frame="void" rules="none"><col class="docinfo-name" /><col class="docinfo-content" /><tbody valign="top"><tr><th class="docinfo-name">Version:</th><td>2.3.1</td></tr>
  72. </tbody></table><blockquote class="markdown-quote"><p>&quot;A great chef is an artist that I truly respect&quot; -- Robert Stack.</p></blockquote>
  73. <h1><a class="toc-backref" id="introduction" href="#introduction">Introduction</a></h1><p>The <span id="koch_1">koch</span> program is Nim's maintenance script. It is a replacement for make and shell scripting with the advantage that it is much more portable. The word <em>koch</em> means <em>cook</em> in German. <tt class="docutils literal"><span class="pre"><span class="program">koch</span></span></tt> is used mainly to build the Nim compiler, but it can also be used for other tasks. This document describes the supported commands and their options.</p>
  74. <h1><a class="toc-backref" id="commands" href="#commands">Commands</a></h1>
  75. <h2><a class="toc-backref" id="commands-boot-command" href="#commands-boot-command">boot command</a></h2><p>The <span id="boot_1">boot</span> command bootstraps the compiler, and it accepts different options:</p>
  76. <div class="option-list"><div class="option-list-item odd"><div class="option-list-label"><tt><span class="option">-d:release</span></tt></div><div class="option-list-description">By default a debug version is created, passing this option will force a release build, which is much faster and should be preferred unless you are debugging the compiler.</div></div>
  77. <div class="option-list-item"><div class="option-list-label"><tt><span class="option">-d:nimUseLinenoise</span></tt></div><div class="option-list-description">Use the linenoise library for interactive mode (not needed on Windows).</div></div>
  78. <div class="option-list-item odd"><div class="option-list-label"><tt><span class="option">-d:leanCompiler</span></tt></div><div class="option-list-description">Produce a compiler without JS codegen or documentation generator in order to use less RAM for bootstrapping.</div></div>
  79. </div><p>After compilation is finished you will hopefully end up with the nim compiler in the <tt class="docutils literal"><span class="pre"><span class="Identifier">bin</span></span></tt> directory. You can add Nim's <tt class="docutils literal"><span class="pre"><span class="Identifier">bin</span></span></tt> directory to your <tt class="docutils literal"><span class="pre"><span class="Operator">$</span><span class="Identifier">PATH</span></span></tt> or use the install command to place it where it will be found.</p>
  80. <h2><a class="toc-backref" id="commands-csource-command" href="#commands-csource-command">csource command</a></h2><p>The <span id="csource_1">csource</span> command builds the C sources for installation. It accepts the same options as you would pass to the <a class="reference external" href=" #commands-boot-command">boot command</a>.</p>
  81. <h2><a class="toc-backref" id="commands-temp-command" href="#commands-temp-command">temp command</a></h2><p>The temp command builds the Nim compiler but with a different final name (<tt class="docutils literal"><span class="pre"><span class="program">nim_temp</span></span></tt>), so it doesn't overwrite your normal compiler. You can use this command to test different options, the same you would issue for the <a class="reference external" href="#commands-boot-command">boot command</a>.</p>
  82. <h2><a class="toc-backref" id="commands-test-command" href="#commands-test-command">test command</a></h2><p>The <span id="test_1">test</span> command can also be invoked with the alias <tt class="docutils literal"><span class="pre option">tests</span></tt>. This command will compile and run <tt class="docutils literal"><span class="pre">testament/tester.nim</span></tt>, which is the main driver of Nim's test suite. You can pass options to the <tt class="docutils literal"><span class="pre option">test</span></tt> command, they will be forwarded to the tester. See its source code for available options.</p>
  83. <h2><a class="toc-backref" id="commands-web-command" href="#commands-web-command">web command</a></h2><p>The <span id="web_1">web</span> command converts the documentation in the <tt class="docutils literal"><span class="pre"><span class="Identifier">doc</span></span></tt> directory from rst to HTML. It also repeats the same operation but places the result in the <tt class="docutils literal"><span class="pre">web/upload</span></tt> which can be used to update the website at <a class="reference external" href="https://nim-lang.org">https://nim-lang.org</a>.</p>
  84. <p>By default, the documentation will be built in parallel using the number of available CPU cores. If any documentation build sub-commands fail, they will be rerun in serial fashion so that meaningful error output can be gathered for inspection. The <tt class="docutils literal"><span class="pre option">--parallelBuild:n</span></tt> switch or configuration option can be used to force a specific number of parallel jobs or run everything serially from the start (<tt class="docutils literal"><span class="pre"><span class="Identifier">n</span> <span class="Operator">==</span> <span class="DecNumber">1</span></span></tt>).</p>
  85. <h2><a class="toc-backref" id="commands-pdf-command" href="#commands-pdf-command">pdf command</a></h2><p>The <span id="pdf_1">pdf</span> command builds PDF versions of Nim documentation: Manual, Tutorial and a few other documents. To run it one needs to <a class="reference external" href="https://www.latex-project.org/get">install Latex/xelatex</a> first. </p>
  86. </p>
  87. </div>
  88. </div>
  89. <div class="twelve-columns footer">
  90. <span class="nim-sprite"></span>
  91. <br>
  92. <small style="color: var(--hint);">Made with Nim. Generated: 2025-03-15 14:12:49 UTC</small>
  93. </div>
  94. </div>
  95. </div>
  96. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  97. </body>
  98. </html>