Fossil

Hex Artifact Content
Login

Artifact aa1a7bb3aba90d8412ac2e19e7f308581684b000ba711b277a51dcdb4f550a35:


0000: 3c 74 69 74 6c 65 3e 43 6f 6d 70 69 6c 69 6e 67  <title>Compiling
0010: 20 61 6e 64 20 49 6e 73 74 61 6c 6c 69 6e 67 20   and Installing 
0020: 46 6f 73 73 69 6c 3c 2f 74 69 74 6c 65 3e 0a 0a  Fossil</title>..
0030: 3c 68 32 3e 30 2e 30 20 55 73 69 6e 67 20 41 20  <h2>0.0 Using A 
0040: 50 72 65 2d 63 6f 6d 70 69 6c 65 64 20 42 69 6e  Pre-compiled Bin
0050: 61 72 79 3c 2f 68 32 3e 0a 0a 3c 70 3e 5b 2f 75  ary</h2>..<p>[/u
0060: 76 2f 64 6f 77 6e 6c 6f 61 64 2e 68 74 6d 6c 7c  v/download.html|
0070: 50 72 65 2d 63 6f 6d 70 69 6c 65 64 20 62 69 6e  Pre-compiled bin
0080: 61 72 69 65 73 5d 20 61 72 65 20 61 76 61 69 6c  aries] are avail
0090: 61 62 6c 65 20 66 6f 72 20 72 65 63 65 6e 74 0a  able for recent.
00a0: 72 65 6c 65 61 73 65 73 2e 20 4a 75 73 74 20 64  releases. Just d
00b0: 6f 77 6e 6c 6f 61 64 0a 74 68 65 20 61 70 70 72  ownload.the appr
00c0: 6f 70 72 69 61 74 65 20 65 78 65 63 75 74 61 62  opriate executab
00d0: 6c 65 20 66 6f 72 20 79 6f 75 72 20 70 6c 61 74  le for your plat
00e0: 66 6f 72 6d 0a 61 6e 64 20 70 75 74 20 69 74 20  form.and put it 
00f0: 6f 6e 20 79 6f 75 72 20 24 50 41 54 48 2e 0a 54  on your $PATH..T
0100: 6f 20 75 6e 69 6e 73 74 61 6c 6c 2c 20 73 69 6d  o uninstall, sim
0110: 70 6c 79 20 64 65 6c 65 74 65 20 74 68 65 20 65  ply delete the e
0120: 78 65 63 75 74 61 62 6c 65 2e 0a 54 6f 20 75 70  xecutable..To up
0130: 67 72 61 64 65 20 66 72 6f 6d 20 61 6e 20 6f 6c  grade from an ol
0140: 64 65 72 20 72 65 6c 65 61 73 65 2c 20 6a 75 73  der release, jus
0150: 74 20 6f 76 65 72 77 72 69 74 65 20 74 68 65 20  t overwrite the 
0160: 6f 6c 64 65 72 20 62 69 6e 61 72 79 20 77 69 74  older binary wit
0170: 68 0a 74 68 65 20 6e 65 77 65 72 20 6f 6e 65 2e  h.the newer one.
0180: 3c 2f 70 3e 0a 0a 3c 70 3e 46 6f 72 20 64 65 74  </p>..<p>For det
0190: 61 69 6c 73 20 61 62 6f 75 74 20 68 6f 77 20 74  ails about how t
01a0: 68 6f 73 65 20 62 69 6e 61 72 69 65 73 20 61 72  hose binaries ar
01b0: 65 20 62 75 69 6c 74 2c 20 73 65 65 0a 5b 2f 77  e built, see.[/w
01c0: 69 6b 69 3f 6e 61 6d 65 3d 52 65 6c 65 61 73 65  iki?name=Release
01d0: 2b 42 75 69 6c 64 2b 48 6f 77 2d 54 6f 20 7c 20  +Build+How-To | 
01e0: 74 68 65 20 52 65 6c 65 61 73 65 20 42 75 69 6c  the Release Buil
01f0: 64 20 48 6f 77 2d 54 6f 20 77 69 6b 69 20 70 61  d How-To wiki pa
0200: 67 65 5d 2e 3c 2f 70 3e 0a 0a 0a 3c 68 32 3e 30  ge].</p>...<h2>0
0210: 2e 31 20 45 78 65 63 75 74 69 76 65 20 53 75 6d  .1 Executive Sum
0220: 6d 61 72 79 3c 2f 68 32 3e 0a 0a 3c 70 3e 42 75  mary</h2>..<p>Bu
0230: 69 6c 64 69 6e 67 20 61 6e 64 20 69 6e 73 74 61  ilding and insta
0240: 6c 6c 69 6e 67 20 69 73 20 76 65 72 79 20 73 69  lling is very si
0250: 6d 70 6c 65 2e 20 20 54 68 72 65 65 20 73 74 65  mple.  Three ste
0260: 70 73 3a 3c 2f 70 3e 0a 0a 3c 6f 6c 3e 0a 3c 6c  ps:</p>..<ol>.<l
0270: 69 3e 20 44 6f 77 6e 6c 6f 61 64 20 61 6e 64 20  i> Download and 
0280: 75 6e 70 61 63 6b 20 61 20 73 6f 75 72 63 65 20  unpack a source 
0290: 74 61 72 62 61 6c 6c 20 6f 72 20 5a 49 50 2e 0a  tarball or ZIP..
02a0: 3c 6c 69 3e 20 3c 62 3e 2e 2f 63 6f 6e 66 69 67  <li> <b>./config
02b0: 75 72 65 3b 20 6d 61 6b 65 3c 2f 62 3e 0a 3c 6c  ure; make</b>.<l
02c0: 69 3e 20 4d 6f 76 65 20 74 68 65 20 72 65 73 75  i> Move the resu
02d0: 6c 74 69 6e 67 20 22 66 6f 73 73 69 6c 22 20 6f  lting "fossil" o
02e0: 72 20 22 66 6f 73 73 69 6c 2e 65 78 65 22 20 65  r "fossil.exe" e
02f0: 78 65 63 75 74 61 62 6c 65 20 74 6f 20 73 6f 6d  xecutable to som
0300: 65 70 6c 61 63 65 20 6f 6e 0a 79 6f 75 72 20 24  eplace on.your $
0310: 50 41 54 48 2e 0a 3c 2f 6f 6c 3e 0a 0a 3c 70 3e  PATH..</ol>..<p>
0320: 3c 68 72 3e 0a 0a 3c 68 32 3e 31 2e 30 20 4f 62  <hr>..<h2>1.0 Ob
0330: 74 61 69 6e 69 6e 67 20 54 68 65 20 53 6f 75 72  taining The Sour
0340: 63 65 20 43 6f 64 65 3c 2f 68 32 3e 0a 0a 3c 70  ce Code</h2>..<p
0350: 3e 46 6f 73 73 69 6c 20 69 73 20 73 65 6c 66 2d  >Fossil is self-
0360: 68 6f 73 74 69 6e 67 2c 20 73 6f 20 79 6f 75 20  hosting, so you 
0370: 63 61 6e 20 6f 62 74 61 69 6e 20 61 20 5a 49 50  can obtain a ZIP
0380: 20 61 72 63 68 69 76 65 20 6f 72 20 74 61 72 62   archive or tarb
0390: 61 6c 6c 0a 63 6f 6e 74 61 69 6e 69 6e 67 20 61  all.containing a
03a0: 20 73 6e 61 70 73 68 6f 74 20 6f 66 20 74 68 65   snapshot of the
03b0: 20 3c 65 6d 3e 6c 61 74 65 73 74 3c 2f 65 6d 3e   <em>latest</em>
03c0: 20 76 65 72 73 69 6f 6e 20 64 69 72 65 63 74 6c   version directl
03d0: 79 20 66 72 6f 6d 0a 46 6f 73 73 69 6c 27 73 20  y from.Fossil's 
03e0: 6f 77 6e 20 66 6f 73 73 69 6c 20 72 65 70 6f 73  own fossil repos
03f0: 69 74 6f 72 79 2e 20 41 64 64 69 74 69 6f 6e 61  itory. Additiona
0400: 6c 6c 79 2c 20 73 6f 75 72 63 65 20 61 72 63 68  lly, source arch
0410: 69 76 65 73 20 6f 66 0a 3c 65 6d 3e 72 65 6c 65  ives of.<em>rele
0420: 61 73 65 64 3c 2f 65 6d 3e 20 76 65 72 73 69 6f  ased</em> versio
0430: 6e 73 20 6f 66 0a 66 6f 73 73 69 6c 20 61 72 65  ns of.fossil are
0440: 20 61 76 61 69 6c 61 62 6c 65 20 66 72 6f 6d 20   available from 
0450: 74 68 65 20 5b 2f 75 76 2f 64 6f 77 6e 6c 6f 61  the [/uv/downloa
0460: 64 2e 68 74 6d 6c 7c 64 6f 77 6e 6c 6f 61 64 73  d.html|downloads
0470: 20 70 61 67 65 5d 2e 0a 54 6f 20 6f 62 74 61 69   page]..To obtai
0480: 6e 20 61 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20  n a development 
0490: 76 65 72 73 69 6f 6e 20 6f 66 20 66 6f 73 73 69  version of fossi
04a0: 6c 2c 20 66 6f 6c 6c 6f 77 20 74 68 65 73 65 20  l, follow these 
04b0: 73 74 65 70 73 3a 3c 2f 70 3e 0a 0a 3c 6f 6c 3e  steps:</p>..<ol>
04c0: 0a 3c 6c 69 3e 3c 70 3e 50 6f 69 6e 74 20 79 6f  .<li><p>Point yo
04d0: 75 72 20 77 65 62 20 62 72 6f 77 73 65 72 20 74  ur web browser t
04e0: 6f 20 5b 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69  o [https://fossi
04f0: 6c 2d 73 63 6d 2e 6f 72 67 2f 5d 3c 2f 6c 69 3e  l-scm.org/]</li>
0500: 0a 0a 3c 6c 69 3e 3c 70 3e 43 6c 69 63 6b 20 6f  ..<li><p>Click o
0510: 6e 20 74 68 65 20 5b 2f 74 69 6d 65 6c 69 6e 65  n the [/timeline
0520: 7c 54 69 6d 65 6c 69 6e 65 5d 0a 6c 69 6e 6b 20  |Timeline].link 
0530: 61 74 20 74 68 65 20 74 6f 70 20 6f 66 20 74 68  at the top of th
0540: 65 20 70 61 67 65 2e 3c 2f 70 3e 3c 2f 6c 69 3e  e page.</p></li>
0550: 0a 0a 3c 6c 69 3e 3c 70 3e 53 65 6c 65 63 74 20  ..<li><p>Select 
0560: 61 20 76 65 72 73 69 6f 6e 20 6f 66 20 6f 66 20  a version of of 
0570: 46 6f 73 73 69 6c 20 79 6f 75 20 77 61 6e 74 20  Fossil you want 
0580: 74 6f 20 64 6f 77 6e 6c 6f 61 64 2e 20 20 54 68  to download.  Th
0590: 65 20 6c 61 74 65 73 74 0a 76 65 72 73 69 6f 6e  e latest.version
05a0: 20 6f 6e 20 74 68 65 20 74 72 75 6e 6b 20 62 72   on the trunk br
05b0: 61 6e 63 68 20 69 73 20 75 73 75 61 6c 6c 79 20  anch is usually 
05c0: 61 20 67 6f 6f 64 20 63 68 6f 69 63 65 2e 20 20  a good choice.  
05d0: 43 6c 69 63 6b 20 6f 6e 20 69 74 73 0a 6c 69 6e  Click on its.lin
05e0: 6b 2e 3c 2f 70 3e 3c 2f 6c 69 3e 0a 0a 3c 6c 69  k.</p></li>..<li
05f0: 3e 3c 70 3e 46 69 6e 61 6c 6c 79 2c 20 63 6c 69  ><p>Finally, cli
0600: 63 6b 20 6f 6e 20 6f 6e 65 20 6f 66 20 74 68 65  ck on one of the
0610: 0a 22 5a 69 70 20 41 72 63 68 69 76 65 22 20 6f  ."Zip Archive" o
0620: 72 20 22 54 61 72 62 61 6c 6c 22 20 6c 69 6e 6b  r "Tarball" link
0630: 73 2c 20 61 63 63 6f 72 64 69 6e 67 20 74 6f 20  s, according to 
0640: 79 6f 75 72 20 70 72 65 66 65 72 65 6e 63 65 2e  your preference.
0650: 0a 54 68 65 73 65 20 6c 69 6e 6b 20 77 69 6c 6c  .These link will
0660: 20 62 75 69 6c 64 20 61 20 5a 49 50 20 61 72 63   build a ZIP arc
0670: 68 69 76 65 20 6f 72 20 61 20 67 7a 69 70 2d 63  hive or a gzip-c
0680: 6f 6d 70 72 65 73 73 65 64 20 74 61 72 62 61 6c  ompressed tarbal
0690: 6c 20 6f 66 20 74 68 65 0a 63 6f 6d 70 6c 65 74  l of the.complet
06a0: 65 20 73 6f 75 72 63 65 20 63 6f 64 65 20 61 6e  e source code an
06b0: 64 20 64 6f 77 6e 6c 6f 61 64 20 69 74 20 74 6f  d download it to
06c0: 20 79 6f 75 72 20 63 6f 6d 70 75 74 65 72 2e 0a   your computer..
06d0: 3c 2f 6f 6c 3e 0a 0a 3c 68 32 3e 41 73 69 64 65  </ol>..<h2>Aside
06e0: 3a 20 49 73 20 69 74 20 72 65 61 6c 6c 79 20 73  : Is it really s
06f0: 61 66 65 20 74 6f 20 75 73 65 20 61 6e 20 75 6e  afe to use an un
0700: 72 65 6c 65 61 73 65 64 20 64 65 76 65 6c 6f 70  released develop
0710: 6d 65 6e 74 20 76 65 72 73 69 6f 6e 20 6f 66 0a  ment version of.
0720: 74 68 65 20 46 6f 73 73 69 6c 20 73 6f 75 72 63  the Fossil sourc
0730: 65 20 63 6f 64 65 3f 3c 2f 68 32 3e 0a 0a 59 65  e code?</h2>..Ye
0740: 73 21 20 20 41 6e 79 20 63 68 65 63 6b 2d 69 6e  s!  Any check-in
0750: 20 6f 6e 20 74 68 65 0a 5b 2f 74 69 6d 65 6c 69   on the.[/timeli
0760: 6e 65 3f 74 3d 74 72 75 6e 6b 20 7c 20 74 72 75  ne?t=trunk | tru
0770: 6e 6b 20 62 72 61 6e 63 68 5d 20 6f 66 20 74 68  nk branch] of th
0780: 65 20 46 6f 73 73 69 6c 0a 5b 68 74 74 70 3a 2f  e Fossil.[http:/
0790: 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f  /fossil-scm.org/
07a0: 68 6f 6d 65 2f 74 69 6d 65 6c 69 6e 65 20 7c 20  home/timeline | 
07b0: 46 6f 73 73 69 6c 20 73 65 6c 66 2d 68 6f 73 74  Fossil self-host
07c0: 69 6e 67 20 72 65 70 6f 73 69 74 6f 72 79 5d 0a  ing repository].
07d0: 77 69 6c 6c 20 77 6f 72 6b 20 66 69 6e 65 2e 20  will work fine. 
07e0: 20 28 44 6f 64 67 79 20 63 6f 64 65 20 69 73 20   (Dodgy code is 
07f0: 61 6c 77 61 79 73 20 6f 6e 20 61 20 62 72 61 6e  always on a bran
0800: 63 68 2e 29 20 20 49 6e 20 74 68 65 20 75 6e 6c  ch.)  In the unl
0810: 69 6b 65 6c 79 0a 65 76 65 6e 74 20 74 68 61 74  ikely.event that
0820: 20 79 6f 75 20 70 69 63 6b 20 61 20 76 65 72 73   you pick a vers
0830: 69 6f 6e 20 77 69 74 68 20 61 20 73 65 72 69 6f  ion with a serio
0840: 75 73 20 62 75 67 2c 20 69 74 20 73 74 69 6c 6c  us bug, it still
0850: 20 77 6f 6e 27 74 0a 63 6c 6f 62 62 65 72 20 79   won't.clobber y
0860: 6f 75 72 20 66 69 6c 65 73 2e 20 20 46 6f 73 73  our files.  Foss
0870: 69 6c 20 75 73 65 73 20 73 65 76 65 72 61 6c 0a  il uses several.
0880: 5b 2e 2f 73 65 6c 66 63 68 65 63 6b 2e 77 69 6b  [./selfcheck.wik
0890: 69 20 7c 20 73 65 6c 66 2d 63 68 65 63 6b 73 5d  i | self-checks]
08a0: 20 70 72 69 6f 72 20 74 6f 20 63 6f 6d 6d 69 74   prior to commit
08b0: 74 69 6e 67 20 61 6e 79 0a 72 65 70 6f 73 69 74  ting any.reposit
08c0: 6f 72 79 20 63 68 61 6e 67 65 20 74 68 61 74 20  ory change that 
08d0: 70 72 65 76 65 6e 74 20 6c 6f 73 73 2d 6f 66 2d  prevent loss-of-
08e0: 77 6f 72 6b 20 64 75 65 20 74 6f 20 62 75 67 73  work due to bugs
08f0: 2e 0a 0a 54 68 65 20 46 6f 73 73 69 6c 20 5b 2e  ...The Fossil [.
0900: 2f 73 65 6c 66 68 6f 73 74 2e 77 69 6b 69 20 7c  /selfhost.wiki |
0910: 20 73 65 6c 66 2d 68 6f 73 74 69 6e 67 20 72 65   self-hosting re
0920: 70 6f 73 69 74 6f 72 69 65 73 5d 2c 20 65 73 70  positories], esp
0930: 65 63 69 61 6c 6c 79 0a 74 68 65 20 6f 6e 65 20  ecially.the one 
0940: 61 74 20 5b 68 74 74 70 3a 2f 2f 66 6f 73 73 69  at [http://fossi
0950: 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 5d 2c  l-scm.org/home],
0960: 20 75 73 75 61 6c 6c 79 20 72 75 6e 20 61 20 76   usually run a v
0970: 65 72 73 69 6f 6e 0a 6f 66 20 74 72 75 6e 6b 20  ersion.of trunk 
0980: 74 68 61 74 20 69 73 20 6c 65 73 73 20 74 68 61  that is less tha
0990: 6e 20 61 20 77 65 65 6b 20 6f 72 20 74 77 6f 20  n a week or two 
09a0: 6f 6c 64 2e 20 20 4c 6f 6f 6b 20 61 74 20 74 68  old.  Look at th
09b0: 65 20 62 6f 74 74 6f 6d 0a 6c 65 66 74 2d 68 61  e bottom.left-ha
09c0: 6e 64 20 63 6f 72 6e 65 72 20 6f 66 20 74 68 69  nd corner of thi
09d0: 73 20 73 63 72 65 65 6e 20 28 74 6f 20 74 68 65  s screen (to the
09e0: 20 72 69 67 68 74 20 6f 66 20 22 54 68 69 73 20   right of "This 
09f0: 70 61 67 65 20 77 61 73 0a 67 65 6e 65 72 61 74  page was.generat
0a00: 65 64 20 69 6e 2e 2e 2e 22 29 20 74 6f 20 73 65  ed in...") to se
0a10: 65 20 65 78 61 63 74 6c 79 20 77 68 69 63 68 20  e exactly which 
0a20: 76 65 72 73 69 6f 6e 20 6f 66 20 46 6f 73 73 69  version of Fossi
0a30: 6c 20 69 73 0a 72 65 6e 64 65 72 69 6e 67 20 74  l is.rendering t
0a40: 68 69 73 20 70 61 67 65 2e 20 20 49 74 20 69 73  his page.  It is
0a50: 20 61 6c 77 61 79 73 20 73 61 66 65 20 74 6f 20   always safe to 
0a60: 75 73 65 20 77 68 61 74 65 76 65 72 20 76 65 72  use whatever ver
0a70: 73 69 6f 6e 0a 6f 66 20 74 68 65 20 46 6f 73 73  sion.of the Foss
0a80: 69 6c 20 63 6f 64 65 20 79 6f 75 20 66 69 6e 64  il code you find
0a90: 20 72 75 6e 6e 69 6e 67 20 6f 6e 20 74 68 65 20   running on the 
0aa0: 6d 61 69 6e 20 46 6f 73 73 69 6c 20 77 65 62 73  main Fossil webs
0ab0: 69 74 65 2e 0a 0a 3c 68 32 3e 32 2e 30 20 43 6f  ite...<h2>2.0 Co
0ac0: 6d 70 69 6c 69 6e 67 3c 2f 68 32 3e 0a 0a 3c 6f  mpiling</h2>..<o
0ad0: 6c 3e 0a 3c 6c 69 20 76 61 6c 75 65 3d 22 35 22  l>.<li value="5"
0ae0: 3e 0a 3c 70 3e 55 6e 70 61 63 6b 20 74 68 65 20  >.<p>Unpack the 
0af0: 5a 49 50 20 6f 72 20 74 61 72 62 61 6c 6c 20 79  ZIP or tarball y
0b00: 6f 75 20 64 6f 77 6e 6c 6f 61 64 65 64 20 74 68  ou downloaded th
0b10: 65 6e 0a 3c 62 3e 63 64 3c 2f 62 3e 20 69 6e 74  en.<b>cd</b> int
0b20: 6f 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20  o the directory 
0b30: 63 72 65 61 74 65 64 2e 3c 2f 70 3e 3c 2f 6c 69  created.</p></li
0b40: 3e 0a 0a 3c 6c 69 3e 3c 69 3e 28 4f 70 74 69 6f  >..<li><i>(Optio
0b50: 6e 61 6c 2c 20 44 65 62 69 61 6e 2d 63 6f 6d 70  nal, Debian-comp
0b60: 61 74 69 62 6c 65 20 4c 69 6e 75 78 20 6f 6e 6c  atible Linux onl
0b70: 79 29 3c 2f 69 3e 0a 4d 61 6b 65 20 73 75 72 65  y)</i>.Make sure
0b80: 20 79 6f 75 20 68 61 76 65 20 61 6c 6c 20 74 68   you have all th
0b90: 65 20 6e 65 63 65 73 73 61 72 79 20 74 6f 6f 6c  e necessary tool
0ba0: 73 20 61 6e 64 20 6c 69 62 72 61 72 69 65 73 20  s and libraries 
0bb0: 61 74 20 68 61 6e 64 20 62 79 20 72 75 6e 6e 69  at hand by runni
0bc0: 6e 67 3a 0a 3c 62 3e 73 75 64 6f 20 61 70 74 20  ng:.<b>sudo apt 
0bd0: 69 6e 73 74 61 6c 6c 20 74 63 6c 2d 64 65 76 20  install tcl-dev 
0be0: 74 6b 20 6c 69 62 73 73 6c 2d 64 65 76 20 7a 6c  tk libssl-dev zl
0bf0: 69 62 31 67 2d 64 65 76 3c 2f 62 3e 2e 0a 0a 3c  ib1g-dev</b>...<
0c00: 6c 69 3e 3c 69 3e 28 4f 70 74 69 6f 6e 61 6c 2c  li><i>(Optional,
0c10: 20 55 6e 69 78 20 6f 6e 6c 79 29 3c 2f 69 3e 0a   Unix only)</i>.
0c20: 52 75 6e 20 3c 62 3e 2e 2f 63 6f 6e 66 69 67 75  Run <b>./configu
0c30: 72 65 3c 2f 62 3e 20 74 6f 20 63 6f 6e 73 74 72  re</b> to constr
0c40: 75 63 74 20 61 20 6d 61 6b 65 66 69 6c 65 2e 0a  uct a makefile..
0c50: 0a 3c 6f 6c 20 74 79 70 65 3d 22 61 22 3e 0a 3c  .<ol type="a">.<
0c60: 6c 69 3e 3c 70 3e 0a 54 68 65 20 62 75 69 6c 64  li><p>.The build
0c70: 20 73 79 73 74 65 6d 20 66 6f 72 20 46 6f 73 73   system for Foss
0c80: 69 6c 20 6f 6e 20 55 6e 69 78 2d 6c 69 6b 65 20  il on Unix-like 
0c90: 73 79 73 74 65 6d 73 20 61 73 73 75 6d 65 73 20  systems assumes 
0ca0: 74 68 61 74 20 74 68 65 0a 4f 70 65 6e 53 53 4c  that the.OpenSSL
0cb0: 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 61 6e 64   development and
0cc0: 20 72 75 6e 74 69 6d 65 20 66 69 6c 65 73 20 61   runtime files a
0cd0: 72 65 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20  re available on 
0ce0: 79 6f 75 72 20 73 79 73 74 65 6d 2c 0a 62 65 63  your system,.bec
0cf0: 61 75 73 65 20 75 6e 70 72 6f 74 65 63 74 65 64  ause unprotected
0d00: 20 72 65 70 6f 73 69 74 6f 72 69 65 73 20 61 72   repositories ar
0d10: 65 20 74 72 69 76 69 61 6c 20 74 6f 20 61 74 74  e trivial to att
0d20: 61 63 6b 20 6f 74 68 65 72 77 69 73 65 2e 0a 49  ack otherwise..I
0d30: 6e 64 65 65 64 2c 20 73 6f 6d 65 20 70 75 62 6c  ndeed, some publ
0d40: 69 63 20 46 6f 73 73 69 6c 20 72 65 70 6f 73 69  ic Fossil reposi
0d50: 74 6f 72 69 65 73 20 e2 80 94 20 69 6e 63 6c 75  tories — inclu
0d60: 64 69 6e 67 20 46 6f 73 73 69 6c 27 73 20 6f 77  ding Fossil's ow
0d70: 6e 20 e2 80 94 20 74 6f 64 61 79 0a 72 75 6e 20  n — today.run 
0d80: 69 6e 20 61 6e 20 48 54 54 50 53 2d 6f 6e 6c 79  in an HTTPS-only
0d90: 20 6d 6f 64 65 2c 20 73 6f 20 74 68 61 74 20 79   mode, so that y
0da0: 6f 75 20 63 61 6e 27 74 20 65 76 65 6e 20 64 6f  ou can't even do
0db0: 20 61 6e 20 61 6e 6f 6e 79 6d 6f 75 73 20 63 6c   an anonymous cl
0dc0: 6f 6e 65 0a 66 72 6f 6d 20 74 68 65 6d 20 77 69  one.from them wi
0dd0: 74 68 6f 75 74 20 75 73 69 6e 67 20 74 68 65 20  thout using the 
0de0: 54 4c 53 20 66 65 61 74 75 72 65 73 20 61 64 64  TLS features add
0df0: 65 64 20 74 6f 20 46 6f 73 73 69 6c 20 62 79 20  ed to Fossil by 
0e00: 4f 70 65 6e 53 53 4c 2e 20 54 6f 0a 77 65 61 6b  OpenSSL. To.weak
0e10: 65 6e 20 74 68 61 74 20 73 74 61 6e 63 65 20 63  en that stance c
0e20: 6f 75 6c 64 20 61 6c 6c 6f 77 20 61 0a 5b 68 74  ould allow a.[ht
0e30: 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64  tps://en.wikiped
0e40: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4d 61 6e 2d  ia.org/wiki/Man-
0e50: 69 6e 2d 74 68 65 2d 6d 69 64 64 6c 65 5f 61 74  in-the-middle_at
0e60: 74 61 63 6b 7c 6d 61 6e 20 69 6e 20 74 68 65 0a  tack|man in the.
0e70: 6d 69 64 64 6c 65 20 61 74 74 61 63 6b 5d 2c 20  middle attack], 
0e80: 73 75 63 68 20 61 73 20 6f 6e 65 20 74 68 61 74  such as one that
0e90: 20 73 75 62 73 74 69 74 75 74 65 73 20 6d 61 6c   substitutes mal
0ea0: 69 63 69 6f 75 73 20 63 6f 64 65 20 69 6e 74 6f  icious code into
0eb0: 20 79 6f 75 72 0a 46 6f 73 73 69 6c 20 72 65 70   your.Fossil rep
0ec0: 6f 73 69 74 6f 72 79 20 63 6c 6f 6e 65 2e 3c 2f  ository clone.</
0ed0: 70 3e 0a 0a 3c 70 3e 59 6f 75 20 63 61 6e 20 66  p>..<p>You can f
0ee0: 6f 72 63 65 20 74 68 65 20 46 6f 73 73 69 6c 20  orce the Fossil 
0ef0: 62 75 69 6c 64 20 73 79 73 74 65 6d 20 74 6f 20  build system to 
0f00: 61 76 6f 69 64 20 73 65 61 72 63 68 69 6e 67 20  avoid searching 
0f10: 66 6f 72 2c 20 62 75 69 6c 64 69 6e 67 0a 61 67  for, building.ag
0f20: 61 69 6e 73 74 2c 20 61 6e 64 20 6c 69 6e 6b 69  ainst, and linki
0f30: 6e 67 20 74 6f 20 74 68 65 20 4f 70 65 6e 53 53  ng to the OpenSS
0f40: 4c 20 6c 69 62 72 61 72 79 20 62 79 20 70 61 73  L library by pas
0f50: 73 69 6e 67 0a 3c 62 3e 2d 2d 77 69 74 68 2d 6f  sing.<b>--with-o
0f60: 70 65 6e 73 73 6c 3d 6e 6f 6e 65 3c 2f 62 3e 20  penssl=none</b> 
0f70: 74 6f 20 74 68 65 20 3c 74 74 3e 63 6f 6e 66 69  to the <tt>confi
0f80: 67 75 72 65 3c 2f 74 74 3e 20 73 63 72 69 70 74  gure</tt> script
0f90: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 49 66 20 79 6f 75  .</p>..<p>If you
0fa0: 20 64 6f 20 6e 6f 74 20 68 61 76 65 20 74 68 65   do not have the
0fb0: 20 4f 70 65 6e 53 53 4c 20 64 65 76 65 6c 6f 70   OpenSSL develop
0fc0: 6d 65 6e 74 20 6c 69 62 72 61 72 69 65 73 20 6f  ment libraries o
0fd0: 6e 20 79 6f 75 72 20 73 79 73 74 65 6d 2c 0a 77  n your system,.w
0fe0: 65 20 72 65 63 6f 6d 6d 65 6e 64 20 74 68 61 74  e recommend that
0ff0: 20 79 6f 75 20 69 6e 73 74 61 6c 6c 20 74 68 65   you install the
1000: 6d 2c 20 74 79 70 69 63 61 6c 6c 79 20 76 69 61  m, typically via
1010: 20 79 6f 75 72 20 4f 53 27 73 20 70 61 63 6b 61   your OS's packa
1020: 67 65 0a 6d 61 6e 61 67 65 72 2e 20 54 68 65 20  ge.manager. The 
1030: 46 6f 73 73 69 6c 20 62 75 69 6c 64 20 73 79 73  Fossil build sys
1040: 74 65 6d 20 67 6f 65 73 20 74 6f 20 61 20 6c 6f  tem goes to a lo
1050: 74 20 6f 66 20 65 66 66 6f 72 74 20 74 6f 20 73  t of effort to s
1060: 65 65 6b 20 74 68 65 73 65 0a 6f 75 74 20 77 68  eek these.out wh
1070: 65 72 65 76 65 72 20 74 68 65 79 20 6d 61 79 20  erever they may 
1080: 62 65 20 66 6f 75 6e 64 2c 20 73 6f 20 74 68 61  be found, so tha
1090: 74 20 69 73 20 74 79 70 69 63 61 6c 6c 79 20 61  t is typically a
10a0: 6c 6c 20 79 6f 75 20 6e 65 65 64 20 74 6f 0a 64  ll you need to.d
10b0: 6f 2e 3c 2f 70 3e 0a 0a 3c 70 3e 46 6f 72 20 6d  o.</p>..<p>For m
10c0: 6f 72 65 20 61 64 76 61 6e 63 65 64 20 75 73 65  ore advanced use
10d0: 20 63 61 73 65 73 2c 20 73 65 65 20 74 68 65 20   cases, see the 
10e0: 5b 2e 2f 73 73 6c 2e 77 69 6b 69 23 6f 70 65 6e  [./ssl.wiki#open
10f0: 73 73 6c 2d 62 69 6e 7c 4f 70 65 6e 53 53 4c 0a  ssl-bin|OpenSSL.
1100: 64 69 73 63 75 73 73 69 6f 6e 20 69 6e 20 74 68  discussion in th
1110: 65 20 22 54 4c 53 20 61 6e 64 20 46 6f 73 73 69  e "TLS and Fossi
1120: 6c 22 20 64 6f 63 75 6d 65 6e 74 5d 2e 3c 2f 70  l" document].</p
1130: 3e 0a 0a 3c 6c 69 3e 3c 70 3e 0a 54 6f 20 62 75  >..<li><p>.To bu
1140: 69 6c 64 20 61 20 73 74 61 74 69 63 61 6c 6c 79  ild a statically
1150: 20 6c 69 6e 6b 65 64 20 62 69 6e 61 72 79 20 28   linked binary (
1160: 73 75 69 74 61 62 6c 65 20 66 6f 72 20 75 73 65  suitable for use
1170: 20 69 6e 73 69 64 65 20 61 20 63 68 72 6f 6f 74   inside a chroot
1180: 0a 6a 61 69 6c 29 20 61 64 64 20 74 68 65 20 3c  .jail) add the <
1190: 62 3e 2d 2d 73 74 61 74 69 63 3c 2f 62 3e 20 6f  b>--static</b> o
11a0: 70 74 69 6f 6e 2e 20 28 53 65 65 20 74 68 65 20  ption. (See the 
11b0: 5b 23 64 6f 63 6b 65 72 20 7c 20 44 6f 63 6b 65  [#docker | Docke
11c0: 72 20 73 65 63 74 69 6f 6e 0a 62 65 6c 6f 77 5d  r section.below]
11d0: 2e 29 0a 0a 3c 6c 69 3e 3c 70 3e 0a 54 6f 20 65  .)..<li><p>.To e
11e0: 6e 61 62 6c 65 20 74 68 65 20 6e 61 74 69 76 65  nable the native
11f0: 20 5b 2e 2f 74 68 31 2e 6d 64 23 74 63 6c 45 76   [./th1.md#tclEv
1200: 61 6c 20 7c 20 54 63 6c 20 69 6e 74 65 67 72 61  al | Tcl integra
1210: 74 69 6f 6e 20 66 65 61 74 75 72 65 5d 20 66 65  tion feature] fe
1220: 61 74 75 72 65 2c 0a 61 64 64 20 74 68 65 20 3c  ature,.add the <
1230: 62 3e 2d 2d 77 69 74 68 2d 74 63 6c 3d 31 3c 2f  b>--with-tcl=1</
1240: 62 3e 20 61 6e 64 20 3c 62 3e 2d 2d 77 69 74 68  b> and <b>--with
1250: 2d 74 63 6c 2d 70 72 69 76 61 74 65 2d 73 74 75  -tcl-private-stu
1260: 62 73 3d 31 3c 2f 62 3e 20 6f 70 74 69 6f 6e 73  bs=1</b> options
1270: 2e 0a 0a 3c 6c 69 3e 3c 70 3e 0a 4f 74 68 65 72  ...<li><p>.Other
1280: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f   configuration o
1290: 70 74 69 6f 6e 73 20 63 61 6e 20 62 65 20 73 65  ptions can be se
12a0: 65 6e 20 62 79 20 72 75 6e 6e 69 6e 67 0a 3c 62  en by running.<b
12b0: 3e 2e 2f 63 6f 6e 66 69 67 75 72 65 20 2d 2d 68  >./configure --h
12c0: 65 6c 70 3c 2f 62 3e 0a 3c 2f 6f 6c 3e 0a 0a 3c  elp</b>.</ol>..<
12d0: 6c 69 3e 3c 70 3e 52 75 6e 20 22 3c 62 3e 6d 61  li><p>Run "<b>ma
12e0: 6b 65 3c 2f 62 3e 22 20 74 6f 20 62 75 69 6c 64  ke</b>" to build
12f0: 20 74 68 65 20 22 66 6f 73 73 69 6c 22 20 6f 72   the "fossil" or
1300: 20 22 66 6f 73 73 69 6c 2e 65 78 65 22 20 65 78   "fossil.exe" ex
1310: 65 63 75 74 61 62 6c 65 2e 0a 54 68 65 20 64 65  ecutable..The de
1320: 74 61 69 6c 73 20 64 65 70 65 6e 64 20 6f 6e 20  tails depend on 
1330: 79 6f 75 72 20 70 6c 61 74 66 6f 72 6d 20 61 6e  your platform an
1340: 64 20 63 6f 6d 70 69 6c 65 72 2e 0a 0a 3c 6f 6c  d compiler...<ol
1350: 20 74 79 70 65 3d 22 61 22 3e 0a 3c 6c 69 3e 3c   type="a">.<li><
1360: 70 3e 3c 69 3e 55 6e 69 78 3c 2f 69 3e 20 e2 86  p><i>Unix</i> â†
1370: 92 20 74 68 65 20 63 6f 6e 66 69 67 75 72 65 2d  ’ the configure-
1380: 67 65 6e 65 72 61 74 65 64 20 4d 61 6b 65 66 69  generated Makefi
1390: 6c 65 20 73 68 6f 75 6c 64 20 77 6f 72 6b 20 6f  le should work o
13a0: 6e 0a 61 6c 6c 20 55 6e 69 78 20 61 6e 64 20 55  n.all Unix and U
13b0: 6e 69 78 2d 6c 69 6b 65 20 73 79 73 74 65 6d 73  nix-like systems
13c0: 2e 20 20 53 69 6d 70 6c 79 20 74 79 70 65 20 22  .  Simply type "
13d0: 3c 62 3e 6d 61 6b 65 3c 2f 62 3e 22 2e 0a 0a 3c  <b>make</b>"...<
13e0: 6c 69 3e 3c 70 3e 3c 69 3e 55 6e 69 78 20 77 69  li><p><i>Unix wi
13f0: 74 68 6f 75 74 20 72 75 6e 6e 69 6e 67 20 22 63  thout running "c
1400: 6f 6e 66 69 67 75 72 65 22 3c 2f 69 3e 20 e2 86  onfigure"</i> â†
1410: 92 20 69 66 20 79 6f 75 20 70 72 65 66 65 72 20  ’ if you prefer 
1420: 74 6f 20 61 76 6f 69 64 0a 72 75 6e 6e 69 6e 67  to avoid.running
1430: 20 63 6f 6e 66 69 67 75 72 65 2c 20 79 6f 75 20   configure, you 
1440: 63 61 6e 20 61 6c 73 6f 20 75 73 65 3a 20 3c 62  can also use: <b
1450: 3e 6d 61 6b 65 20 2d 66 20 4d 61 6b 65 66 69 6c  >make -f Makefil
1460: 65 2e 63 6c 61 73 73 69 63 3c 2f 62 3e 2e 20 20  e.classic</b>.  
1470: 59 6f 75 20 6d 61 79 0a 77 61 6e 74 20 74 6f 20  You may.want to 
1480: 6d 61 6b 65 20 6d 69 6e 6f 72 20 65 64 69 74 73  make minor edits
1490: 20 74 6f 20 4d 61 6b 65 66 69 6c 65 2e 63 6c 61   to Makefile.cla
14a0: 73 73 69 63 20 74 6f 20 63 6f 6e 66 69 67 75 72  ssic to configur
14b0: 65 20 74 68 65 20 62 75 69 6c 64 20 66 6f 72 20  e the build for 
14c0: 79 6f 75 72 0a 73 79 73 74 65 6d 2e 0a 0a 3c 6c  your.system...<l
14d0: 69 3e 3c 70 3e 3c 69 3e 4d 69 6e 47 57 20 2f 20  i><p><i>MinGW / 
14e0: 4d 69 6e 47 57 2d 77 36 34 3c 2f 69 3e 20 e2 86  MinGW-w64</i> â†
14f0: 92 20 54 68 65 20 62 65 73 74 2d 73 75 70 70 6f  ’ The best-suppo
1500: 72 74 65 64 20 70 61 74 68 20 69 73 20 74 6f 20  rted path is to 
1510: 62 75 69 6c 64 0a 76 69 61 20 74 68 65 20 4d 69  build.via the Mi
1520: 6e 47 57 20 73 70 65 63 69 66 69 63 20 4d 61 6b  nGW specific Mak
1530: 65 66 69 6c 65 20 75 6e 64 65 72 20 61 20 50 4f  efile under a PO
1540: 53 49 58 20 62 75 69 6c 64 20 6f 66 20 47 4e 55  SIX build of GNU
1550: 20 6d 61 6b 65 3a 0a 22 3c 62 3e 6d 61 6b 65 20   make:."<b>make 
1560: 2d 66 20 77 69 6e 2f 4d 61 6b 65 66 69 6c 65 2e  -f win/Makefile.
1570: 6d 69 6e 67 77 3c 2f 62 3e 22 2e 0a 0a 54 68 65  mingw</b>"...The
1580: 72 65 20 69 73 20 6c 69 6d 69 74 65 64 20 73 75  re is limited su
1590: 70 70 6f 72 74 20 66 6f 72 20 62 75 69 6c 64 69  pport for buildi
15a0: 6e 67 20 75 6e 64 65 72 20 4d 69 6e 47 57 27 73  ng under MinGW's
15b0: 20 6e 61 74 69 76 65 20 57 69 6e 64 6f 77 73 20   native Windows 
15c0: 70 6f 72 74 0a 6f 66 20 47 4e 55 20 4d 61 6b 65  port.of GNU Make
15d0: 20 69 6e 73 74 65 61 64 20 62 79 20 64 65 66 69   instead by defi
15e0: 6e 69 6e 67 20 74 68 65 20 3c 74 74 3e 55 53 45  ning the <tt>USE
15f0: 5f 57 49 4e 44 4f 57 53 3d 31 3c 2f 74 74 3e 20  _WINDOWS=1</tt> 
1600: 76 61 72 69 61 62 6c 65 2c 20 62 75 74 0a 69 74  variable, but.it
1610: 27 73 20 62 65 74 74 65 72 20 74 6f 20 62 75 69  's better to bui
1620: 6c 64 20 75 6e 64 65 72 20 4d 53 59 53 2c 20 43  ld under MSYS, C
1630: 79 67 77 69 6e 2c 20 6f 72 20 57 53 4c 20 6f 6e  ygwin, or WSL on
1640: 20 57 69 6e 64 6f 77 73 20 73 69 6e 63 65 20 74   Windows since t
1650: 68 69 73 0a 6d 6f 64 65 20 64 6f 65 73 6e 27 74  his.mode doesn't
1660: 20 74 61 6b 65 20 63 61 72 65 20 6f 66 20 63 61   take care of ca
1670: 73 65 73 20 73 75 63 68 20 61 73 20 74 68 65 20  ses such as the 
1680: 22 6f 70 65 6e 73 73 6c 22 20 74 61 72 67 65 74  "openssl" target
1690: 2c 20 77 68 69 63 68 0a 64 65 70 65 6e 64 73 20  , which.depends 
16a0: 6f 6e 20 3c 74 74 3e 73 65 64 3c 2f 74 74 3e 2e  on <tt>sed</tt>.
16b0: 20 57 65 27 76 65 20 67 6f 6e 65 20 61 73 20 66   We've gone as f
16c0: 61 72 20 64 6f 77 6e 20 74 68 69 73 20 70 61 74  ar down this pat
16d0: 68 20 61 73 20 69 73 0a 70 72 61 63 74 69 63 61  h as is.practica
16e0: 6c 20 73 68 6f 72 74 20 6f 66 20 62 72 65 61 6b  l short of break
16f0: 69 6e 67 20 63 72 6f 73 73 2d 63 6f 6d 70 69 6c  ing cross-compil
1700: 61 74 69 6f 6e 20 75 6e 64 65 72 20 4c 69 6e 75  ation under Linu
1710: 78 2c 20 6d 61 63 4f 53 2c 20 61 6e 64 20 73 6f  x, macOS, and so
1720: 0a 66 6f 72 74 68 2c 20 61 73 20 77 65 27 64 20  .forth, as we'd 
1730: 68 61 76 65 20 74 6f 20 64 6f 20 74 6f 20 6d 61  have to do to ma
1740: 6b 65 20 65 76 65 72 79 74 68 69 6e 67 20 77 6f  ke everything wo
1750: 72 6b 20 75 6e 64 65 72 0a 3c 74 74 3e 63 6d 64  rk under.<tt>cmd
1760: 2e 65 78 65 3c 2f 74 74 3e 2e 0a 0a 55 6e 6c 65  .exe</tt>...Unle
1770: 73 73 20 79 6f 75 27 72 65 20 62 75 69 6c 64 69  ss you're buildi
1780: 6e 67 20 75 6e 64 65 72 20 4d 53 59 53 20 77 68  ng under MSYS wh
1790: 65 72 65 20 63 6f 6d 6d 61 6e 64 73 20 6c 69 6b  ere commands lik
17a0: 65 20 22 3c 74 74 3e 67 63 63 3c 2f 74 74 3e 22  e "<tt>gcc</tt>"
17b0: 0a 67 69 76 65 20 4d 69 6e 47 57 27 73 20 47 43  .give MinGW's GC
17c0: 43 20 61 6e 64 20 6e 6f 74 20 73 6f 6d 65 20 6f  C and not some o
17d0: 74 68 65 72 20 76 65 72 73 69 6f 6e 2c 20 79 6f  ther version, yo
17e0: 75 20 77 69 6c 6c 20 6e 65 65 64 20 74 6f 20 6d  u will need to m
17f0: 61 6b 65 20 6d 69 6e 6f 72 0a 65 64 69 74 73 20  ake minor.edits 
1800: 74 6f 20 77 69 6e 2f 4d 61 6b 65 66 69 6c 65 2e  to win/Makefile.
1810: 6d 69 6e 67 77 20 74 6f 20 63 6f 6e 66 69 67 75  mingw to configu
1820: 72 65 20 74 68 65 20 63 72 6f 73 73 2d 63 6f 6d  re the cross-com
1830: 70 69 6c 61 74 69 6f 6e 0a 65 6e 76 69 72 6f 6e  pilation.environ
1840: 6d 65 6e 74 2e 20 49 74 20 73 68 6f 75 6c 64 20  ment. It should 
1850: 73 75 66 66 69 63 65 20 74 6f 20 73 77 69 74 63  suffice to switc
1860: 68 20 74 6f 20 6f 6e 65 20 6f 66 20 74 68 65 20  h to one of the 
1870: 70 72 65 64 65 66 69 6e 65 64 0a 3c 74 74 3e 50  predefined.<tt>P
1880: 52 45 46 49 58 3c 2f 74 74 3e 20 76 61 6c 75 65  REFIX</tt> value
1890: 73 2c 20 63 61 75 73 69 6e 67 20 74 68 65 20 62  s, causing the b
18a0: 75 69 6c 64 20 74 6f 20 62 65 20 64 6f 6e 65 20  uild to be done 
18b0: 75 73 69 6e 67 0a 22 3c 74 74 3e 78 38 36 5f 36  using."<tt>x86_6
18c0: 34 2d 77 36 34 2d 6d 69 6e 67 77 33 32 2d 67 63  4-w64-mingw32-gc
18d0: 63 3c 2f 74 74 3e 22 20 66 6f 72 20 65 78 61 6d  c</tt>" for exam
18e0: 70 6c 65 2c 20 79 69 65 6c 64 69 6e 67 20 61 20  ple, yielding a 
18f0: 36 34 2d 62 69 74 20 6e 61 74 69 76 65 0a 57 69  64-bit native.Wi
1900: 6e 64 6f 77 73 20 62 69 6e 61 72 79 2e 0a 0a 54  ndows binary...T
1910: 6f 20 65 6e 61 62 6c 65 20 74 68 65 20 6e 61 74  o enable the nat
1920: 69 76 65 20 5b 2e 2f 74 68 31 2e 6d 64 23 74 63  ive [./th1.md#tc
1930: 6c 45 76 61 6c 20 7c 20 54 63 6c 20 69 6e 74 65  lEval | Tcl inte
1940: 67 72 61 74 69 6f 6e 20 66 65 61 74 75 72 65 5d  gration feature]
1950: 2c 20 75 73 65 20 61 0a 63 6f 6d 6d 61 6e 64 20  , use a.command 
1960: 6c 69 6e 65 20 6c 69 6b 65 20 74 68 65 20 66 6f  line like the fo
1970: 6c 6c 6f 77 69 6e 67 20 28 61 6c 6c 20 6f 6e 20  llowing (all on 
1980: 6f 6e 65 20 6c 69 6e 65 29 3a 0a 0a 3c 62 3e 6d  one line):..<b>m
1990: 61 6b 65 20 2d 66 20 77 69 6e 2f 4d 61 6b 65 66  ake -f win/Makef
19a0: 69 6c 65 2e 6d 69 6e 67 77 20 46 4f 53 53 49 4c  ile.mingw FOSSIL
19b0: 5f 45 4e 41 42 4c 45 5f 54 43 4c 3d 31 20 46 4f  _ENABLE_TCL=1 FO
19c0: 53 53 49 4c 5f 45 4e 41 42 4c 45 5f 54 43 4c 5f  SSIL_ENABLE_TCL_
19d0: 53 54 55 42 53 3d 31 20 46 4f 53 53 49 4c 5f 45  STUBS=1 FOSSIL_E
19e0: 4e 41 42 4c 45 5f 54 43 4c 5f 50 52 49 56 41 54  NABLE_TCL_PRIVAT
19f0: 45 5f 53 54 55 42 53 3d 31 3c 2f 62 3e 0a 0a 41  E_STUBS=1</b>..A
1a00: 6c 74 65 72 6e 61 74 69 76 65 6c 79 2c 20 72 75  lternatively, ru
1a10: 6e 6e 69 6e 67 20 3c 62 3e 2e 2f 63 6f 6e 66 69  nning <b>./confi
1a20: 67 75 72 65 3c 2f 62 3e 20 75 6e 64 65 72 20 4d  gure</b> under M
1a30: 53 59 53 20 73 68 6f 75 6c 64 20 67 69 76 65 20  SYS should give 
1a40: 61 0a 73 75 69 74 61 62 6c 65 20 74 6f 70 2d 6c  a.suitable top-l
1a50: 65 76 65 6c 20 4d 61 6b 65 66 69 6c 65 2e 20 48  evel Makefile. H
1a60: 6f 77 65 76 65 72 2c 20 6f 70 74 69 6f 6e 73 20  owever, options 
1a70: 70 61 73 73 65 64 20 74 6f 20 63 6f 6e 66 69 67  passed to config
1a80: 75 72 65 20 74 68 61 74 20 61 72 65 0a 6e 6f 74  ure that are.not
1a90: 20 61 70 70 6c 69 63 61 62 6c 65 20 6f 6e 20 57   applicable on W
1aa0: 69 6e 64 6f 77 73 20 6d 61 79 20 63 61 75 73 65  indows may cause
1ab0: 20 74 68 65 20 63 6f 6e 66 69 67 75 72 61 74 69   the configurati
1ac0: 6f 6e 20 6f 72 20 63 6f 6d 70 69 6c 61 74 69 6f  on or compilatio
1ad0: 6e 20 74 6f 20 66 61 69 6c 0a 28 65 2e 67 2e 20  n to fail.(e.g. 
1ae0: 66 75 73 65 66 73 2c 20 69 6e 74 65 72 6e 61 6c  fusefs, internal
1af0: 2d 73 71 6c 69 74 65 2c 20 65 74 63 29 2e 0a 0a  -sqlite, etc)...
1b00: 3c 6c 69 3e 3c 70 3e 3c 69 3e 4d 53 56 43 3c 2f  <li><p><i>MSVC</
1b10: 69 3e 20 e2 86 92 20 55 73 65 20 74 68 65 20 4d  i> → Use the M
1b20: 53 56 43 20 6d 61 6b 65 66 69 6c 65 2e 20 20 0a  SVC makefile.  .
1b30: 0a 52 75 6e 20 61 6c 6c 20 6f 66 20 74 68 65 20  .Run all of the 
1b40: 66 6f 6c 6c 6f 77 69 6e 67 20 66 72 6f 6d 20 61  following from a
1b50: 20 22 78 36 34 20 4e 61 74 69 76 65 20 54 6f 6f   "x64 Native Too
1b60: 6c 73 20 43 6f 6d 6d 61 6e 64 20 50 72 6f 6d 70  ls Command Promp
1b70: 74 22 2e 20 0a 0a 46 69 72 73 74 0a 63 68 61 6e  t". ..First.chan
1b80: 67 65 20 74 6f 20 74 68 65 20 22 77 69 6e 2f 22  ge to the "win/"
1b90: 20 73 75 62 64 69 72 65 63 74 6f 72 79 20 28 22   subdirectory ("
1ba0: 3c 62 3e 63 64 20 77 69 6e 3c 2f 62 3e 22 29 20  <b>cd win</b>") 
1bb0: 74 68 65 6e 20 72 75 6e 0a 22 3c 62 3e 6e 6d 61  then run."<b>nma
1bc0: 6b 65 20 2f 66 20 4d 61 6b 65 66 69 6c 65 2e 6d  ke /f Makefile.m
1bd0: 73 63 3c 2f 62 3e 22 2e 3c 62 72 3e 3c 62 72 3e  sc</b>".<br><br>
1be0: 41 6c 74 65 72 6e 61 74 69 76 65 6c 79 2c 20 74  Alternatively, t
1bf0: 68 65 20 62 61 74 63 68 0a 66 69 6c 65 20 22 3c  he batch.file "<
1c00: 62 3e 77 69 6e 5c 62 75 69 6c 64 6d 73 76 63 2e  b>win\buildmsvc.
1c10: 62 61 74 3c 2f 62 3e 22 20 6d 61 79 20 62 65 20  bat</b>" may be 
1c20: 75 73 65 64 20 61 6e 64 20 69 74 20 77 69 6c 6c  used and it will
1c30: 20 61 74 74 65 6d 70 74 20 74 6f 0a 64 65 74 65   attempt to.dete
1c40: 63 74 20 61 6e 64 20 75 73 65 20 74 68 65 20 6c  ct and use the l
1c50: 61 74 65 73 74 20 69 6e 73 74 61 6c 6c 65 64 20  atest installed 
1c60: 76 65 72 73 69 6f 6e 20 6f 66 20 4d 53 56 43 2e  version of MSVC.
1c70: 3c 62 72 3e 3c 62 72 3e 54 6f 20 65 6e 61 62 6c  <br><br>To enabl
1c80: 65 0a 74 68 65 20 6f 70 74 69 6f 6e 61 6c 20 3c  e.the optional <
1c90: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f  a href="https://
1ca0: 77 77 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f  www.openssl.org/
1cb0: 22 3e 4f 70 65 6e 53 53 4c 3c 2f 61 3e 20 73 75  ">OpenSSL</a> su
1cc0: 70 70 6f 72 74 2c 0a 66 69 72 73 74 20 3c 61 20  pport,.first <a 
1cd0: 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77  href="https://ww
1ce0: 77 2e 6f 70 65 6e 73 73 6c 2e 6f 72 67 2f 73 6f  w.openssl.org/so
1cf0: 75 72 63 65 2f 22 3e 64 6f 77 6e 6c 6f 61 64 20  urce/">download 
1d00: 74 68 65 20 6f 66 66 69 63 69 61 6c 0a 73 6f 75  the official.sou
1d10: 72 63 65 20 63 6f 64 65 20 66 6f 72 20 4f 70 65  rce code for Ope
1d20: 6e 53 53 4c 3c 2f 61 3e 20 61 6e 64 20 65 78 74  nSSL</a> and ext
1d30: 72 61 63 74 20 69 74 20 74 6f 20 61 6e 20 61 70  ract it to an ap
1d40: 70 72 6f 70 72 69 61 74 65 6c 79 20 6e 61 6d 65  propriately name
1d50: 64 0a 22 3c 62 3e 6f 70 65 6e 73 73 6c 3c 2f 62  d."<b>openssl</b
1d60: 3e 22 20 73 75 62 64 69 72 65 63 74 6f 72 79 20  >" subdirectory 
1d70: 77 69 74 68 69 6e 20 74 68 65 20 6c 6f 63 61 6c  within the local
1d80: 0a 5b 2f 74 72 65 65 3f 63 69 3d 74 72 75 6e 6b  .[/tree?ci=trunk
1d90: 26 6e 61 6d 65 3d 63 6f 6d 70 61 74 20 7c 20 63  &name=compat | c
1da0: 6f 6d 70 61 74 5d 20 64 69 72 65 63 74 6f 72 79  ompat] directory
1db0: 20 74 68 65 6e 20 6d 61 6b 65 20 73 75 72 65 20   then make sure 
1dc0: 74 68 61 74 20 73 6f 6d 65 20 72 65 63 65 6e 74  that some recent
1dd0: 0a 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f  .<a href="http:/
1de0: 2f 77 77 77 2e 70 65 72 6c 2e 6f 72 67 2f 22 3e  /www.perl.org/">
1df0: 50 65 72 6c 3c 2f 61 3e 20 62 69 6e 61 72 69 65  Perl</a> binarie
1e00: 73 20 61 72 65 20 69 6e 73 74 61 6c 6c 65 64 20  s are installed 
1e10: 6c 6f 63 61 6c 6c 79 2c 0a 61 6e 64 20 66 69 6e  locally,.and fin
1e20: 61 6c 6c 79 20 72 75 6e 20 6f 6e 65 20 6f 66 20  ally run one of 
1e30: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f  the following co
1e40: 6d 6d 61 6e 64 73 3a 0a 3c 62 6c 6f 63 6b 71 75  mmands:.<blockqu
1e50: 6f 74 65 3e 3c 70 72 65 3e 0a 6e 6d 61 6b 65 20  ote><pre>.nmake 
1e60: 2f 66 20 4d 61 6b 65 66 69 6c 65 2e 6d 73 63 20  /f Makefile.msc 
1e70: 46 4f 53 53 49 4c 5f 45 4e 41 42 4c 45 5f 53 53  FOSSIL_ENABLE_SS
1e80: 4c 3d 31 20 46 4f 53 53 49 4c 5f 42 55 49 4c 44  L=1 FOSSIL_BUILD
1e90: 5f 53 53 4c 3d 31 20 50 45 52 4c 44 49 52 3d 43  _SSL=1 PERLDIR=C
1ea0: 3a 5c 66 75 6c 6c 5c 70 61 74 68 5c 74 6f 5c 50  :\full\path\to\P
1eb0: 65 72 6c 5c 62 69 6e 0a 3c 2f 70 72 65 3e 3c 2f  erl\bin.</pre></
1ec0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 3c 62 6c 6f  blockquote>.<blo
1ed0: 63 6b 71 75 6f 74 65 3e 3c 70 72 65 3e 0a 62 75  ckquote><pre>.bu
1ee0: 69 6c 64 6d 73 76 63 2e 62 61 74 20 46 4f 53 53  ildmsvc.bat FOSS
1ef0: 49 4c 5f 45 4e 41 42 4c 45 5f 53 53 4c 3d 31 20  IL_ENABLE_SSL=1 
1f00: 46 4f 53 53 49 4c 5f 42 55 49 4c 44 5f 53 53 4c  FOSSIL_BUILD_SSL
1f10: 3d 31 20 50 45 52 4c 44 49 52 3d 43 3a 5c 66 75  =1 PERLDIR=C:\fu
1f20: 6c 6c 5c 70 61 74 68 5c 74 6f 5c 50 65 72 6c 5c  ll\path\to\Perl\
1f30: 62 69 6e 0a 3c 2f 70 72 65 3e 3c 2f 62 6c 6f 63  bin.</pre></bloc
1f40: 6b 71 75 6f 74 65 3e 0a 54 6f 20 65 6e 61 62 6c  kquote>.To enabl
1f50: 65 20 74 68 65 20 6f 70 74 69 6f 6e 61 6c 20 6e  e the optional n
1f60: 61 74 69 76 65 20 5b 2e 2f 74 68 31 2e 6d 64 23  ative [./th1.md#
1f70: 74 63 6c 45 76 61 6c 20 7c 20 54 63 6c 20 69 6e  tclEval | Tcl in
1f80: 74 65 67 72 61 74 69 6f 6e 20 66 65 61 74 75 72  tegration featur
1f90: 65 5d 2c 0a 72 75 6e 20 6f 6e 65 20 6f 66 20 74  e],.run one of t
1fa0: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6d  he following com
1fb0: 6d 61 6e 64 73 20 6f 72 20 61 64 64 20 74 68 65  mands or add the
1fc0: 20 26 71 75 6f 74 3b 46 4f 53 53 49 4c 5f 45 4e   &quot;FOSSIL_EN
1fd0: 41 42 4c 45 5f 54 43 4c 3d 31 26 71 75 6f 74 3b  ABLE_TCL=1&quot;
1fe0: 0a 61 72 67 75 6d 65 6e 74 20 74 6f 20 6f 6e 65  .argument to one
1ff0: 20 6f 66 20 74 68 65 20 6f 74 68 65 72 20 4e 4d   of the other NM
2000: 41 4b 45 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65  AKE command line
2010: 73 3a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c  s:.<blockquote><
2020: 70 72 65 3e 0a 6e 6d 61 6b 65 20 2f 66 20 4d 61  pre>.nmake /f Ma
2030: 6b 65 66 69 6c 65 2e 6d 73 63 20 46 4f 53 53 49  kefile.msc FOSSI
2040: 4c 5f 45 4e 41 42 4c 45 5f 54 43 4c 3d 31 0a 3c  L_ENABLE_TCL=1.<
2050: 2f 70 72 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f 74  /pre></blockquot
2060: 65 3e 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c  e>.<blockquote><
2070: 70 72 65 3e 0a 62 75 69 6c 64 6d 73 76 63 2e 62  pre>.buildmsvc.b
2080: 61 74 20 46 4f 53 53 49 4c 5f 45 4e 41 42 4c 45  at FOSSIL_ENABLE
2090: 5f 54 43 4c 3d 31 0a 3c 2f 70 72 65 3e 3c 2f 62  _TCL=1.</pre></b
20a0: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 6c 69 3e  lockquote>..<li>
20b0: 3c 70 3e 3c 69 3e 43 79 67 77 69 6e 3c 2f 69 3e  <p><i>Cygwin</i>
20c0: 20 e2 86 92 20 54 68 65 20 73 61 6d 65 20 61 73   → The same as
20d0: 20 6f 74 68 65 72 20 55 6e 69 78 2d 6c 69 6b 65   other Unix-like
20e0: 20 73 79 73 74 65 6d 73 2e 20 49 74 20 69 73 0a   systems. It is.
20f0: 72 65 63 6f 6d 6d 65 6e 64 65 64 20 74 6f 20 63  recommended to c
2100: 6f 6e 66 69 67 75 72 65 20 75 73 69 6e 67 3a 20  onfigure using: 
2110: 22 3c 62 3e 63 6f 6e 66 69 67 75 72 65 20 2d 2d  "<b>configure --
2120: 64 69 73 61 62 6c 65 2d 69 6e 74 65 72 6e 61 6c  disable-internal
2130: 2d 73 71 6c 69 74 65 3c 2f 62 3e 22 2c 0a 6d 61  -sqlite</b>",.ma
2140: 6b 69 6e 67 20 73 75 72 65 20 79 6f 75 20 68 61  king sure you ha
2150: 76 65 20 74 68 65 20 22 6c 69 62 73 71 6c 69 74  ve the "libsqlit
2160: 65 33 2d 64 65 76 65 6c 22 20 2c 20 22 7a 6c 69  e3-devel" , "zli
2170: 62 2d 64 65 76 65 6c 22 20 61 6e 64 0a 22 6f 70  b-devel" and."op
2180: 65 6e 73 73 6c 2d 64 65 76 65 6c 22 20 70 61 63  enssl-devel" pac
2190: 6b 61 67 65 73 20 69 6e 73 74 61 6c 6c 65 64 20  kages installed 
21a0: 66 69 72 73 74 2e 0a 3c 2f 6f 6c 3e 0a 3c 2f 6f  first..</ol>.</o
21b0: 6c 3e 0a 0a 3c 68 32 3e 33 2e 30 20 49 6e 73 74  l>..<h2>3.0 Inst
21c0: 61 6c 6c 69 6e 67 3c 2f 68 32 3e 0a 0a 3c 6f 6c  alling</h2>..<ol
21d0: 3e 0a 3c 6c 69 20 76 61 6c 75 65 3d 22 39 22 3e  >.<li value="9">
21e0: 0a 3c 70 3e 54 68 65 20 66 69 6e 69 73 68 65 64  .<p>The finished
21f0: 20 62 69 6e 61 72 79 20 69 73 20 6e 61 6d 65 64   binary is named
2200: 20 22 66 6f 73 73 69 6c 22 20 28 6f 72 20 22 66   "fossil" (or "f
2210: 6f 73 73 69 6c 2e 65 78 65 22 20 6f 6e 20 57 69  ossil.exe" on Wi
2220: 6e 64 6f 77 73 29 2e 0a 50 75 74 20 74 68 69 73  ndows)..Put this
2230: 20 62 69 6e 61 72 79 20 69 6e 20 61 0a 64 69 72   binary in a.dir
2240: 65 63 74 6f 72 79 20 74 68 61 74 20 69 73 20 73  ectory that is s
2250: 6f 6d 65 77 68 65 72 65 20 6f 6e 20 79 6f 75 72  omewhere on your
2260: 20 50 41 54 48 20 65 6e 76 69 72 6f 6e 6d 65 6e   PATH environmen
2270: 74 20 76 61 72 69 61 62 6c 65 2e 0a 49 74 20 64  t variable..It d
2280: 6f 65 73 20 6e 6f 74 20 6d 61 74 74 65 72 20 77  oes not matter w
2290: 68 65 72 65 2e 3c 2f 70 3e 0a 0a 3c 6c 69 3e 0a  here.</p>..<li>.
22a0: 3c 70 3e 3c 62 3e 28 4f 70 74 69 6f 6e 61 6c 3a  <p><b>(Optional:
22b0: 29 3c 2f 62 3e 0a 54 6f 20 75 6e 69 6e 73 74 61  )</b>.To uninsta
22c0: 6c 6c 2c 20 6a 75 73 74 20 64 65 6c 65 74 65 20  ll, just delete 
22d0: 74 68 65 20 62 69 6e 61 72 79 2e 3c 2f 70 3e 0a  the binary.</p>.
22e0: 3c 2f 6f 6c 3e 0a 0a 3c 68 32 3e 34 2e 30 20 41  </ol>..<h2>4.0 A
22f0: 64 64 69 74 69 6f 6e 61 6c 20 43 6f 6e 73 69 64  dditional Consid
2300: 65 72 61 74 69 6f 6e 73 3c 2f 68 32 3e 0a 0a 3c  erations</h2>..<
2310: 75 6c 3e 0a 3c 6c 69 3e 3c 70 3e 0a 20 20 49 66  ul>.<li><p>.  If
2320: 20 74 68 65 20 6d 61 6b 65 66 69 6c 65 73 20 74   the makefiles t
2330: 68 61 74 20 63 6f 6d 65 20 77 69 74 68 20 46 6f  hat come with Fo
2340: 73 73 69 6c 20 64 6f 20 6e 6f 74 20 77 6f 72 6b  ssil do not work
2350: 20 66 6f 72 0a 20 20 79 6f 75 2c 20 6f 72 20 66   for.  you, or f
2360: 6f 72 20 73 6f 6d 65 20 6f 74 68 65 72 20 72 65  or some other re
2370: 61 73 6f 6e 20 79 6f 75 20 77 61 6e 74 20 74 6f  ason you want to
2380: 20 6b 6e 6f 77 20 68 6f 77 20 74 6f 20 62 75 69   know how to bui
2390: 6c 64 0a 20 20 46 6f 73 73 69 6c 20 6d 61 6e 75  ld.  Fossil manu
23a0: 61 6c 6c 79 2c 20 74 68 65 6e 20 72 65 66 65 72  ally, then refer
23b0: 20 74 6f 20 74 68 65 0a 20 20 5b 2e 2f 6d 61 6b   to the.  [./mak
23c0: 65 66 69 6c 65 2e 77 69 6b 69 20 7c 20 46 6f 73  efile.wiki | Fos
23d0: 73 69 6c 20 42 75 69 6c 64 20 50 72 6f 63 65 73  sil Build Proces
23e0: 73 5d 20 64 6f 63 75 6d 65 6e 74 20 77 68 69 63  s] document whic
23f0: 68 20 64 65 73 63 72 69 62 65 73 0a 20 20 69 6e  h describes.  in
2400: 20 64 65 74 61 69 6c 20 77 68 61 74 20 74 68 65   detail what the
2410: 20 6d 61 6b 65 66 69 6c 65 73 20 64 6f 20 62 65   makefiles do be
2420: 68 69 6e 64 20 74 68 65 20 73 63 65 6e 65 73 2e  hind the scenes.
2430: 0a 0a 3c 6c 69 3e 3c 70 3e 0a 20 20 54 68 65 20  ..<li><p>.  The 
2440: 66 6f 73 73 69 6c 20 65 78 65 63 75 74 61 62 6c  fossil executabl
2450: 65 20 69 73 20 73 65 6c 66 2d 63 6f 6e 74 61 69  e is self-contai
2460: 6e 65 64 20 61 6e 64 20 73 74 61 6e 64 2d 61 6c  ned and stand-al
2470: 6f 6e 65 20 61 6e 64 20 75 73 75 61 6c 6c 79 0a  one and usually.
2480: 20 20 72 65 71 75 69 72 65 73 20 6e 6f 20 73 70    requires no sp
2490: 65 63 69 61 6c 20 6c 69 62 72 61 72 69 65 73 20  ecial libraries 
24a0: 6f 72 20 6f 74 68 65 72 20 73 6f 66 74 77 61 72  or other softwar
24b0: 65 20 74 6f 20 62 65 20 69 6e 73 74 61 6c 6c 65  e to be installe
24c0: 64 2e 20 20 48 6f 77 65 76 65 72 2c 0a 20 20 74  d.  However,.  t
24d0: 68 65 20 22 2d 2d 74 6b 22 20 6f 70 74 69 6f 6e  he "--tk" option
24e0: 20 74 6f 20 74 68 65 20 5b 2f 68 65 6c 70 2f 64   to the [/help/d
24f0: 69 66 66 7c 64 69 66 66 20 63 6f 6d 6d 61 6e 64  iff|diff command
2500: 5d 20 72 65 71 75 69 72 65 73 20 74 68 61 74 20  ] requires that 
2510: 54 63 6c 2f 54 6b 0a 20 20 62 65 20 69 6e 73 74  Tcl/Tk.  be inst
2520: 61 6c 6c 65 64 20 6f 6e 20 74 68 65 20 6c 6f 63  alled on the loc
2530: 61 6c 20 6d 61 63 68 69 6e 65 2e 20 20 59 6f 75  al machine.  You
2540: 20 63 61 6e 20 67 65 74 20 54 63 6c 2f 54 6b 20   can get Tcl/Tk 
2550: 66 72 6f 6d 0a 20 20 5b 68 74 74 70 3a 2f 2f 77  from.  [http://w
2560: 77 77 2e 61 63 74 69 76 65 73 74 61 74 65 2e 63  ww.activestate.c
2570: 6f 6d 2f 61 63 74 69 76 65 74 63 6c 7c 41 63 74  om/activetcl|Act
2580: 69 76 65 53 74 61 74 65 5d 2e 0a 0a 3c 6c 69 3e  iveState]...<li>
2590: 3c 70 3e 0a 20 20 54 6f 20 62 75 69 6c 64 20 6f  <p>.  To build o
25a0: 6e 20 6f 6c 64 65 72 20 4d 61 63 73 20 28 63 69  n older Macs (ci
25b0: 72 63 61 20 32 30 30 32 2c 20 4d 61 63 4f 53 20  rca 2002, MacOS 
25c0: 31 30 2e 32 29 20 65 64 69 74 20 74 68 65 20 4d  10.2) edit the M
25d0: 61 6b 65 66 69 6c 65 0a 20 20 67 65 6e 65 72 61  akefile.  genera
25e0: 74 65 64 20 62 79 20 63 6f 6e 66 69 67 75 72 65  ted by configure
25f0: 20 74 6f 20 61 64 64 20 74 68 65 20 66 6f 6c 6c   to add the foll
2600: 6f 77 69 6e 67 20 6c 69 6e 65 73 3a 0a 20 20 3c  owing lines:.  <
2610: 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c 70 72 65 3e  blockquote><pre>
2620: 0a 20 20 54 43 43 20 2b 3d 20 2d 44 53 51 4c 49  .  TCC += -DSQLI
2630: 54 45 5f 57 49 54 48 4f 55 54 5f 5a 4f 4e 45 4d  TE_WITHOUT_ZONEM
2640: 41 4c 4c 4f 43 0a 20 20 54 43 43 20 2b 3d 20 2d  ALLOC.  TCC += -
2650: 44 5f 42 53 44 5f 53 4f 55 52 43 45 0a 20 20 54  D_BSD_SOURCE.  T
2660: 43 43 20 2b 3d 20 2d 44 57 49 54 48 4f 55 54 5f  CC += -DWITHOUT_
2670: 49 43 4f 4e 56 0a 20 20 54 43 43 20 2b 3d 20 2d  ICONV.  TCC += -
2680: 44 73 6f 63 6b 65 74 6c 65 6e 5f 74 3d 69 6e 74  Dsocketlen_t=int
2690: 0a 20 20 54 43 43 20 2b 3d 20 2d 44 53 51 4c 49  .  TCC += -DSQLI
26a0: 54 45 5f 4d 41 58 5f 4d 4d 41 50 5f 53 49 5a 45  TE_MAX_MMAP_SIZE
26b0: 3d 30 0a 3c 2f 70 72 65 3e 3c 2f 62 6c 6f 63 6b  =0.</pre></block
26c0: 71 75 6f 74 65 3e 0a 3c 2f 75 6c 3e 0a 0a 0a 3c  quote>.</ul>...<
26d0: 68 32 20 69 64 3d 22 64 6f 63 6b 65 72 22 3e 35  h2 id="docker">5
26e0: 2e 30 20 42 75 69 6c 64 69 6e 67 20 61 20 44 6f  .0 Building a Do
26f0: 63 6b 65 72 20 43 6f 6e 74 61 69 6e 65 72 3c 2f  cker Container</
2700: 68 32 3e 0a 0a 46 6f 73 73 69 6c 20 73 68 69 70  h2>..Fossil ship
2710: 73 20 61 20 3c 74 74 3e 44 6f 63 6b 65 72 66 69  s a <tt>Dockerfi
2720: 6c 65 3c 2f 74 74 3e 20 61 74 20 74 68 65 20 74  le</tt> at the t
2730: 6f 70 20 6f 66 20 69 74 73 20 73 6f 75 72 63 65  op of its source
2740: 20 74 72 65 65 20 77 68 69 63 68 0a 79 6f 75 20   tree which.you 
2750: 63 61 6e 20 62 75 69 6c 64 20 6c 69 6b 65 20 73  can build like s
2760: 6f 3a 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 20  o:..<pre><code> 
2770: 20 24 20 64 6f 63 6b 65 72 20 62 75 69 6c 64 20   $ docker build 
2780: 2d 74 20 66 6f 73 73 69 6c 20 2e 3c 2f 63 6f 64  -t fossil .</cod
2790: 65 3e 3c 2f 70 72 65 3e 0a 0a 49 66 20 74 68 65  e></pre>..If the
27a0: 20 69 6d 61 67 65 20 62 75 69 6c 74 20 73 75 63   image built suc
27b0: 63 65 73 73 66 75 6c 6c 79 2c 20 79 6f 75 20 63  cessfully, you c
27c0: 61 6e 20 63 72 65 61 74 65 20 61 20 63 6f 6e 74  an create a cont
27d0: 61 69 6e 65 72 20 66 72 6f 6d 20 69 74 20 61 6e  ainer from it an
27e0: 64 0a 74 65 73 74 20 74 68 61 74 20 69 74 20 72  d.test that it r
27f0: 75 6e 73 3a 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65  uns:..<pre><code
2800: 3e 20 20 24 20 64 6f 63 6b 65 72 20 72 75 6e 20  >  $ docker run 
2810: 2d 2d 6e 61 6d 65 20 66 6f 73 73 69 6c 20 2d 70  --name fossil -p
2820: 20 39 39 39 39 3a 38 30 38 30 2f 74 63 70 20 66   9999:8080/tcp f
2830: 6f 73 73 69 6c 3c 2f 63 6f 64 65 3e 3c 2f 70 72  ossil</code></pr
2840: 65 3e 0a 0a 54 68 69 73 20 73 68 6f 77 73 20 75  e>..This shows u
2850: 73 20 72 65 6d 61 70 70 69 6e 67 20 74 68 65 20  s remapping the 
2860: 69 6e 74 65 72 6e 61 6c 20 54 43 50 20 6c 69 73  internal TCP lis
2870: 74 65 6e 69 6e 67 20 70 6f 72 74 20 61 73 20 39  tening port as 9
2880: 39 39 39 20 6f 6e 20 74 68 65 0a 68 6f 73 74 2e  999 on the.host.
2890: 20 41 73 20 61 20 72 75 6c 65 2c 20 74 68 65 72   As a rule, ther
28a0: 65 27 73 20 6c 69 74 74 6c 65 20 70 6f 69 6e 74  e's little point
28b0: 20 74 6f 20 75 73 69 6e 67 20 74 68 65 20 22 3c   to using the "<
28c0: 74 74 3e 66 6f 73 73 69 6c 20 73 65 72 76 65 72  tt>fossil server
28d0: 0a 2d 2d 70 6f 72 74 3c 2f 74 74 3e 22 20 66 65  .--port</tt>" fe
28e0: 61 74 75 72 65 20 69 6e 73 69 64 65 20 61 20 44  ature inside a D
28f0: 6f 63 6b 65 72 20 63 6f 6e 74 61 69 6e 65 72 2e  ocker container.
2900: 20 4c 65 74 20 69 74 20 64 65 66 61 75 6c 74 20   Let it default 
2910: 74 6f 20 38 30 38 30 0a 69 6e 74 65 72 6e 61 6c  to 8080.internal
2920: 6c 79 2c 20 74 68 65 6e 20 72 65 6d 61 70 20 69  ly, then remap i
2930: 74 20 74 6f 20 77 68 65 72 65 76 65 72 20 79 6f  t to wherever yo
2940: 75 20 77 61 6e 74 20 69 74 20 6f 6e 20 74 68 65  u want it on the
2950: 20 68 6f 73 74 20 69 6e 73 74 65 61 64 2e 0a 0a   host instead...
2960: 4f 75 72 20 73 74 6f 63 6b 20 3c 74 74 3e 44 6f  Our stock <tt>Do
2970: 63 6b 65 72 66 69 6c 65 3c 2f 74 74 3e 20 63 6f  ckerfile</tt> co
2980: 6e 66 69 67 75 72 65 73 20 46 6f 73 73 69 6c 20  nfigures Fossil 
2990: 77 69 74 68 20 74 68 65 20 64 65 66 61 75 6c 74  with the default
29a0: 20 66 65 61 74 75 72 65 0a 73 65 74 2c 20 73 6f   feature.set, so
29b0: 20 79 6f 75 20 6d 61 79 20 77 69 73 68 20 74 6f   you may wish to
29c0: 20 6d 6f 64 69 66 79 20 74 68 65 20 3c 74 74 3e   modify the <tt>
29d0: 44 6f 63 6b 65 72 66 69 6c 65 3c 2f 74 74 3e 20  Dockerfile</tt> 
29e0: 74 6f 20 61 64 64 0a 63 6f 6e 66 69 67 75 72 61  to add.configura
29f0: 74 69 6f 6e 20 6f 70 74 69 6f 6e 73 2c 20 61 64  tion options, ad
2a00: 64 20 41 50 4b 20 70 61 63 6b 61 67 65 73 20 74  d APK packages t
2a10: 6f 20 73 75 70 70 6f 72 74 20 74 68 6f 73 65 20  o support those 
2a20: 6f 70 74 69 6f 6e 73 2c 20 61 6e 64 20 73 6f 0a  options, and so.
2a30: 66 6f 72 74 68 2e 20 49 74 20 61 6c 73 6f 20 73  forth. It also s
2a40: 74 72 69 70 73 20 6f 75 74 20 61 6c 6c 20 62 75  trips out all bu
2a50: 74 20 74 68 65 20 64 65 66 61 75 6c 74 20 61 6e  t the default an
2a60: 64 20 64 61 72 6b 6d 6f 64 65 20 73 6b 69 6e 73  d darkmode skins
2a70: 20 74 6f 20 73 61 76 65 0a 65 78 65 63 75 74 61   to save.executa
2a80: 62 6c 65 20 73 70 61 63 65 2e 0a 0a 54 68 65 72  ble space...Ther
2a90: 65 20 61 72 65 20 74 77 6f 20 63 6f 6e 76 65 6e  e are two conven
2aa0: 69 65 6e 63 65 20 74 61 72 67 65 74 73 20 66 6f  ience targets fo
2ab0: 72 20 79 6f 75 2c 20 3c 74 74 3e 6d 61 6b 65 20  r you, <tt>make 
2ac0: 63 6f 6e 74 61 69 6e 65 72 2d 69 6d 61 67 65 3c  container-image<
2ad0: 2f 74 74 3e 0a 61 6e 64 20 3c 74 74 3e 6d 61 6b  /tt>.and <tt>mak
2ae0: 65 20 63 6f 6e 74 61 69 6e 65 72 2d 72 75 6e 3c  e container-run<
2af0: 2f 74 74 3e 2e 20 54 68 65 20 66 69 72 73 74 20  /tt>. The first 
2b00: 63 72 65 61 74 65 73 20 61 20 76 65 72 73 69 6f  creates a versio
2b10: 6e 65 64 20 63 6f 6e 74 61 69 6e 65 72 0a 69 6d  ned container.im
2b20: 61 67 65 2c 20 61 6e 64 20 74 68 65 20 73 65 63  age, and the sec
2b30: 6f 6e 64 20 64 6f 65 73 20 74 68 61 74 20 61 6e  ond does that an
2b40: 64 20 74 68 65 6e 20 6c 61 75 6e 63 68 65 73 20  d then launches 
2b50: 61 20 66 72 65 73 68 20 63 6f 6e 74 61 69 6e 65  a fresh containe
2b60: 72 0a 62 61 73 65 64 20 6f 6e 20 74 68 61 74 20  r.based on that 
2b70: 69 6d 61 67 65 2e 20 59 6f 75 20 63 61 6e 20 70  image. You can p
2b80: 61 73 73 20 65 78 74 72 61 20 61 72 67 75 6d 65  ass extra argume
2b90: 6e 74 73 20 74 6f 20 74 68 65 20 66 69 72 73 74  nts to the first
2ba0: 20 63 6f 6d 6d 61 6e 64 0a 76 69 61 20 74 68 65   command.via the
2bb0: 20 4d 61 6b 65 66 69 6c 65 27 73 20 3c 74 74 3e   Makefile's <tt>
2bc0: 44 42 46 4c 41 47 53 3c 2f 74 74 3e 20 76 61 72  DBFLAGS</tt> var
2bd0: 69 61 62 6c 65 20 61 6e 64 20 74 6f 20 74 68 65  iable and to the
2be0: 20 73 65 63 6f 6e 64 20 77 69 74 68 20 74 68 65   second with the
2bf0: 0a 3c 74 74 3e 44 52 46 4c 41 47 53 3c 2f 74 74  .<tt>DRFLAGS</tt
2c00: 3e 20 76 61 72 69 61 62 6c 65 2e 20 54 6f 20 67  > variable. To g
2c10: 65 74 20 74 68 65 20 63 75 73 74 6f 6d 20 70 6f  et the custom po
2c20: 72 74 20 73 65 74 74 69 6e 67 20 61 73 20 69 6e  rt setting as in
2c30: 20 73 65 63 6f 6e 64 0a 63 6f 6d 6d 61 6e 64 20   second.command 
2c40: 61 62 6f 76 65 2c 20 73 61 79 3a 0a 0a 3c 70 72  above, say:..<pr
2c50: 65 3e 3c 63 6f 64 65 3e 20 20 24 20 6d 61 6b 65  e><code>  $ make
2c60: 20 63 6f 6e 74 61 69 6e 65 72 2d 72 75 6e 20 44   container-run D
2c70: 52 46 4c 41 47 53 3d 27 2d 70 20 39 39 39 39 3a  RFLAGS='-p 9999:
2c80: 38 30 38 30 2f 74 63 70 27 3c 2f 63 6f 64 65 3e  8080/tcp'</code>
2c90: 3c 2f 70 72 65 3e 0a 0a 43 6f 6e 74 72 61 73 74  </pre>..Contrast
2ca0: 20 74 68 65 20 72 61 77 20 22 3c 74 74 3e 64 6f   the raw "<tt>do
2cb0: 63 6b 65 72 3c 2f 74 74 3e 22 20 63 6f 6d 6d 61  cker</tt>" comma
2cc0: 6e 64 73 20 61 62 6f 76 65 2c 20 77 68 69 63 68  nds above, which
2cd0: 20 63 72 65 61 74 65 20 61 6e 0a 3c 69 3e 75 6e   create an.<i>un
2ce0: 76 65 72 73 69 6f 6e 65 64 3c 2f 69 3e 20 69 6d  versioned</i> im
2cf0: 61 67 65 20 63 61 6c 6c 65 64 20 3c 74 74 3e 66  age called <tt>f
2d00: 6f 73 73 69 6c 3a 6c 61 74 65 73 74 3c 2f 74 74  ossil:latest</tt
2d10: 3e 20 61 6e 64 20 66 72 6f 6d 20 74 68 61 74 20  > and from that 
2d20: 61 0a 63 6f 6e 74 61 69 6e 65 72 20 73 69 6d 70  a.container simp
2d30: 6c 79 20 63 61 6c 6c 65 64 20 3c 74 74 3e 66 6f  ly called <tt>fo
2d40: 73 73 69 6c 3c 2f 74 74 3e 2e 20 54 68 65 20 75  ssil</tt>. The u
2d50: 6e 76 65 72 73 69 6f 6e 65 64 20 6e 61 6d 65 73  nversioned names
2d60: 20 61 72 65 20 6d 6f 72 65 0a 63 6f 6e 76 65 6e   are more.conven
2d70: 69 65 6e 74 20 66 6f 72 20 69 6e 74 65 72 61 63  ient for interac
2d80: 74 69 76 65 20 75 73 65 2c 20 77 68 69 6c 65 20  tive use, while 
2d90: 74 68 65 20 76 65 72 73 69 6f 6e 65 64 20 6f 6e  the versioned on
2da0: 65 73 20 61 72 65 20 67 6f 6f 64 20 66 6f 72 0a  es are good for.
2db0: 43 49 2f 43 44 20 74 79 70 65 20 61 70 70 6c 69  CI/CD type appli
2dc0: 63 61 74 69 6f 6e 73 20 73 69 6e 63 65 20 74 68  cations since th
2dd0: 65 79 20 61 76 6f 69 64 20 61 20 63 6f 6e 66 6c  ey avoid a confl
2de0: 69 63 74 20 77 69 74 68 20 70 61 73 74 20 76 65  ict with past ve
2df0: 72 73 69 6f 6e 73 3b 0a 69 74 20 6c 65 74 73 20  rsions;.it lets 
2e00: 79 6f 75 20 6b 65 65 70 20 6f 6c 64 20 63 6f 6e  you keep old con
2e10: 74 61 69 6e 65 72 73 20 61 72 6f 75 6e 64 20 66  tainers around f
2e20: 6f 72 20 71 75 69 63 6b 20 72 6f 6c 6c 2d 62 61  or quick roll-ba
2e30: 63 6b 73 20 77 68 69 6c 65 0a 72 65 70 6c 61 63  cks while.replac
2e40: 69 6e 67 20 74 68 65 6d 20 77 69 74 68 20 66 72  ing them with fr
2e50: 65 73 68 20 6f 6e 65 73 2e 0a 0a 0a 3c 68 33 20  esh ones....<h3 
2e60: 69 64 3d 22 64 6f 63 6b 65 72 2d 73 74 6f 72 61  id="docker-stora
2e70: 67 65 22 3e 35 2e 31 20 52 65 70 6f 73 69 74 6f  ge">5.1 Reposito
2e80: 72 79 20 53 74 6f 72 61 67 65 20 4f 70 74 69 6f  ry Storage Optio
2e90: 6e 73 3c 2f 68 33 3e 0a 0a 49 66 20 79 6f 75 20  ns</h3>..If you 
2ea0: 77 61 6e 74 20 74 68 65 20 63 6f 6e 74 61 69 6e  want the contain
2eb0: 65 72 20 74 6f 20 73 65 72 76 65 20 61 6e 20 65  er to serve an e
2ec0: 78 69 73 74 69 6e 67 20 72 65 70 6f 73 69 74 6f  xisting reposito
2ed0: 72 79 2c 20 74 68 65 72 65 20 61 72 65 20 61 74  ry, there are at
2ee0: 0a 6c 65 61 73 74 20 74 77 6f 20 72 69 67 68 74  .least two right
2ef0: 20 77 61 79 73 20 74 6f 20 64 6f 20 69 74 2e 0a   ways to do it..
2f00: 0a 54 68 65 20 77 72 6f 6e 67 20 77 61 79 20 69  .The wrong way i
2f10: 73 20 74 6f 20 75 73 65 20 74 68 65 20 3c 74 74  s to use the <tt
2f20: 3e 44 6f 63 6b 65 72 66 69 6c 65 20 43 4f 50 59  >Dockerfile COPY
2f30: 3c 2f 74 74 3e 20 63 6f 6d 6d 61 6e 64 20 74 6f  </tt> command to
2f40: 20 62 61 6b 65 20 69 74 0a 69 6e 74 6f 20 74 68   bake it.into th
2f50: 65 20 69 6d 61 67 65 20 61 74 20 62 75 69 6c 64  e image at build
2f60: 20 74 69 6d 65 2e 20 49 74 20 77 69 6c 6c 20 62   time. It will b
2f70: 65 63 6f 6d 65 20 6f 6e 65 20 6f 66 20 74 68 65  ecome one of the
2f80: 20 69 6d 61 67 65 27 73 20 62 61 73 65 0a 6c 61   image's base.la
2f90: 79 65 72 73 2c 20 73 6f 20 74 68 61 74 20 65 61  yers, so that ea
2fa0: 63 68 20 74 69 6d 65 20 79 6f 75 20 62 75 69 6c  ch time you buil
2fb0: 64 20 61 20 63 6f 6e 74 61 69 6e 65 72 20 66 72  d a container fr
2fc0: 6f 6d 20 74 68 61 74 20 69 6d 61 67 65 2c 20 74  om that image, t
2fd0: 68 65 0a 72 65 70 6f 20 67 65 74 73 20 72 65 73  he.repo gets res
2fe0: 65 74 20 74 6f 20 69 74 73 20 62 75 69 6c 64 2d  et to its build-
2ff0: 74 69 6d 65 20 73 74 61 74 65 2e 20 57 6f 72 73  time state. Wors
3000: 65 2c 20 72 65 73 74 61 72 74 69 6e 67 20 74 68  e, restarting th
3010: 65 20 63 6f 6e 74 61 69 6e 65 72 0a 77 69 6c 6c  e container.will
3020: 20 64 6f 20 74 68 65 20 73 61 6d 65 20 74 68 69   do the same thi
3030: 6e 67 2c 20 73 69 6e 63 65 20 74 68 65 20 62 61  ng, since the ba
3040: 73 65 20 69 6d 61 67 65 20 6c 61 79 65 72 73 20  se image layers 
3050: 61 72 65 20 69 6d 6d 75 74 61 62 6c 65 20 69 6e  are immutable in
3060: 0a 44 6f 63 6b 65 72 2e 20 54 68 69 73 20 69 73  .Docker. This is
3070: 20 61 6c 6d 6f 73 74 20 63 65 72 74 61 69 6e 6c   almost certainl
3080: 79 20 6e 6f 74 20 77 68 61 74 20 79 6f 75 20 77  y not what you w
3090: 61 6e 74 2e 0a 0a 54 68 65 20 63 6f 72 72 65 63  ant...The correc
30a0: 74 20 77 61 79 73 20 70 75 74 20 74 68 65 20 72  t ways put the r
30b0: 65 70 6f 20 69 6e 74 6f 20 74 68 65 20 3c 69 3e  epo into the <i>
30c0: 63 6f 6e 74 61 69 6e 65 72 3c 2f 69 3e 20 63 72  container</i> cr
30d0: 65 61 74 65 64 20 66 72 6f 6d 20 74 68 65 0a 3c  eated from the.<
30e0: 69 3e 69 6d 61 67 65 3c 2f 69 3e 2c 20 6e 6f 74  i>image</i>, not
30f0: 20 69 6e 20 74 68 65 20 69 6d 61 67 65 20 69 74   in the image it
3100: 73 65 6c 66 2e 0a 0a 0a 3c 68 34 3e 35 2e 31 2e  self....<h4>5.1.
3110: 31 20 53 74 6f 72 69 6e 67 20 74 68 65 20 52 65  1 Storing the Re
3120: 70 6f 20 49 6e 73 69 64 65 20 74 68 65 20 43 6f  po Inside the Co
3130: 6e 74 61 69 6e 65 72 3c 2f 68 34 3e 0a 0a 54 68  ntainer</h4>..Th
3140: 65 20 73 69 6d 70 6c 65 73 74 20 6d 65 74 68 6f  e simplest metho
3150: 64 20 69 73 20 74 6f 20 73 74 6f 70 20 74 68 65  d is to stop the
3160: 20 63 6f 6e 74 61 69 6e 65 72 20 69 66 20 69 74   container if it
3170: 20 77 61 73 20 72 75 6e 6e 69 6e 67 2c 0a 74 68   was running,.th
3180: 65 6e 20 73 61 79 3a 0a 0a 3c 70 72 65 3e 3c 63  en say:..<pre><c
3190: 6f 64 65 3e 20 20 24 20 64 6f 63 6b 65 72 20 63  ode>  $ docker c
31a0: 70 20 2f 70 61 74 68 2f 74 6f 2f 6d 79 2d 70 72  p /path/to/my-pr
31b0: 6f 6a 65 63 74 2e 66 6f 73 73 69 6c 20 66 6f 73  oject.fossil fos
31c0: 73 69 6c 3a 2f 6a 61 69 6c 2f 6d 75 73 65 75 6d  sil:/jail/museum
31d0: 2f 72 65 70 6f 2e 66 6f 73 73 69 6c 0a 20 20 24  /repo.fossil.  $
31e0: 20 64 6f 63 6b 65 72 20 73 74 61 72 74 20 66 6f   docker start fo
31f0: 73 73 69 6c 0a 20 20 24 20 64 6f 63 6b 65 72 20  ssil.  $ docker 
3200: 65 78 65 63 20 66 6f 73 73 69 6c 20 63 68 6f 77  exec fossil chow
3210: 6e 20 2d 52 20 34 39 39 20 2f 6a 61 69 6c 2f 6d  n -R 499 /jail/m
3220: 75 73 65 75 6d 3c 2f 63 6f 64 65 3e 3c 2f 70 72  useum</code></pr
3230: 65 3e 0a 0a 54 68 61 74 20 63 6f 70 69 65 73 20  e>..That copies 
3240: 74 68 65 20 6c 6f 63 61 6c 20 46 6f 73 73 69 6c  the local Fossil
3250: 20 72 65 70 6f 20 69 6e 74 6f 20 74 68 65 20 63   repo into the c
3260: 6f 6e 74 61 69 6e 65 72 20 77 68 65 72 65 20 74  ontainer where t
3270: 68 65 20 73 65 72 76 65 72 0a 65 78 70 65 63 74  he server.expect
3280: 73 20 74 6f 20 66 69 6e 64 20 69 74 2c 20 73 6f  s to find it, so
3290: 20 74 68 61 74 20 74 68 65 20 22 73 74 61 72 74   that the "start
32a0: 22 20 63 6f 6d 6d 61 6e 64 20 63 61 75 73 65 73  " command causes
32b0: 20 69 74 20 74 6f 20 73 65 72 76 65 20 66 72 6f   it to serve fro
32c0: 6d 0a 74 68 61 74 20 63 6f 70 69 65 64 2d 69 6e  m.that copied-in
32d0: 20 66 69 6c 65 20 69 6e 73 74 65 61 64 2e 20 53   file instead. S
32e0: 69 6e 63 65 20 69 74 20 6c 69 76 65 73 20 61 74  ince it lives at
32f0: 6f 70 20 74 68 65 20 69 6d 6d 75 74 61 62 6c 65  op the immutable
3300: 20 62 61 73 65 20 6c 61 79 65 72 73 2c 20 69 74   base layers, it
3310: 0a 70 65 72 73 69 73 74 73 20 61 73 20 70 61 72  .persists as par
3320: 74 20 6f 66 20 74 68 65 20 63 6f 6e 74 61 69 6e  t of the contain
3330: 65 72 20 70 72 6f 70 65 72 2c 20 73 75 72 76 69  er proper, survi
3340: 76 69 6e 67 20 72 65 73 74 61 72 74 73 2e 0a 0a  ving restarts...
3350: 28 54 68 65 20 73 61 6d 65 20 69 73 20 74 72 75  (The same is tru
3360: 65 20 6f 66 20 74 68 65 20 64 65 66 61 75 6c 74  e of the default
3370: 20 6d 6f 64 65 20 6f 66 20 6f 70 65 72 61 74 69   mode of operati
3380: 6f 6e 3a 20 74 68 65 20 3c 74 74 3e 66 6f 73 73  on: the <tt>foss
3390: 69 6c 0a 73 65 72 76 65 72 20 2d 2d 63 72 65 61  il.server --crea
33a0: 74 65 3c 2f 74 74 3e 20 66 6c 61 67 20 69 6e 69  te</tt> flag ini
33b0: 74 69 61 6c 69 7a 65 73 20 61 20 66 72 65 73 68  tializes a fresh
33c0: 20 46 6f 73 73 69 6c 20 72 65 70 6f 20 61 74 6f   Fossil repo ato
33d0: 70 20 74 68 65 20 62 61 73 65 0a 69 6d 61 67 65  p the base.image
33e0: 2e 29 0a 0a 4e 6f 74 69 63 65 20 74 68 61 74 20  .)..Notice that 
33f0: 74 68 65 20 63 6f 70 79 20 63 6f 6d 6d 61 6e 64  the copy command
3400: 20 63 68 61 6e 67 65 73 20 74 68 65 20 6e 61 6d   changes the nam
3410: 65 20 6f 66 20 74 68 65 20 72 65 70 6f 73 69 74  e of the reposit
3420: 6f 72 79 20 64 61 74 61 62 61 73 65 2e 0a 54 68  ory database..Th
3430: 65 20 63 6f 6e 74 61 69 6e 65 72 20 63 6f 6e 66  e container conf
3440: 69 67 75 72 61 74 69 6f 6e 20 65 78 70 65 63 74  iguration expect
3450: 73 20 69 74 20 74 6f 20 62 65 20 63 61 6c 6c 65  s it to be calle
3460: 64 0a 3c 74 74 3e 72 65 70 6f 2e 66 6f 73 73 69  d.<tt>repo.fossi
3470: 6c 3c 2f 74 74 3e 2c 20 77 68 69 63 68 20 69 74  l</tt>, which it
3480: 20 61 6c 6d 6f 73 74 20 63 65 72 74 61 69 6e 6c   almost certainl
3490: 79 20 77 61 73 20 6e 6f 74 20 6f 75 74 20 6f 6e  y was not out on
34a0: 20 74 68 65 20 68 6f 73 74 0a 73 79 73 74 65 6d   the host.system
34b0: 2e 20 54 68 69 73 20 69 73 20 62 65 63 61 75 73  . This is becaus
34c0: 65 20 74 68 65 72 65 20 69 73 20 6f 6e 6c 79 20  e there is only 
34d0: 6f 6e 65 20 72 65 70 6f 73 69 74 6f 72 79 20 69  one repository i
34e0: 6e 73 69 64 65 20 74 68 69 73 0a 63 6f 6e 74 61  nside this.conta
34f0: 69 6e 65 72 2c 20 73 6f 20 77 65 20 64 6f 6e 27  iner, so we don'
3500: 74 20 68 61 76 65 20 74 6f 20 6e 61 6d 65 20 69  t have to name i
3510: 74 20 61 66 74 65 72 20 74 68 65 20 70 72 6f 6a  t after the proj
3520: 65 63 74 20 69 74 20 63 6f 6e 74 61 69 6e 73 2c  ect it contains,
3530: 20 61 73 0a 69 73 20 74 72 61 64 69 74 69 6f 6e   as.is tradition
3540: 61 6c 2e 20 41 20 67 65 6e 65 72 69 63 20 6e 61  al. A generic na
3550: 6d 65 20 6c 65 74 73 20 75 73 20 68 61 72 64 2d  me lets us hard-
3560: 63 6f 64 65 20 74 68 65 20 73 65 72 76 65 72 20  code the server 
3570: 73 74 61 72 74 0a 63 6f 6d 6d 61 6e 64 2e 0a 0a  start.command...
3580: 49 66 20 79 6f 75 20 73 6b 69 70 20 74 68 65 20  If you skip the 
3590: 22 63 68 6f 77 6e 22 20 63 6f 6d 6d 61 6e 64 20  "chown" command 
35a0: 61 62 6f 76 65 20 61 6e 64 20 70 75 74 20 22 68  above and put "h
35b0: 74 74 70 3a 2f 2f 6c 6f 63 61 6c 68 6f 73 74 3a  ttp://localhost:
35c0: 39 39 39 39 2f 22 20 69 6e 74 6f 0a 79 6f 75 72  9999/" into.your
35d0: 20 62 72 6f 77 73 65 72 2c 20 65 78 70 65 63 74   browser, expect
35e0: 69 6e 67 20 74 6f 20 73 65 65 20 74 68 65 20 63  ing to see the c
35f0: 6f 70 69 65 64 2d 69 6e 20 72 65 70 6f 27 73 20  opied-in repo's 
3600: 68 6f 6d 65 20 70 61 67 65 2c 20 79 6f 75 20 77  home page, you w
3610: 69 6c 6c 0a 67 65 74 20 61 6e 20 6f 70 61 71 75  ill.get an opaqu
3620: 65 20 22 4e 6f 74 20 46 6f 75 6e 64 22 20 65 72  e "Not Found" er
3630: 72 6f 72 2e 20 54 68 69 73 20 69 73 20 62 65 63  ror. This is bec
3640: 61 75 73 65 20 74 68 65 20 75 73 65 72 20 61 6e  ause the user an
3650: 64 0a 67 72 6f 75 70 20 49 44 20 6f 66 20 74 68  d.group ID of th
3660: 65 20 66 69 6c 65 20 77 69 6c 6c 20 62 65 20 74  e file will be t
3670: 68 61 74 20 6f 66 20 79 6f 75 72 20 6c 6f 63 61  hat of your loca
3680: 6c 20 75 73 65 72 20 6f 6e 20 74 68 65 20 63 6f  l user on the co
3690: 6e 74 61 69 6e 65 72 27 73 0a 68 6f 73 74 20 6d  ntainer's.host m
36a0: 61 63 68 69 6e 65 2c 20 77 68 69 63 68 20 69 73  achine, which is
36b0: 20 75 6e 6c 69 6b 65 6c 79 20 74 6f 20 6d 61 70   unlikely to map
36c0: 20 74 6f 20 61 6e 79 74 68 69 6e 67 20 69 6e 20   to anything in 
36d0: 74 68 65 20 63 6f 6e 74 61 69 6e 65 72 27 73 0a  the container's.
36e0: 3c 74 74 3e 2f 65 74 63 2f 70 61 73 73 77 64 3c  <tt>/etc/passwd<
36f0: 2f 74 74 3e 20 61 6e 64 20 3c 74 74 3e 2f 65 74  /tt> and <tt>/et
3700: 63 2f 67 72 6f 75 70 3c 2f 74 74 3e 20 66 69 6c  c/group</tt> fil
3710: 65 73 2c 20 65 66 66 65 63 74 69 76 65 6c 79 0a  es, effectively.
3720: 70 72 65 76 65 6e 74 69 6e 67 20 74 68 65 20 73  preventing the s
3730: 65 72 76 65 72 20 66 72 6f 6d 20 72 65 61 64 69  erver from readi
3740: 6e 67 20 74 68 65 20 63 6f 70 69 65 64 2d 69 6e  ng the copied-in
3750: 20 72 65 70 6f 73 69 74 6f 72 79 20 66 69 6c 65   repository file
3760: 2e 0a 34 39 39 20 69 73 20 74 68 65 20 64 65 66  ..499 is the def
3770: 61 75 6c 74 20 22 66 6f 73 73 69 6c 22 20 75 73  ault "fossil" us
3780: 65 72 20 49 44 20 69 6e 73 69 64 65 20 74 68 65  er ID inside the
3790: 20 63 6f 6e 74 61 69 6e 65 72 2c 20 63 61 75 73   container, caus
37a0: 69 6e 67 20 46 6f 73 73 69 6c 20 74 6f 20 72 75  ing Fossil to ru
37b0: 6e 0a 77 69 74 68 20 74 68 61 74 20 75 73 65 72  n.with that user
37c0: 27 73 20 70 72 69 76 69 6c 65 67 65 73 20 61 66  's privileges af
37d0: 74 65 72 20 69 74 20 65 6e 74 65 72 73 20 74 68  ter it enters th
37e0: 65 20 63 68 72 6f 6f 74 2e 0a 28 53 65 65 20 5b  e chroot..(See [
37f0: 23 64 6f 63 6b 65 72 2d 61 72 67 73 20 7c 20 62  #docker-args | b
3800: 65 6c 6f 77 5d 20 66 6f 72 20 68 6f 77 20 74 6f  elow] for how to
3810: 20 63 68 61 6e 67 65 20 74 68 69 73 20 64 65 66   change this def
3820: 61 75 6c 74 2e 29 0a 59 6f 75 20 64 6f 6e 27 74  ault.).You don't
3830: 20 68 61 76 65 20 74 6f 20 72 65 73 74 61 72 74   have to restart
3840: 20 74 68 65 20 73 65 72 76 65 72 20 61 66 74 65   the server afte
3850: 72 20 66 69 78 69 6e 67 20 74 68 69 73 20 77 69  r fixing this wi
3860: 74 68 0a 3c 74 74 3e 63 68 6d 6f 64 3c 2f 74 74  th.<tt>chmod</tt
3870: 3e 3a 20 73 69 6d 70 6c 79 20 72 65 6c 6f 61 64  >: simply reload
3880: 20 74 68 65 20 62 72 6f 77 73 65 72 2c 20 61 6e   the browser, an
3890: 64 20 46 6f 73 73 69 6c 20 77 69 6c 6c 20 74 72  d Fossil will tr
38a0: 79 20 61 67 61 69 6e 2e 0a 0a 0a 3c 68 34 3e 35  y again....<h4>5
38b0: 2e 31 2e 32 20 53 74 6f 72 69 6e 67 20 74 68 65  .1.2 Storing the
38c0: 20 52 65 70 6f 20 4f 75 74 73 69 64 65 20 74 68   Repo Outside th
38d0: 65 20 43 6f 6e 74 61 69 6e 65 72 3c 2f 68 34 3e  e Container</h4>
38e0: 0a 0a 54 68 65 20 73 69 6d 70 6c 65 20 73 74 6f  ..The simple sto
38f0: 72 61 67 65 20 6d 65 74 68 6f 64 20 61 62 6f 76  rage method abov
3900: 65 20 68 61 73 20 61 20 70 72 6f 62 6c 65 6d 3a  e has a problem:
3910: 20 44 6f 63 6b 65 72 20 63 6f 6e 74 61 69 6e 65   Docker containe
3920: 72 73 20 61 72 65 20 64 65 73 69 67 6e 65 64 20  rs are designed 
3930: 74 6f 20 62 65 0a 6b 69 6c 6c 65 64 20 6f 66 66  to be.killed off
3940: 20 61 74 20 74 68 65 20 73 6c 69 67 68 74 65 73   at the slightes
3950: 74 20 63 61 75 73 65 2c 20 72 65 62 75 69 6c 74  t cause, rebuilt
3960: 2c 20 61 6e 64 20 72 65 64 65 70 6c 6f 79 65 64  , and redeployed
3970: 2e 20 49 66 20 79 6f 75 20 64 6f 0a 74 68 61 74  . If you do.that
3980: 20 77 69 74 68 20 74 68 65 20 72 65 70 6f 20 69   with the repo i
3990: 6e 73 69 64 65 20 74 68 65 20 63 6f 6e 74 61 69  nside the contai
39a0: 6e 65 72 2c 20 69 74 20 67 65 74 73 20 64 65 73  ner, it gets des
39b0: 74 72 6f 79 65 64 2c 20 74 6f 6f 2e 20 54 68 65  troyed, too. The
39c0: 0a 73 6f 6c 75 74 69 6f 6e 20 69 73 20 74 6f 20  .solution is to 
39d0: 72 65 70 6c 61 63 65 20 74 68 65 20 22 72 75 6e  replace the "run
39e0: 22 20 63 6f 6d 6d 61 6e 64 20 61 62 6f 76 65 20  " command above 
39f0: 77 69 74 68 20 74 68 65 20 66 6f 6c 6c 6f 77 69  with the followi
3a00: 6e 67 3a 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e  ng:..<pre><code>
3a10: 20 20 24 20 64 6f 63 6b 65 72 20 63 72 65 61 74    $ docker creat
3a20: 65 20 5c 0a 20 20 20 20 2d 2d 6e 61 6d 65 20 66  e \.    --name f
3a30: 6f 73 73 69 6c 20 2d 70 20 39 39 39 39 3a 38 30  ossil -p 9999:80
3a40: 38 30 2f 74 63 70 20 5c 0a 20 20 20 20 2d 76 20  80/tcp \.    -v 
3a50: 6d 75 73 65 75 6d 3a 2f 6a 61 69 6c 2f 6d 75 73  museum:/jail/mus
3a60: 65 75 6d 20 66 6f 73 73 69 6c 0a 3c 2f 63 6f 64  eum fossil.</cod
3a70: 65 3e 3c 2f 70 72 65 3e 0a 0a 4e 6f 77 20 77 68  e></pre>..Now wh
3a80: 65 6e 20 79 6f 75 20 22 64 6f 63 6b 65 72 20 63  en you "docker c
3a90: 70 22 20 74 68 65 20 6c 6f 63 61 6c 20 72 65 70  p" the local rep
3aa0: 6f 20 69 6e 74 6f 20 74 68 65 20 63 6f 6e 74 61  o into the conta
3ab0: 69 6e 65 72 2c 20 69 74 20 6c 61 6e 64 73 20 6f  iner, it lands o
3ac0: 6e 0a 61 20 73 65 70 61 72 61 74 65 20 5b 68 74  n.a separate [ht
3ad0: 74 70 73 3a 2f 2f 64 6f 63 73 2e 64 6f 63 6b 65  tps://docs.docke
3ae0: 72 2e 63 6f 6d 2f 73 74 6f 72 61 67 65 2f 76 6f  r.com/storage/vo
3af0: 6c 75 6d 65 73 2f 20 7c 20 44 6f 63 6b 65 72 20  lumes/ | Docker 
3b00: 76 6f 6c 75 6d 65 5d 0a 6d 6f 75 6e 74 65 64 20  volume].mounted 
3b10: 69 6e 73 69 64 65 20 69 74 2c 20 67 69 76 69 6e  inside it, givin
3b20: 67 20 74 68 6f 73 65 20 66 69 6c 65 73 20 61 6e  g those files an
3b30: 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 6c 69 66   independent lif
3b40: 65 74 69 6d 65 2e 20 20 57 68 65 6e 20 79 6f 75  etime.  When you
3b50: 20 6e 65 65 64 20 74 6f 0a 72 65 62 75 69 6c 64   need to.rebuild
3b60: 20 74 68 65 20 63 6f 6e 74 61 69 6e 65 72 20 6f   the container o
3b70: 72 20 69 74 73 20 75 6e 64 65 72 6c 79 69 6e 67  r its underlying
3b80: 20 69 6d 61 67 65 20 e2 80 94 20 73 75 63 68 20   image — such 
3b90: 61 73 20 74 6f 20 75 70 67 72 61 64 65 20 74 6f  as to upgrade to
3ba0: 20 61 20 6e 65 77 65 72 20 76 65 72 73 69 6f 6e   a newer version
3bb0: 20 6f 66 20 46 6f 73 73 69 6c 0a e2 80 94 20 74   of Fossil.— t
3bc0: 68 65 20 76 6f 6c 75 6d 65 20 72 65 6d 61 69 6e  he volume remain
3bd0: 73 20 62 65 68 69 6e 64 20 61 6e 64 20 67 65 74  s behind and get
3be0: 73 20 72 65 6d 61 70 70 65 64 20 69 6e 74 6f 20  s remapped into 
3bf0: 74 68 65 20 6e 65 77 20 63 6f 6e 74 61 69 6e 65  the new containe
3c00: 72 0a 77 68 65 6e 20 79 6f 75 20 72 65 63 72 65  r.when you recre
3c10: 61 74 65 20 69 74 20 62 79 20 67 69 76 69 6e 67  ate it by giving
3c20: 20 74 68 65 20 61 62 6f 76 65 20 63 6f 6d 6d 61   the above comma
3c30: 6e 64 20 61 67 61 69 6e 2e 0a 0a 0a 3c 68 33 20  nd again....<h3 
3c40: 69 64 3d 22 64 6f 63 6b 65 72 2d 63 68 72 6f 6f  id="docker-chroo
3c50: 74 22 3e 35 2e 32 20 57 68 79 20 43 68 72 6f 6f  t">5.2 Why Chroo
3c60: 74 3f 3c 2f 68 33 3e 0a 0a 41 20 70 6f 74 65 6e  t?</h3>..A poten
3c70: 74 69 61 6c 6c 79 20 73 75 72 70 72 69 73 69 6e  tially surprisin
3c80: 67 20 66 65 61 74 75 72 65 20 6f 66 20 74 68 69  g feature of thi
3c90: 73 20 63 6f 6e 74 61 69 6e 65 72 20 69 73 20 74  s container is t
3ca0: 68 61 74 20 69 74 20 72 75 6e 73 0a 46 6f 73 73  hat it runs.Foss
3cb0: 69 6c 20 61 73 20 72 6f 6f 74 2e 20 53 69 6e 63  il as root. Sinc
3cc0: 65 20 74 68 61 74 20 63 61 75 73 65 73 20 5b 2e  e that causes [.
3cd0: 2f 63 68 72 6f 6f 74 2e 6d 64 20 7c 20 46 6f 73  /chroot.md | Fos
3ce0: 73 69 6c 27 73 20 63 68 72 6f 6f 74 20 6a 61 69  sil's chroot jai
3cf0: 6c 0a 66 65 61 74 75 72 65 5d 20 74 6f 20 6b 69  l.feature] to ki
3d00: 63 6b 20 69 6e 2c 20 61 6e 64 20 61 20 44 6f 63  ck in, and a Doc
3d10: 6b 65 72 20 63 6f 6e 74 61 69 6e 65 72 20 69 73  ker container is
3d20: 20 61 20 74 79 70 65 20 6f 66 20 c3 bc 62 65 72   a type of über
3d30: 2d 6a 61 69 6c 0a 61 6c 72 65 61 64 79 2c 20 79  -jail.already, y
3d40: 6f 75 20 6d 61 79 20 62 65 20 77 6f 6e 64 65 72  ou may be wonder
3d50: 69 6e 67 20 77 68 79 20 77 65 20 64 6f 6e 27 74  ing why we don't
3d60: 20 65 69 74 68 65 72 3a 0a 0a 20 20 23 20 20 72   either:..  #  r
3d70: 75 6e 20 3c 74 74 3e 66 6f 73 73 69 6c 20 73 65  un <tt>fossil se
3d80: 72 76 65 72 20 2d 2d 6e 6f 6a 61 69 6c 3c 2f 74  rver --nojail</t
3d90: 74 3e 20 74 6f 20 73 6b 69 70 20 74 68 65 20 69  t> to skip the i
3da0: 6e 74 65 72 6e 61 6c 20 63 68 72 6f 6f 74 3b 20  nternal chroot; 
3db0: 6f 72 0a 20 20 23 20 20 73 65 74 20 22 3c 74 74  or.  #  set "<tt
3dc0: 3e 55 53 45 52 20 66 6f 73 73 69 6c 3c 2f 74 74  >USER fossil</tt
3dd0: 3e 22 20 69 6e 20 74 68 65 20 44 6f 63 6b 65 72  >" in the Docker
3de0: 66 69 6c 65 20 73 6f 20 69 74 20 73 74 61 72 74  file so it start
3df0: 73 20 46 6f 73 73 69 6c 20 61 73 0a 20 20 20 20  s Fossil as.    
3e00: 20 74 68 61 74 20 75 73 65 72 20 69 6e 73 74 65   that user inste
3e10: 61 64 0a 0a 54 68 65 20 72 65 61 73 6f 6e 20 69  ad..The reason i
3e20: 73 2c 20 61 6c 74 68 6f 75 67 68 20 74 68 69 73  s, although this
3e30: 20 63 6f 6e 74 61 69 6e 65 72 20 69 73 20 71 75   container is qu
3e40: 69 74 65 20 73 74 72 69 70 70 65 64 2d 64 6f 77  ite stripped-dow
3e50: 6e 20 62 79 20 74 6f 64 61 79 27 73 0a 73 74 61  n by today's.sta
3e60: 6e 64 61 72 64 73 2c 20 69 74 27 73 20 62 61 73  ndards, it's bas
3e70: 65 64 20 6f 6e 20 74 68 65 20 5b 68 74 74 70 73  ed on the [https
3e80: 3a 2f 2f 77 77 77 2e 62 75 73 79 62 6f 78 2e 6e  ://www.busybox.n
3e90: 65 74 2f 42 75 73 79 42 6f 78 2e 68 74 6d 6c 20  et/BusyBox.html 
3ea0: 7c 0a 73 75 72 70 72 69 73 69 6e 67 6c 79 20 70  |.surprisingly p
3eb0: 6f 77 65 72 66 75 6c 20 42 75 73 79 62 6f 78 20  owerful Busybox 
3ec0: 70 72 6f 6a 65 63 74 5d 2e 20 20 28 54 68 69 73  project].  (This
3ed0: 20 61 75 74 68 6f 72 20 6d 61 64 65 20 61 20 6c   author made a l
3ee0: 69 76 69 6e 67 20 66 6f 72 0a 79 65 61 72 73 20  iving for.years 
3ef0: 69 6e 20 74 68 65 20 65 61 72 6c 79 20 31 39 39  in the early 199
3f00: 30 73 20 75 73 69 6e 67 20 55 6e 69 78 20 73 79  0s using Unix sy
3f10: 73 74 65 6d 73 20 74 68 61 74 20 77 65 72 65 20  stems that were 
3f20: 6c 65 73 73 20 70 6f 77 65 72 66 75 6c 20 74 68  less powerful th
3f30: 61 6e 0a 74 68 69 73 20 63 6f 6e 74 61 69 6e 65  an.this containe
3f40: 72 2e 29 20 49 66 20 73 6f 6d 65 6f 6e 65 20 65  r.) If someone e
3f50: 76 65 72 20 66 69 67 75 72 65 64 20 6f 75 74 20  ver figured out 
3f60: 68 6f 77 20 74 6f 20 6d 61 6b 65 20 61 20 46 6f  how to make a Fo
3f70: 73 73 69 6c 20 62 69 6e 61 72 79 0a 65 78 65 63  ssil binary.exec
3f80: 75 74 65 20 61 72 62 69 74 72 61 72 79 20 63 6f  ute arbitrary co
3f90: 6d 6d 61 6e 64 73 20 6f 6e 20 74 68 65 20 68 6f  mmands on the ho
3fa0: 73 74 20 6f 72 20 74 6f 20 6f 70 65 6e 20 75 70  st or to open up
3fb0: 20 61 20 72 65 6d 6f 74 65 20 73 68 65 6c 6c 2c   a remote shell,
3fc0: 0a 74 68 65 79 27 64 20 6c 69 6b 65 6c 79 20 62  .they'd likely b
3fd0: 65 20 61 62 6c 65 20 74 6f 20 69 73 6c 61 6e 64  e able to island
3fe0: 2d 68 6f 70 20 66 72 6f 6d 20 74 68 65 72 65 20  -hop from there 
3ff0: 69 6e 74 6f 20 74 68 65 20 72 65 73 74 20 6f 66  into the rest of
4000: 20 79 6f 75 72 0a 6e 65 74 77 6f 72 6b 2e 20 57   your.network. W
4010: 65 20 6e 65 65 64 20 74 68 69 73 20 63 75 74 65  e need this cute
4020: 20 64 6f 75 62 6c 65 2d 6a 61 69 6c 20 64 61 6e   double-jail dan
4030: 63 65 20 74 6f 20 6b 65 65 70 20 74 68 65 20 46  ce to keep the F
4040: 6f 73 73 69 6c 20 69 6e 73 74 61 6e 63 65 0a 66  ossil instance.f
4050: 72 6f 6d 20 61 63 63 65 73 73 69 6e 67 20 74 68  rom accessing th
4060: 65 20 42 75 73 79 62 6f 78 20 66 65 61 74 75 72  e Busybox featur
4070: 65 73 2e 0a 0a 57 65 20 64 65 65 6d 20 74 68 69  es...We deem thi
4080: 73 20 72 69 73 6b 20 6c 6f 77 20 73 69 6e 63 65  s risk low since
4090: 20 61 29 20 69 74 27 73 20 6e 65 76 65 72 20 68   a) it's never h
40a0: 61 70 70 65 6e 65 64 2c 20 74 68 61 74 20 77 65  appened, that we
40b0: 20 6b 6e 6f 77 20 6f 66 3b 0a 61 6e 64 20 62 29   know of;.and b)
40c0: 20 77 65 27 76 65 20 74 75 72 6e 65 64 20 6f 66   we've turned of
40d0: 66 20 61 6c 6c 20 6f 66 20 74 68 65 20 72 69 73  f all of the ris
40e0: 6b 79 20 66 65 61 74 75 72 65 73 20 6c 69 6b 65  ky features like
40f0: 20 54 48 31 20 64 6f 63 73 2e 0a 4e 65 76 65 72   TH1 docs..Never
4100: 74 68 65 6c 65 73 73 2c 20 77 65 20 62 65 6c 69  theless, we beli
4110: 65 76 65 20 69 6e 20 64 65 66 65 6e 73 65 2d 69  eve in defense-i
4120: 6e 2d 64 65 70 74 68 2e 0a 0a 49 66 20 79 6f 75  n-depth...If you
4130: 20 73 68 65 6c 6c 20 69 6e 74 6f 20 74 68 65 20   shell into the 
4140: 63 6f 6e 74 61 69 6e 65 72 20 61 6e 64 20 64 6f  container and do
4150: 20 61 20 3c 74 74 3e 70 73 3c 2f 74 74 3e 2c 20   a <tt>ps</tt>, 
4160: 79 6f 75 27 6c 6c 20 66 69 6e 64 0a 3c 74 74 3e  you'll find.<tt>
4170: 66 6f 73 73 69 6c 3c 2f 74 74 3e 20 72 75 6e 6e  fossil</tt> runn
4180: 69 6e 67 20 61 73 20 3c 74 74 3e 72 6f 6f 74 3c  ing as <tt>root<
4190: 2f 74 74 3e 2e 20 57 68 79 3f 20 42 65 63 61 75  /tt>. Why? Becau
41a0: 73 65 20 74 68 61 74 27 73 20 74 68 65 20 70 61  se that's the pa
41b0: 72 65 6e 74 0a 70 72 6f 63 65 73 73 2c 20 77 68  rent.process, wh
41c0: 69 63 68 20 6d 61 79 20 6e 65 65 64 20 74 6f 20  ich may need to 
41d0: 64 6f 20 72 6f 6f 74 6c 79 20 74 68 69 6e 67 73  do rootly things
41e0: 20 6c 69 6b 65 20 6c 69 73 74 65 6e 69 6e 67 20   like listening 
41f0: 6f 6e 20 70 6f 72 74 20 38 30 20 6f 72 0a 34 34  on port 80 or.44
4200: 33 2e 20 46 6f 73 73 69 6c 27 73 20 63 68 72 6f  3. Fossil's chro
4210: 6f 74 20 66 65 61 74 75 72 65 20 74 61 6b 65 73  ot feature takes
4220: 20 65 66 66 65 63 74 20 69 6e 20 74 68 65 20 63   effect in the c
4230: 68 69 6c 64 20 70 72 6f 63 65 73 73 65 73 20 66  hild processes f
4240: 6f 72 6b 65 64 0a 6f 66 66 20 74 6f 20 68 61 6e  orked.off to han
4250: 64 6c 65 20 65 61 63 68 20 48 54 54 50 2f 43 47  dle each HTTP/CG
4260: 49 20 68 69 74 2e 20 54 68 69 73 20 69 73 20 77  I hit. This is w
4270: 68 79 20 79 6f 75 20 63 61 6e 20 66 69 78 20 62  hy you can fix b
4280: 72 6f 6b 65 6e 0a 70 65 72 6d 69 73 73 69 6f 6e  roken.permission
4290: 73 20 77 69 74 68 20 3c 74 74 3e 63 68 6f 77 6e  s with <tt>chown
42a0: 3c 2f 74 74 3e 20 61 66 74 65 72 20 74 68 65 20  </tt> after the 
42b0: 63 6f 6e 74 61 69 6e 65 72 20 69 73 20 61 6c 72  container is alr
42c0: 65 61 64 79 20 72 75 6e 6e 69 6e 67 2c 0a 77 69  eady running,.wi
42d0: 74 68 6f 75 74 20 72 65 73 74 61 72 74 69 6e 67  thout restarting
42e0: 20 69 74 3a 20 65 61 63 68 20 68 69 74 20 72 65   it: each hit re
42f0: 65 76 61 6c 75 61 74 65 73 20 74 68 65 20 72 65  evaluates the re
4300: 70 6f 73 69 74 6f 72 79 20 66 69 6c 65 0a 70 65  pository file.pe
4310: 72 6d 69 73 73 69 6f 6e 73 20 77 68 65 6e 20 64  rmissions when d
4320: 65 63 69 64 69 6e 67 20 77 68 61 74 20 75 73 65  eciding what use
4330: 72 20 74 6f 20 62 65 63 6f 6d 65 20 77 68 65 6e  r to become when
4340: 20 64 72 6f 70 70 69 6e 67 20 72 6f 6f 74 0a 70   dropping root.p
4350: 72 69 76 69 6c 65 67 65 73 2e 0a 0a 0a 3c 68 33  rivileges....<h3
4360: 20 69 64 3d 22 64 6f 63 6b 65 72 2d 73 74 61 74   id="docker-stat
4370: 69 63 22 3e 35 2e 33 20 45 78 74 72 61 63 74 69  ic">5.3 Extracti
4380: 6e 67 20 61 20 53 74 61 74 69 63 20 42 69 6e 61  ng a Static Bina
4390: 72 79 3c 2f 68 33 3e 0a 0a 4f 75 72 20 32 2d 73  ry</h3>..Our 2-s
43a0: 74 61 67 65 20 62 75 69 6c 64 20 70 72 6f 63 65  tage build proce
43b0: 73 73 20 75 73 65 73 20 41 6c 70 69 6e 65 20 4c  ss uses Alpine L
43c0: 69 6e 75 78 20 6f 6e 6c 79 20 61 73 20 61 20 62  inux only as a b
43d0: 75 69 6c 64 20 68 6f 73 74 2e 20 4f 6e 63 65 0a  uild host. Once.
43e0: 77 65 27 76 65 20 67 6f 74 20 65 76 65 72 79 74  we've got everyt
43f0: 68 69 6e 67 20 72 65 64 75 63 65 64 20 74 6f 20  hing reduced to 
4400: 74 68 65 20 74 77 6f 20 6b 65 79 20 73 74 61 74  the two key stat
4410: 69 63 20 62 69 6e 61 72 69 65 73 20 e2 80 94 20  ic binaries — 
4420: 46 6f 73 73 69 6c 20 61 6e 64 0a 42 75 73 79 62  Fossil and.Busyb
4430: 6f 78 20 e2 80 94 20 77 65 20 74 68 72 6f 77 20  ox — we throw 
4440: 61 6c 6c 20 74 68 65 20 72 65 73 74 20 6f 66 20  all the rest of 
4450: 69 74 20 61 77 61 79 2e 0a 0a 41 20 73 65 63 6f  it away...A seco
4460: 6e 64 61 72 79 20 62 65 6e 65 66 69 74 20 66 61  ndary benefit fa
4470: 6c 6c 73 20 6f 75 74 20 6f 66 20 74 68 69 73 20  lls out of this 
4480: 70 72 6f 63 65 73 73 20 66 6f 72 20 66 72 65 65  process for free
4490: 3a 20 69 74 27 73 20 61 72 67 75 61 62 6c 79 0a  : it's arguably.
44a0: 74 68 65 20 65 61 73 69 65 73 74 20 77 61 79 20  the easiest way 
44b0: 74 6f 20 62 75 69 6c 64 20 61 20 70 75 72 65 6c  to build a purel
44c0: 79 20 73 74 61 74 69 63 20 46 6f 73 73 69 6c 20  y static Fossil 
44d0: 62 69 6e 61 72 79 20 66 6f 72 20 4c 69 6e 75 78  binary for Linux
44e0: 2e 20 4d 6f 73 74 0a 6d 6f 64 65 72 6e 20 4c 69  . Most.modern Li
44f0: 6e 75 78 20 64 69 73 74 72 6f 73 20 6d 61 6b 65  nux distros make
4500: 20 74 68 69 73 20 73 75 72 70 72 69 73 69 6e 67   this surprising
4510: 6c 79 20 64 69 66 66 69 63 75 6c 74 2c 20 62 75  ly difficult, bu
4520: 74 20 41 6c 70 69 6e 65 27 73 0a 62 61 63 6b 2d  t Alpine's.back-
4530: 74 6f 2d 62 61 73 69 63 73 20 6e 61 74 75 72 65  to-basics nature
4540: 20 6d 61 6b 65 73 20 73 74 61 74 69 63 20 62 75   makes static bu
4550: 69 6c 64 73 20 77 6f 72 6b 20 74 68 65 20 77 61  ilds work the wa
4560: 79 20 74 68 65 79 20 75 73 65 64 20 74 6f 2c 0a  y they used to,.
4570: 62 61 63 6b 20 69 6e 20 74 68 65 20 64 61 79 2e  back in the day.
4580: 20 49 66 20 74 68 61 74 27 73 20 77 68 61 74 20   If that's what 
4590: 79 6f 75 27 72 65 20 61 66 74 65 72 2c 20 79 6f  you're after, yo
45a0: 75 20 63 61 6e 20 73 6b 69 70 20 74 68 65 20 22  u can skip the "
45b0: 72 75 6e 22 0a 63 6f 6d 6d 61 6e 64 20 61 62 6f  run".command abo
45c0: 76 65 20 61 6e 64 20 63 72 65 61 74 65 20 61 20  ve and create a 
45d0: 74 65 6d 70 6f 72 61 72 79 20 63 6f 6e 74 61 69  temporary contai
45e0: 6e 65 72 20 66 72 6f 6d 20 74 68 65 20 69 6d 61  ner from the ima
45f0: 67 65 2c 20 74 68 65 6e 0a 65 78 74 72 61 63 74  ge, then.extract
4600: 20 74 68 65 20 65 78 65 63 75 74 61 62 6c 65 20   the executable 
4610: 66 72 6f 6d 20 69 74 20 69 6e 73 74 65 61 64 3a  from it instead:
4620: 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 20 20 24  ..<pre><code>  $
4630: 20 64 6f 63 6b 65 72 20 63 72 65 61 74 65 20 2d   docker create -
4640: 2d 6e 61 6d 65 20 66 6f 73 73 69 6c 2d 73 74 61  -name fossil-sta
4650: 74 69 63 2d 74 6d 70 20 66 6f 73 73 69 6c 0a 20  tic-tmp fossil. 
4660: 20 24 20 64 6f 63 6b 65 72 20 63 70 20 66 6f 73   $ docker cp fos
4670: 73 69 6c 2d 73 74 61 74 69 63 2d 74 6d 70 3a 2f  sil-static-tmp:/
4680: 6a 61 69 6c 2f 62 69 6e 2f 66 6f 73 73 69 6c 20  jail/bin/fossil 
4690: 2e 0a 20 20 24 20 64 6f 63 6b 65 72 20 63 6f 6e  ..  $ docker con
46a0: 74 61 69 6e 65 72 20 72 6d 20 66 6f 73 73 69 6c  tainer rm fossil
46b0: 2d 73 74 61 74 69 63 2d 74 6d 70 0a 3c 2f 63 6f  -static-tmp.</co
46c0: 64 65 3e 3c 2f 70 72 65 3e 0a 0a 54 68 65 20 72  de></pre>..The r
46d0: 65 73 75 6c 74 69 6e 67 20 62 69 6e 61 72 79 20  esulting binary 
46e0: 69 73 20 74 68 65 20 73 69 6e 67 6c 65 20 6c 61  is the single la
46f0: 72 67 65 73 74 20 66 69 6c 65 20 69 6e 73 69 64  rgest file insid
4700: 65 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 65 72  e that container
4710: 2c 0a 61 74 20 61 62 6f 75 74 20 36 c2 a0 4d 69  ,.at about 6 Mi
4720: 42 2e 20 28 49 74 27 73 20 62 75 69 6c 74 20 73  B. (It's built s
4730: 74 72 69 70 70 65 64 2e 29 0a 0a 0a 3c 68 33 20  tripped.)...<h3 
4740: 69 64 3d 22 64 6f 63 6b 65 72 2d 61 72 67 73 22  id="docker-args"
4750: 3e 35 2e 34 20 43 6f 6e 74 61 69 6e 65 72 20 42  >5.4 Container B
4760: 75 69 6c 64 20 41 72 67 75 6d 65 6e 74 73 3c 2f  uild Arguments</
4770: 68 33 3e 0a 0a 3c 68 34 3e 35 2e 34 2e 31 20 50  h3>..<h4>5.4.1 P
4780: 61 63 6b 61 67 65 20 56 65 72 73 69 6f 6e 73 3c  ackage Versions<
4790: 2f 68 34 3e 0a 0a 59 6f 75 20 63 61 6e 20 6f 76  /h4>..You can ov
47a0: 65 72 72 69 64 65 20 74 68 65 20 64 65 66 61 75  erride the defau
47b0: 6c 74 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 46  lt versions of F
47c0: 6f 73 73 69 6c 20 61 6e 64 20 42 75 73 79 42 6f  ossil and BusyBo
47d0: 78 20 74 68 61 74 20 67 65 74 0a 66 65 74 63 68  x that get.fetch
47e0: 65 64 20 69 6e 20 74 68 65 20 62 75 69 6c 64 20  ed in the build 
47f0: 73 74 65 70 2e 20 20 54 6f 20 67 65 74 20 74 68  step.  To get th
4800: 65 20 6c 61 74 65 73 74 2d 61 6e 64 2d 67 72 65  e latest-and-gre
4810: 61 74 65 73 74 20 6f 66 0a 65 76 65 72 79 74 68  atest of.everyth
4820: 69 6e 67 2c 20 79 6f 75 20 63 6f 75 6c 64 20 73  ing, you could s
4830: 61 79 3a 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e  ay:..<pre><code>
4840: 20 20 24 20 64 6f 63 6b 65 72 20 62 75 69 6c 64    $ docker build
4850: 20 2d 74 20 66 6f 73 73 69 6c 20 5c 0a 20 20 20   -t fossil \.   
4860: 20 2d 2d 62 75 69 6c 64 2d 61 72 67 20 46 53 4c   --build-arg FSL
4870: 56 45 52 3d 74 72 75 6e 6b 20 5c 0a 20 20 20 20  VER=trunk \.    
4880: 2d 2d 62 75 69 6c 64 2d 61 72 67 20 42 42 58 56  --build-arg BBXV
4890: 45 52 3d 6d 61 73 74 65 72 20 2e 3c 2f 63 6f 64  ER=master .</cod
48a0: 65 3e 3c 2f 70 72 65 3e 0a 0a 28 42 75 74 20 64  e></pre>..(But d
48b0: 6f 6e 27 74 2c 20 66 6f 72 20 72 65 61 73 6f 6e  on't, for reason
48c0: 73 20 77 65 20 77 69 6c 6c 20 67 65 74 20 74 6f  s we will get to
48d0: 2e 29 0a 0a 42 65 63 61 75 73 65 20 74 68 65 20  .)..Because the 
48e0: 42 75 73 79 42 6f 78 20 63 6f 6e 66 69 67 75 72  BusyBox configur
48f0: 61 74 69 6f 6e 20 66 69 6c 65 20 77 65 20 73 68  ation file we sh
4900: 69 70 20 77 61 73 20 63 72 65 61 74 65 64 20 77  ip was created w
4910: 69 74 68 20 61 6e 64 0a 74 65 73 74 65 64 20 61  ith and.tested a
4920: 67 61 69 6e 73 74 20 61 20 73 70 65 63 69 66 69  gainst a specifi
4930: 63 20 73 74 61 62 6c 65 20 72 65 6c 65 61 73 65  c stable release
4940: 2c 20 74 68 61 74 27 73 20 74 68 65 20 76 65 72  , that's the ver
4950: 73 69 6f 6e 20 77 65 20 70 75 6c 6c 20 62 79 0a  sion we pull by.
4960: 64 65 66 61 75 6c 74 2e 20 49 74 20 64 6f 65 73  default. It does
4970: 20 74 72 79 20 74 6f 20 6d 65 72 67 65 20 74 68   try to merge th
4980: 65 20 64 65 66 61 75 6c 74 73 20 66 6f 72 20 61  e defaults for a
4990: 6e 79 20 6e 65 77 20 63 6f 6e 66 69 67 75 72 61  ny new configura
49a0: 74 69 6f 6e 0a 73 65 74 74 69 6e 67 73 20 69 6e  tion.settings in
49b0: 74 6f 20 74 68 65 20 73 74 6f 63 6b 20 73 65 74  to the stock set
49c0: 2c 20 62 75 74 20 73 69 6e 63 65 20 69 74 27 73  , but since it's
49d0: 20 70 6f 73 73 69 62 6c 65 20 74 68 69 73 20 77   possible this w
49e0: 69 6c 6c 20 66 61 69 6c 2c 20 77 65 0a 64 6f 6e  ill fail, we.don
49f0: 27 74 20 62 6c 69 6e 64 6c 79 20 75 70 64 61 74  't blindly updat
4a00: 65 20 74 68 65 20 42 75 73 79 42 6f 78 20 76 65  e the BusyBox ve
4a10: 72 73 69 6f 6e 20 6d 65 72 65 6c 79 20 62 65 63  rsion merely bec
4a20: 61 75 73 65 20 61 20 6e 65 77 20 72 65 6c 65 61  ause a new relea
4a30: 73 65 0a 63 61 6d 65 20 6f 75 74 2e 20 20 53 6f  se.came out.  So
4a40: 6d 65 6f 6e 65 20 6e 65 65 64 73 20 74 6f 20 67  meone needs to g
4a50: 65 74 20 61 72 6f 75 6e 64 20 74 6f 20 76 65 74  et around to vet
4a60: 74 69 6e 67 20 69 74 20 61 67 61 69 6e 73 74 20  ting it against 
4a70: 6f 75 72 20 73 74 6f 63 6b 0a 63 6f 6e 66 69 67  our stock.config
4a80: 75 72 61 74 69 6f 6e 20 66 69 72 73 74 2e 0a 0a  uration first...
4a90: 41 73 20 66 6f 72 20 46 6f 73 73 69 6c 2c 20 69  As for Fossil, i
4aa0: 74 20 64 65 66 61 75 6c 74 73 20 74 6f 20 66 65  t defaults to fe
4ab0: 74 63 68 69 6e 67 20 74 68 65 20 73 61 6d 65 20  tching the same 
4ac0: 76 65 72 73 69 6f 6e 20 61 73 20 74 68 65 20 63  version as the c
4ad0: 68 65 63 6b 6f 75 74 0a 79 6f 75 27 72 65 20 72  heckout.you're r
4ae0: 75 6e 6e 69 6e 67 20 74 68 65 20 62 75 69 6c 64  unning the build
4af0: 20 63 6f 6d 6d 61 6e 64 20 66 72 6f 6d 2c 20 62   command from, b
4b00: 61 73 65 64 20 6f 6e 20 63 68 65 63 6b 69 6e 20  ased on checkin 
4b10: 49 44 2e 20 54 68 65 20 6d 6f 73 74 0a 63 6f 6d  ID. The most.com
4b20: 6d 6f 6e 20 72 65 61 73 6f 6e 20 74 6f 20 6f 76  mon reason to ov
4b30: 65 72 72 69 64 65 20 74 68 69 73 20 69 73 20 74  erride this is t
4b40: 6f 20 67 65 74 20 61 20 72 65 6c 65 61 73 65 20  o get a release 
4b50: 76 65 72 73 69 6f 6e 3a 0a 0a 3c 70 72 65 3e 3c  version:..<pre><
4b60: 63 6f 64 65 3e 20 20 24 20 64 6f 63 6b 65 72 20  code>  $ docker 
4b70: 62 75 69 6c 64 20 2d 74 20 66 6f 73 73 69 6c 20  build -t fossil 
4b80: 5c 0a 20 20 20 20 2d 2d 62 75 69 6c 64 2d 61 72  \.    --build-ar
4b90: 67 20 46 53 4c 56 45 52 3d 76 65 72 73 69 6f 6e  g FSLVER=version
4ba0: 2d 32 2e 31 39 20 2e 3c 2f 63 6f 64 65 3e 3c 2f  -2.19 .</code></
4bb0: 70 72 65 3e 0a 0a 49 74 27 73 20 62 65 73 74 20  pre>..It's best 
4bc0: 74 6f 20 75 73 65 20 61 20 73 70 65 63 69 66 69  to use a specifi
4bd0: 63 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72  c version number
4be0: 20 72 61 74 68 65 72 20 74 68 61 6e 20 74 68 65   rather than the
4bf0: 20 67 65 6e 65 72 69 63 0a 22 72 65 6c 65 61 73   generic."releas
4c00: 65 22 20 74 61 67 20 62 65 63 61 75 73 65 20 44  e" tag because D
4c10: 6f 63 6b 65 72 20 63 61 63 68 65 73 20 64 6f 77  ocker caches dow
4c20: 6e 6c 6f 61 64 65 64 20 66 69 6c 65 73 20 61 6e  nloaded files an
4c30: 64 20 74 72 69 65 73 20 74 6f 20 72 65 75 73 65  d tries to reuse
4c40: 0a 74 68 65 6d 20 61 63 72 6f 73 73 20 62 75 69  .them across bui
4c50: 6c 64 73 2e 20 49 66 20 79 6f 75 20 61 73 6b 20  lds. If you ask 
4c60: 66 6f 72 20 22 72 65 6c 65 61 73 65 22 20 62 65  for "release" be
4c70: 66 6f 72 65 20 61 20 6e 65 77 20 76 65 72 73 69  fore a new versi
4c80: 6f 6e 20 69 73 0a 74 61 67 67 65 64 20 61 6e 64  on is.tagged and
4c90: 20 74 68 65 6e 20 69 6d 6d 65 64 69 61 74 65 6c   then immediatel
4ca0: 79 20 61 66 74 65 72 2c 20 79 6f 75 20 65 78 70  y after, you exp
4cb0: 65 63 74 20 74 6f 20 67 65 74 20 74 77 6f 20 64  ect to get two d
4cc0: 69 66 66 65 72 65 6e 74 0a 74 61 72 62 61 6c 6c  ifferent.tarball
4cd0: 73 2c 20 62 75 74 20 62 65 63 61 75 73 65 20 74  s, but because t
4ce0: 68 65 20 55 52 4c 20 68 61 73 6e 27 74 20 63 68  he URL hasn't ch
4cf0: 61 6e 67 65 64 2c 20 69 66 20 79 6f 75 20 68 61  anged, if you ha
4d00: 76 65 20 61 6e 20 6f 6c 64 20 72 65 6c 65 61 73  ve an old releas
4d10: 65 0a 74 61 72 62 61 6c 6c 20 69 6e 20 79 6f 75  e.tarball in you
4d20: 72 20 44 6f 63 6b 65 72 20 63 61 63 68 65 2c 20  r Docker cache, 
4d30: 79 6f 75 27 6c 6c 20 67 65 74 20 74 68 65 20 6f  you'll get the o
4d40: 6c 64 20 76 65 72 73 69 6f 6e 20 65 76 65 6e 20  ld version even 
4d50: 69 66 20 79 6f 75 0a 70 61 73 73 20 74 68 65 20  if you.pass the 
4d60: 22 64 6f 63 6b 65 72 20 62 75 69 6c 64 20 2d 2d  "docker build --
4d70: 6e 6f 2d 63 61 63 68 65 22 20 6f 70 74 69 6f 6e  no-cache" option
4d80: 2e 0a 0a 54 68 69 73 20 69 73 20 77 68 79 20 77  ...This is why w
4d90: 65 20 64 65 66 61 75 6c 74 20 74 6f 20 61 20 63  e default to a c
4da0: 68 65 63 6b 69 6e 20 49 44 20 72 61 74 68 65 72  heckin ID rather
4db0: 20 74 68 61 6e 20 61 20 67 65 6e 65 72 69 63 20   than a generic 
4dc0: 74 61 67 20 6c 69 6b 65 0a 22 74 72 75 6e 6b 22  tag like."trunk"
4dd0: 3a 20 73 6f 20 74 68 65 20 55 52 4c 20 77 69 6c  : so the URL wil
4de0: 6c 20 63 68 61 6e 67 65 20 65 61 63 68 20 74 69  l change each ti
4df0: 6d 65 20 79 6f 75 20 75 70 64 61 74 65 20 79 6f  me you update yo
4e00: 75 72 20 46 6f 73 73 69 6c 20 73 6f 75 72 63 65  ur Fossil source
4e10: 0a 74 72 65 65 2c 20 66 6f 72 63 69 6e 67 20 44  .tree, forcing D
4e20: 6f 63 6b 65 72 20 74 6f 20 70 75 6c 6c 20 61 20  ocker to pull a 
4e30: 66 72 65 73 68 20 74 61 72 62 61 6c 6c 2e 0a 0a  fresh tarball...
4e40: 3c 68 34 3e 35 2e 34 2e 32 20 55 73 65 72 20 26  <h4>5.4.2 User &
4e50: 20 47 72 6f 75 70 20 49 44 73 3c 2f 68 34 3e 0a   Group IDs</h4>.
4e60: 0a 54 68 65 20 22 66 6f 73 73 69 6c 22 20 75 73  .The "fossil" us
4e70: 65 72 20 61 6e 64 20 67 72 6f 75 70 20 49 44 73  er and group IDs
4e80: 20 69 6e 73 69 64 65 20 74 68 65 20 63 6f 6e 74   inside the cont
4e90: 61 69 6e 65 72 20 64 65 66 61 75 6c 74 20 74 6f  ainer default to
4ea0: 20 34 39 39 2e 0a 57 68 79 3f 20 20 52 65 67 75   499..Why?  Regu
4eb0: 6c 61 72 20 75 73 65 72 20 49 44 73 20 73 74 61  lar user IDs sta
4ec0: 72 74 20 61 74 20 35 30 30 20 6f 72 20 31 30 30  rt at 500 or 100
4ed0: 30 20 6f 6e 20 6d 6f 73 74 20 55 6e 69 78 20 74  0 on most Unix t
4ee0: 79 70 65 20 73 79 73 74 65 6d 73 2c 0a 6c 65 61  ype systems,.lea
4ef0: 76 69 6e 67 20 74 68 6f 73 65 20 62 65 6c 6f 77  ving those below
4f00: 20 69 74 20 66 6f 72 20 22 73 79 73 74 65 6d 22   it for "system"
4f10: 20 75 73 65 72 73 20 6c 69 6b 65 20 74 68 69 73   users like this
4f20: 20 46 6f 73 73 69 6c 20 64 61 65 6d 6f 6e 20 6f   Fossil daemon o
4f30: 77 6e 65 72 2e 0a 53 69 6e 63 65 20 73 74 61 6e  wner..Since stan
4f40: 64 61 72 64 20 4f 53 20 73 79 73 74 65 6d 20 75  dard OS system u
4f50: 73 65 72 73 20 73 74 61 72 74 20 61 74 20 30 20  sers start at 0 
4f60: 61 6e 64 20 67 6f 20 75 70 77 61 72 64 2c 20 77  and go upward, w
4f70: 65 20 73 74 61 72 74 65 64 20 61 74 0a 35 30 30  e started at.500
4f80: 20 61 6e 64 20 77 65 6e 74 20 64 6f 77 6e 20 6f   and went down o
4f90: 6e 65 20 74 6f 20 72 65 64 75 63 65 20 74 68 65  ne to reduce the
4fa0: 20 63 68 61 6e 63 65 20 6f 66 20 61 20 63 6f 6e   chance of a con
4fb0: 66 6c 69 63 74 20 74 6f 20 61 73 20 63 6c 6f 73  flict to as clos
4fc0: 65 20 74 6f 0a 7a 65 72 6f 20 61 73 20 77 65 20  e to.zero as we 
4fd0: 63 61 6e 20 6d 61 6e 61 67 65 2e 0a 0a 54 6f 20  can manage...To 
4fe0: 63 68 61 6e 67 65 20 69 74 20 74 6f 20 73 6f 6d  change it to som
4ff0: 65 74 68 69 6e 67 20 65 6c 73 65 2c 20 73 61 79  ething else, say
5000: 3a 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 20 20  :..<pre><code>  
5010: 24 20 64 6f 63 6b 65 72 20 62 75 69 6c 64 20 2d  $ docker build -
5020: 74 20 66 6f 73 73 69 6c 20 2d 2d 62 75 69 6c 64  t fossil --build
5030: 2d 61 72 67 20 55 49 44 3d 35 30 31 20 2e 3c 2f  -arg UID=501 .</
5040: 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 54 68 69  code></pre>..Thi
5050: 73 20 69 73 20 70 61 72 74 69 63 75 6c 61 72 6c  s is particularl
5060: 79 20 75 73 65 66 75 6c 20 69 66 20 79 6f 75 27  y useful if you'
5070: 72 65 20 70 75 74 74 69 6e 67 20 79 6f 75 72 20  re putting your 
5080: 72 65 70 6f 73 69 74 6f 72 79 20 6f 6e 20 61 0a  repository on a.
5090: 44 6f 63 6b 65 72 20 76 6f 6c 75 6d 65 20 73 69  Docker volume si
50a0: 6e 63 65 20 74 68 65 20 49 44 73 20 22 6c 65 61  nce the IDs "lea
50b0: 6b 22 20 6f 75 74 20 69 6e 74 6f 20 74 68 65 20  k" out into the 
50c0: 68 6f 73 74 20 65 6e 76 69 72 6f 6e 6d 65 6e 74  host environment
50d0: 20 76 69 61 0a 66 69 6c 65 20 70 65 72 6d 69 73   via.file permis
50e0: 73 69 6f 6e 73 2e 20 20 59 6f 75 20 6d 61 79 20  sions.  You may 
50f0: 74 68 65 72 65 66 6f 72 65 20 77 69 73 68 20 74  therefore wish t
5100: 68 65 6d 20 74 6f 20 6d 65 61 6e 20 73 6f 6d 65  hem to mean some
5110: 74 68 69 6e 67 20 6f 6e 20 62 6f 74 68 0a 73 69  thing on both.si
5120: 64 65 73 20 6f 66 20 74 68 65 20 63 6f 6e 74 61  des of the conta
5130: 69 6e 65 72 20 62 61 72 72 69 65 72 20 72 61 74  iner barrier rat
5140: 68 65 72 20 74 68 61 6e 20 68 61 76 65 20 22 34  her than have "4
5150: 39 39 22 20 61 70 70 65 61 72 20 6f 6e 20 74 68  99" appear on th
5160: 65 20 68 6f 73 74 0a 69 6e 20 22 3c 74 74 3e 6c  e host.in "<tt>l
5170: 73 20 2d 6c 3c 2f 74 74 3e 22 20 6f 75 74 70 75  s -l</tt>" outpu
5180: 74 2e 0a 0a 0a 3c 68 32 3e 36 2e 30 20 42 75 69  t....<h2>6.0 Bui
5190: 6c 64 69 6e 67 20 6f 6e 2f 66 6f 72 20 41 6e 64  lding on/for And
51a0: 72 6f 69 64 3c 2f 68 32 3e 0a 0a 3c 68 33 3e 36  roid</h2>..<h3>6
51b0: 2e 31 20 43 72 6f 73 73 2d 63 6f 6d 70 69 6c 69  .1 Cross-compili
51c0: 6e 67 20 66 72 6f 6d 20 4c 69 6e 75 78 3c 2f 68  ng from Linux</h
51d0: 33 3e 0a 0a 54 68 65 20 66 6f 6c 6c 6f 77 69 6e  3>..The followin
51e0: 67 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 20 66  g instructions f
51f0: 6f 72 20 62 75 69 6c 64 69 6e 67 20 46 6f 73 73  or building Foss
5200: 69 6c 20 66 6f 72 20 41 6e 64 72 6f 69 64 20 76  il for Android v
5210: 69 61 20 4c 69 6e 75 78 2c 0a 77 69 74 68 6f 75  ia Linux,.withou
5220: 74 20 72 65 71 75 69 72 69 6e 67 20 61 20 72 6f  t requiring a ro
5230: 6f 74 65 64 20 4f 53 2c 20 61 72 65 20 61 64 61  oted OS, are ada
5240: 70 74 65 64 20 66 72 6f 6d 0a 5b 68 74 74 70 73  pted from.[https
5250: 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72  ://fossil-scm.or
5260: 67 2f 66 6f 72 75 6d 2f 66 6f 72 75 6d 70 6f 73  g/forum/forumpos
5270: 74 2f 65 30 65 39 64 65 34 61 37 65 20 7c 20 66  t/e0e9de4a7e | f
5280: 6f 72 75 6d 70 6f 73 74 2f 65 30 65 39 64 65 34  orumpost/e0e9de4
5290: 61 37 65 5d 2e 0a 0a 4f 6e 20 74 68 65 20 64 65  a7e]...On the de
52a0: 76 65 6c 6f 70 6d 65 6e 74 20 6d 61 63 68 69 6e  velopment machin
52b0: 65 2c 20 66 72 6f 6d 20 74 68 65 20 66 6f 73 73  e, from the foss
52c0: 69 6c 20 73 6f 75 72 63 65 20 74 72 65 65 3a 0a  il source tree:.
52d0: 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 65 78 70 6f  .<pre><code>expo
52e0: 72 74 20 43 43 3d 24 4e 44 4b 5f 50 41 54 48 2f  rt CC=$NDK_PATH/
52f0: 74 6f 6f 6c 63 68 61 69 6e 73 2f 6c 6c 76 6d 2f  toolchains/llvm/
5300: 70 72 65 62 75 69 6c 74 2f 6c 69 6e 75 78 2d 78  prebuilt/linux-x
5310: 38 36 5f 36 34 2f 62 69 6e 2f 61 72 6d 76 37 61  86_64/bin/armv7a
5320: 2d 6c 69 6e 75 78 2d 61 6e 64 72 6f 69 64 65 61  -linux-androidea
5330: 62 69 32 31 2d 63 6c 61 6e 67 0a 2e 2f 63 6f 6e  bi21-clang../con
5340: 66 69 67 75 72 65 20 2d 2d 77 69 74 68 2d 6f 70  figure --with-op
5350: 65 6e 73 73 6c 3d 6e 6f 6e 65 0a 6d 61 6b 65 0a  enssl=none.make.
5360: 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 0a  </code></pre>...
5370: 4f 6e 20 74 68 65 20 41 6e 64 72 6f 69 64 20 64  On the Android d
5380: 65 76 69 63 65 2c 20 65 6e 61 62 6c 65 20 74 68  evice, enable th
5390: 65 20 3c 65 6d 3e 55 53 42 20 64 65 62 75 67 67  e <em>USB debugg
53a0: 69 6e 67 3c 2f 65 6d 3e 20 6f 70 74 69 6f 6e 20  ing</em> option 
53b0: 66 72 6f 6d 0a 44 65 76 65 6c 6f 70 65 72 20 6d  from.Developer m
53c0: 65 6e 75 20 69 6e 20 44 65 76 69 63 65 20 4f 70  enu in Device Op
53d0: 74 69 6f 6e 73 2e 20 43 6f 6e 6e 65 63 74 20 74  tions. Connect t
53e0: 68 65 20 64 65 76 69 63 65 20 74 6f 20 74 68 65  he device to the
53f0: 20 64 65 76 65 6c 6f 70 6d 65 6e 74 0a 73 79 73   development.sys
5400: 74 65 6d 20 77 69 74 68 20 55 53 42 2e 20 49 66  tem with USB. If
5410: 20 69 74 27 73 20 63 6f 6e 66 69 67 75 72 65 64   it's configured
5420: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 65 64 20 70   and connected p
5430: 72 6f 70 65 72 6c 79 2c 0a 74 68 65 20 64 65 76  roperly,.the dev
5440: 69 63 65 20 73 68 6f 75 6c 64 20 73 68 6f 77 20  ice should show 
5450: 75 70 20 69 6e 20 74 68 65 20 6f 75 74 70 75 74  up in the output
5460: 20 6f 66 20 3c 63 6f 64 65 3e 61 64 62 20 64 65   of <code>adb de
5470: 76 69 63 65 73 3c 2f 63 6f 64 65 3e 3a 0a 0a 3c  vices</code>:..<
5480: 70 72 65 3e 3c 63 6f 64 65 3e 73 75 64 6f 20 61  pre><code>sudo a
5490: 64 62 20 64 65 76 69 63 65 73 0a 3c 2f 63 6f 64  db devices.</cod
54a0: 65 3e 3c 2f 70 72 65 3e 0a 0a 43 6f 70 79 20 74  e></pre>..Copy t
54b0: 68 65 20 72 65 73 75 6c 74 69 6e 67 20 66 6f 73  he resulting fos
54c0: 73 69 6c 20 62 69 6e 61 72 79 20 6f 6e 74 6f 20  sil binary onto 
54d0: 74 68 65 20 64 65 76 69 63 65 2e 2e 2e 0a 0a 3c  the device.....<
54e0: 70 72 65 3e 3c 63 6f 64 65 3e 73 75 64 6f 20 61  pre><code>sudo a
54f0: 64 62 20 70 75 73 68 20 66 6f 73 73 69 6c 20 2f  db push fossil /
5500: 64 61 74 61 2f 6c 6f 63 61 6c 2f 74 6d 70 0a 3c  data/local/tmp.<
5510: 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 41 6e  /code></pre>..An
5520: 64 20 72 75 6e 20 69 74 20 66 72 6f 6d 20 61 6e  d run it from an
5530: 20 3c 63 6f 64 65 3e 61 64 62 3c 2f 63 6f 64 65   <code>adb</code
5540: 3e 20 73 68 65 6c 6c 3a 0a 0a 3c 70 72 65 3e 3c  > shell:..<pre><
5550: 63 6f 64 65 3e 73 75 64 6f 20 61 64 62 20 73 68  code>sudo adb sh
5560: 65 6c 6c 0a 26 67 74 3b 20 63 64 20 2f 64 61 74  ell.&gt; cd /dat
5570: 61 2f 6c 6f 63 61 6c 2f 74 6d 70 0a 23 20 46 6f  a/local/tmp.# Fo
5580: 73 73 69 6c 20 72 65 71 75 69 72 65 73 20 61 20  ssil requires a 
5590: 48 4f 4d 45 20 64 69 72 65 63 74 6f 72 79 20 74  HOME directory t
55a0: 6f 20 77 6f 72 6b 20 77 69 74 68 3a 0a 26 67 74  o work with:.&gt
55b0: 3b 20 65 78 70 6f 72 74 20 48 4f 4d 45 3d 24 50  ; export HOME=$P
55c0: 57 44 0a 26 67 74 3b 20 65 78 70 6f 72 74 20 50  WD.&gt; export P
55d0: 41 54 48 3d 24 50 57 44 3a 24 50 41 54 48 0a 26  ATH=$PWD:$PATH.&
55e0: 67 74 3b 20 66 6f 73 73 69 6c 20 76 65 72 73 69  gt; fossil versi
55f0: 6f 6e 0a 54 68 69 73 20 69 73 20 66 6f 73 73 69  on.This is fossi
5600: 6c 20 76 65 72 73 69 6f 6e 20 32 2e 31 31 20 26  l version 2.11 &
5610: 23 39 31 3b 65 35 36 35 33 61 34 63 65 62 5d 20  #91;e5653a4ceb] 
5620: 32 30 32 30 2d 30 33 2d 32 36 20 31 38 3a 35 34  2020-03-26 18:54
5630: 3a 30 32 20 55 54 43 0a 3c 2f 63 6f 64 65 3e 3c  :02 UTC.</code><
5640: 2f 70 72 65 3e 0a 0a 54 68 65 20 6f 75 74 70 75  /pre>..The outpu
5650: 74 20 6d 69 67 68 74 2c 20 6f 72 20 6d 69 67 68  t might, or migh
5660: 74 20 6e 6f 74 2c 20 69 6e 63 6c 75 64 65 20 77  t not, include w
5670: 61 72 6e 69 6e 67 73 20 73 75 63 68 20 61 73 3a  arnings such as:
5680: 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 57 41 52  ..<pre><code>WAR
5690: 4e 49 4e 47 3a 20 6c 69 6e 6b 65 72 3a 20 2e 2f  NING: linker: ./
56a0: 66 6f 73 73 69 6c 3a 20 75 6e 75 73 65 64 20 44  fossil: unused D
56b0: 54 20 65 6e 74 72 79 3a 20 74 79 70 65 20 30 78  T entry: type 0x
56c0: 36 66 66 66 66 65 66 35 20 61 72 67 20 30 78 31  6ffffef5 arg 0x1
56d0: 34 36 34 0a 57 41 52 4e 49 4e 47 3a 20 6c 69 6e  464.WARNING: lin
56e0: 6b 65 72 3a 20 2e 2f 66 6f 73 73 69 6c 3a 20 75  ker: ./fossil: u
56f0: 6e 75 73 65 64 20 44 54 20 65 6e 74 72 79 3a 20  nused DT entry: 
5700: 74 79 70 65 20 30 78 36 66 66 66 66 66 66 65 20  type 0x6ffffffe 
5710: 61 72 67 20 30 78 31 62 61 38 0a 57 41 52 4e 49  arg 0x1ba8.WARNI
5720: 4e 47 3a 20 6c 69 6e 6b 65 72 3a 20 2e 2f 66 6f  NG: linker: ./fo
5730: 73 73 69 6c 3a 20 75 6e 75 73 65 64 20 44 54 20  ssil: unused DT 
5740: 65 6e 74 72 79 3a 20 74 79 70 65 20 30 78 36 66  entry: type 0x6f
5750: 66 66 66 66 66 66 20 61 72 67 20 30 78 32 0a 3c  ffffff arg 0x2.<
5760: 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 54 68  /code></pre>..Th
5770: 65 20 73 6f 75 72 63 65 20 6f 66 20 73 75 63 68  e source of such
5780: 20 77 61 72 6e 69 6e 67 73 20 69 73 20 6e 6f 74   warnings is not
5790: 20 31 30 30 25 20 63 65 72 74 61 69 6e 2e 0a 53   100% certain..S
57a0: 6f 6d 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  ome information 
57b0: 61 62 6f 75 74 20 74 68 65 73 65 20 28 72 65 70  about these (rep
57c0: 6f 72 74 65 64 6c 79 20 68 61 72 6d 6c 65 73 73  ortedly harmless
57d0: 29 20 77 61 72 6e 69 6e 67 73 20 63 61 6e 0a 62  ) warnings can.b
57e0: 65 20 66 6f 75 6e 64 0a 5b 68 74 74 70 73 3a 2f  e found.[https:/
57f0: 2f 73 74 61 63 6b 6f 76 65 72 66 6c 6f 77 2e 63  /stackoverflow.c
5800: 6f 6d 2f 61 2f 34 31 39 30 30 35 35 31 20 7c 20  om/a/41900551 | 
5810: 6f 6e 20 74 68 69 73 20 53 74 61 63 6b 4f 76 65  on this StackOve
5820: 72 66 6c 6f 77 20 70 6f 73 74 5d 2e 0a 0a 0a 3c  rflow post]....<
5830: 61 20 69 64 3d 27 66 75 7a 7a 65 72 27 3e 3c 2f  a id='fuzzer'></
5840: 61 3e 0a 3c 68 32 3e 37 2e 30 20 42 75 69 6c 64  a>.<h2>7.0 Build
5850: 69 6e 67 20 66 6f 72 20 46 75 7a 7a 20 54 65 73  ing for Fuzz Tes
5860: 74 69 6e 67 3c 2f 68 32 3e 0a 0a 54 68 69 73 20  ting</h2>..This 
5870: 66 65 61 74 75 72 65 20 69 73 20 70 72 69 6d 61  feature is prima
5880: 72 69 6c 79 20 69 6e 74 65 6e 64 65 64 20 66 6f  rily intended fo
5890: 72 20 66 6f 73 73 69 6c 27 73 20 64 65 76 65 6c  r fossil's devel
58a0: 6f 70 65 72 73 20 61 6e 64 20 6d 61 79 0a 63 68  opers and may.ch
58b0: 61 6e 67 65 20 61 74 20 61 6e 79 20 74 69 6d 65  ange at any time
58c0: 2e 20 49 74 20 69 73 20 6f 6e 6c 79 20 6b 6e 6f  . It is only kno
58d0: 77 6e 20 74 6f 20 77 6f 72 6b 20 6f 6e 20 4c 69  wn to work on Li
58e0: 6e 75 78 20 73 79 73 74 65 6d 73 20 61 6e 64 20  nux systems and 
58f0: 68 61 73 0a 62 65 65 6e 20 73 65 65 6e 20 74 6f  has.been seen to
5900: 20 77 6f 72 6b 20 6f 6e 20 78 38 36 2f 36 34 20   work on x86/64 
5910: 61 6e 64 20 41 52 4d 2e 0a 0a 46 6f 73 73 69 6c  and ARM...Fossil
5920: 20 68 61 73 20 62 75 69 6c 74 69 6e 20 73 75 70   has builtin sup
5930: 70 6f 72 74 20 66 6f 72 20 70 72 6f 63 65 73 73  port for process
5940: 69 6e 67 20 73 70 65 63 69 66 69 63 20 66 65 61  ing specific fea
5950: 74 75 72 65 73 20 75 73 69 6e 67 0a 3c 74 74 3e  tures using.<tt>
5960: 6c 69 62 66 75 7a 7a 65 72 3c 2f 74 74 3e 2e 20  libfuzzer</tt>. 
5970: 54 68 65 20 66 65 61 74 75 72 65 73 20 77 68 69  The features whi
5980: 63 68 20 63 61 6e 20 62 65 20 74 65 73 74 65 64  ch can be tested
5990: 20 74 68 69 73 20 77 61 79 20 61 72 65 0a 66 6f   this way are.fo
59a0: 75 6e 64 20 69 6e 20 74 68 65 20 68 65 6c 70 20  und in the help 
59b0: 74 65 78 74 20 66 6f 72 20 74 68 65 20 5b 2f 68  text for the [/h
59c0: 65 6c 70 3f 63 6d 64 3d 74 65 73 74 2d 66 75 7a  elp?cmd=test-fuz
59d0: 7a 7c 74 65 73 74 2d 66 75 7a 7a 0a 63 6f 6d 6d  z|test-fuzz.comm
59e0: 61 6e 64 5d 2e 0a 0a 46 75 7a 7a 69 6e 67 20 72  and]...Fuzzing r
59f0: 65 71 75 69 72 65 73 3a 0a 0a 20 20 2a 20 20 43  equires:..  *  C
5a00: 75 73 74 6f 6d 69 7a 69 6e 67 20 74 68 65 20 62  ustomizing the b
5a10: 75 69 6c 64 20 6f 66 20 66 6f 73 73 69 6c 20 61  uild of fossil a
5a20: 20 73 6d 61 6c 6c 20 62 69 74 2e 0a 20 20 2a 20   small bit..  * 
5a30: 20 54 68 65 20 63 6c 61 6e 67 20 43 20 63 6f 6d   The clang C com
5a40: 70 69 6c 65 72 2e 0a 20 20 2a 20 20 6c 69 62 66  piler..  *  libf
5a50: 75 7a 7a 65 72 2e 20 4f 6e 20 55 62 75 6e 74 75  uzzer. On Ubuntu
5a60: 2d 64 65 72 69 76 65 64 20 73 79 73 74 65 6d 73  -derived systems
5a70: 2c 20 69 74 20 63 61 6e 20 62 65 20 69 6e 73 74  , it can be inst
5a80: 61 6c 6c 65 64 20 77 69 74 68 0a 20 20 20 20 20  alled with.     
5a90: 3c 74 74 3e 61 70 74 20 69 6e 73 74 61 6c 6c 20  <tt>apt install 
5aa0: 6c 69 62 66 75 7a 7a 65 72 2d 58 59 5a 3c 2f 74  libfuzzer-XYZ</t
5ab0: 74 3e 2c 20 77 68 65 72 65 20 58 59 5a 20 69 73  t>, where XYZ is
5ac0: 20 61 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65   a version numbe
5ad0: 72 0a 20 20 20 20 20 28 73 65 76 65 72 61 6c 20  r.     (several 
5ae0: 76 65 72 73 69 6f 6e 73 20 6d 61 79 20 62 65 20  versions may be 
5af0: 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 61 6e 79  available on any
5b00: 20 67 69 76 65 6e 20 73 79 73 74 65 6d 29 0a 0a   given system)..
5b10: 0a 46 69 72 73 74 2c 20 6d 6f 64 69 66 79 20 74  .First, modify t
5b20: 68 65 20 74 6f 70 2d 6c 65 76 65 6c 20 3c 74 74  he top-level <tt
5b30: 3e 4d 61 6b 65 66 69 6c 65 2e 69 6e 3c 2f 74 74  >Makefile.in</tt
5b40: 3e 3a 0a 0a 20 20 2a 20 20 45 78 74 65 6e 64 20  >:..  *  Extend 
5b50: 74 68 65 20 3c 74 74 3e 54 43 43 46 4c 41 47 53  the <tt>TCCFLAGS
5b60: 3c 2f 74 74 3e 20 76 61 72 69 61 62 6c 65 20 77  </tt> variable w
5b70: 69 74 68 3a 20 3c 74 74 3e 2d 66 73 61 6e 69 74  ith: <tt>-fsanit
5b80: 69 7a 65 3d 66 75 7a 7a 65 72 0a 20 20 20 2d 44  ize=fuzzer.   -D
5b90: 46 4f 53 53 49 4c 5f 46 55 5a 5a 3c 2f 74 74 3e  FOSSIL_FUZZ</tt>
5ba0: 20 28 61 6e 64 20 73 65 65 20 5b 2f 66 69 6e 66   (and see [/finf
5bb0: 6f 2f 73 72 63 2f 66 75 7a 7a 2e 63 20 7c 20 73  o/src/fuzz.c | s
5bc0: 72 63 2f 66 75 7a 7a 2e 63 5d 20 66 6f 72 0a 20  rc/fuzz.c] for. 
5bd0: 20 20 6d 6f 72 65 20 6f 70 74 69 6f 6e 73 29 2e    more options).
5be0: 0a 20 20 2a 20 20 52 65 6e 61 6d 65 20 3c 74 74  .  *  Rename <tt
5bf0: 3e 41 50 50 4e 41 4d 45 3c 2f 74 74 3e 20 66 72  >APPNAME</tt> fr
5c00: 6f 6d 20 3c 74 74 3e 66 6f 73 73 69 6c 3c 2f 74  om <tt>fossil</t
5c10: 74 3e 20 74 6f 20 3c 74 74 3e 66 6f 73 73 69 6c  t> to <tt>fossil
5c20: 2d 66 75 7a 7a 3c 2f 74 74 3e 2e 0a 0a 54 68 65  -fuzz</tt>...The
5c30: 6e 20 72 65 62 75 69 6c 64 3a 0a 0a 3c 70 72 65  n rebuild:..<pre
5c40: 3e 3c 2f 63 6f 64 65 3e 24 20 6d 61 6b 65 20 63  ></code>$ make c
5c50: 6c 65 61 6e 0a 24 20 2e 2f 63 6f 6e 66 69 67 75  lean.$ ./configu
5c60: 72 65 20 43 43 3d 2f 70 61 74 68 2f 74 6f 2f 63  re CC=/path/to/c
5c70: 6c 61 6e 67 0a 24 20 6d 61 6b 65 0a 3c 2f 63 6f  lang.$ make.</co
5c80: 64 65 3e 3c 2f 70 72 65 3e 0a 0a 49 66 20 63 6c  de></pre>..If cl
5c90: 61 6e 67 20 69 73 20 79 6f 75 72 20 64 65 66 61  ang is your defa
5ca0: 75 6c 74 20 63 6f 6d 70 69 6c 65 72 2c 20 74 68  ult compiler, th
5cb0: 65 20 3c 74 74 3e 43 43 3c 2f 74 74 3e 20 63 6f  e <tt>CC</tt> co
5cc0: 6e 66 69 67 75 72 65 20 6f 70 74 69 6f 6e 20 69  nfigure option i
5cd0: 73 0a 6e 6f 74 20 72 65 71 75 69 72 65 64 2e 0a  s.not required..
5ce0: 0a 54 68 65 20 72 65 73 75 6c 74 69 6e 67 20 3c  .The resulting <
5cf0: 74 74 3e 66 6f 73 73 69 6c 2d 66 75 7a 7a 3c 2f  tt>fossil-fuzz</
5d00: 74 74 3e 20 62 69 6e 61 72 79 20 64 69 66 66 65  tt> binary diffe
5d10: 72 73 20 66 72 6f 6d 20 74 68 65 20 73 74 61 6e  rs from the stan
5d20: 64 61 72 64 0a 6f 6e 65 20 70 72 69 6d 61 72 69  dard.one primari
5d30: 6c 79 20 69 6e 20 74 68 61 74 20 69 74 20 72 75  ly in that it ru
5d40: 6e 73 20 74 68 65 20 3c 74 74 3e 74 65 73 74 2d  ns the <tt>test-
5d50: 66 75 7a 7a 3c 2f 74 74 3e 20 63 6f 6d 6d 61 6e  fuzz</tt> comman
5d60: 64 20 62 79 0a 64 65 66 61 75 6c 74 2e 20 49 74  d by.default. It
5d70: 20 6e 65 65 64 73 20 74 6f 20 62 65 20 74 6f 6c   needs to be tol
5d80: 64 20 77 68 61 74 20 74 6f 20 66 75 7a 7a 20 61  d what to fuzz a
5d90: 6e 64 20 6e 65 65 64 73 20 74 6f 20 62 65 20 67  nd needs to be g
5da0: 69 76 65 6e 20 61 0a 64 69 72 65 63 74 6f 72 79  iven a.directory
5db0: 20 6f 66 20 69 6e 70 75 74 20 66 69 6c 65 73 20   of input files 
5dc0: 74 6f 20 73 65 65 64 20 74 68 65 20 66 75 7a 7a  to seed the fuzz
5dd0: 65 72 20 77 69 74 68 3a 0a 0a 0a 3c 70 72 65 3e  er with:...<pre>
5de0: 3c 2f 63 6f 64 65 3e 24 20 6d 6b 64 69 72 20 63  </code>$ mkdir c
5df0: 61 73 65 73 0a 20 20 23 20 43 6f 70 79 20 69 6e  ases.  # Copy in
5e00: 70 75 74 20 66 69 6c 65 73 20 69 6e 74 6f 20 2e  put files into .
5e10: 2f 63 61 73 65 73 2e 20 65 2e 67 2e 20 77 68 65  /cases. e.g. whe
5e20: 6e 20 66 75 7a 7a 69 6e 67 20 74 68 65 20 6d 61  n fuzzing the ma
5e30: 72 6b 64 6f 77 6e 0a 20 20 23 20 70 72 6f 63 65  rkdown.  # proce
5e40: 73 73 6f 72 2c 20 63 6f 70 79 20 61 6e 79 20 74  ssor, copy any t
5e50: 6f 2d 62 65 2d 74 65 73 74 65 64 20 2e 6d 64 20  o-be-tested .md 
5e60: 66 69 6c 65 73 20 69 6e 74 6f 20 74 68 61 74 20  files into that 
5e70: 64 69 72 65 63 74 6f 72 79 2e 0a 20 20 23 20 54  directory..  # T
5e80: 68 65 6e 20 73 74 61 72 74 20 74 68 65 20 66 75  hen start the fu
5e90: 7a 7a 65 72 3a 0a 24 20 2e 2f 66 6f 73 73 69 6c  zzer:.$ ./fossil
5ea0: 2d 66 75 7a 7a 20 2d 2d 66 75 7a 7a 74 79 70 65  -fuzz --fuzztype
5eb0: 20 6d 61 72 6b 64 6f 77 6e 20 63 61 73 65 73 0a   markdown cases.
5ec0: 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 41  </code></pre>..A
5ed0: 73 20 69 74 20 77 6f 72 6b 73 2c 20 69 74 20 77  s it works, it w
5ee0: 72 69 74 65 73 20 69 74 73 20 6d 75 74 61 74 65  rites its mutate
5ef0: 64 20 74 65 73 74 20 66 69 6c 65 73 20 69 6e 74  d test files int
5f00: 6f 20 74 68 65 20 74 65 73 74 2d 69 6e 70 75 74  o the test-input
5f10: 0a 64 69 72 65 63 74 6f 72 79 2c 20 65 61 63 68  .directory, each
5f20: 20 6f 6e 65 20 6e 61 6d 65 64 20 69 6e 20 74 68   one named in th
5f30: 65 20 66 6f 72 6d 20 6f 66 20 61 20 68 61 73 68  e form of a hash
5f40: 2e 20 57 68 65 6e 20 69 74 20 66 69 6e 64 73 20  . When it finds 
5f50: 61 0a 70 72 6f 62 6c 65 6d 20 69 74 20 77 69 6c  a.problem it wil
5f60: 6c 20 70 72 6f 64 75 63 65 20 61 20 73 74 61 63  l produce a stac
5f70: 6b 20 74 72 61 63 65 20 66 6f 72 20 74 68 65 20  k trace for the 
5f80: 6f 66 66 65 6e 64 69 6e 67 20 63 6f 64 65 2c 20  offending code, 
5f90: 77 69 6c 6c 0a 6f 75 74 70 75 74 20 74 68 65 20  will.output the 
5fa0: 6e 61 6d 65 20 6f 66 20 74 68 65 20 66 69 6c 65  name of the file
5fb0: 20 77 68 69 63 68 20 74 72 69 67 67 65 72 65 64   which triggered
5fc0: 20 74 68 65 20 63 72 61 73 68 20 28 6e 61 6d 65   the crash (name
5fd0: 64 0a 3c 74 74 3e 63 61 73 65 73 2f 53 4f 4d 45  d.<tt>cases/SOME
5fe0: 5f 48 41 53 48 3c 2f 74 74 3e 29 20 61 6e 64 20  _HASH</tt>) and 
5ff0: 6d 61 79 2c 20 64 65 70 65 6e 64 69 6e 67 20 6f  may, depending o
6000: 6e 20 74 68 65 20 6e 61 74 75 72 65 20 6f 66 20  n the nature of 
6010: 74 68 65 0a 70 72 6f 62 6c 65 6d 2c 20 70 72 6f  the.problem, pro
6020: 64 75 63 65 20 61 20 66 69 6c 65 20 6e 61 6d 65  duce a file name
6030: 64 20 3c 74 74 3e 63 72 61 73 68 2d 53 4f 4d 45  d <tt>crash-SOME
6040: 54 48 49 4e 47 3c 2f 74 74 3e 2e 20 20 49 6e 20  THING</tt>.  In 
6050: 74 68 65 6f 72 79 20 74 68 65 0a 63 72 61 73 68  theory the.crash
6060: 20 66 69 6c 65 20 63 61 6e 20 62 65 20 66 65 64   file can be fed
6070: 20 64 69 72 65 63 74 6c 79 20 62 61 63 6b 20 69   directly back i
6080: 6e 74 6f 20 74 68 65 20 66 75 7a 7a 65 72 20 74  nto the fuzzer t
6090: 6f 20 72 65 70 72 6f 64 75 63 65 20 74 68 65 0a  o reproduce the.
60a0: 70 72 6f 62 6c 65 6d 3a 0a 0a 3c 70 72 65 3e 3c  problem:..<pre><
60b0: 2f 63 6f 64 65 3e 24 20 2e 2f 66 6f 73 73 69 6c  /code>$ ./fossil
60c0: 2d 66 75 7a 7a 20 2d 2d 66 75 7a 7a 74 79 70 65  -fuzz --fuzztype
60d0: 20 6d 61 72 6b 64 6f 77 6e 20 63 72 61 73 68 2d   markdown crash-
60e0: 53 4f 4d 45 54 48 49 4e 47 0a 3c 2f 63 6f 64 65  SOMETHING.</code
60f0: 3e 3c 2f 70 72 65 3e 0a 0a 42 75 74 20 77 68 65  ></pre>..But whe
6100: 74 68 65 72 20 6f 72 20 6e 6f 74 20 69 74 20 77  ther or not it w
6110: 69 6c 6c 20 67 65 6e 75 69 6e 65 6c 79 20 63 72  ill genuinely cr
6120: 61 73 68 20 6d 61 79 20 64 65 70 65 6e 64 20 6f  ash may depend o
6130: 6e 20 73 74 61 74 69 63 0a 61 70 70 2d 6c 65 76  n static.app-lev
6140: 65 6c 20 73 74 61 74 65 20 77 68 69 63 68 20 6d  el state which m
6150: 69 67 68 74 20 6e 6f 74 20 74 72 69 67 67 65 72  ight not trigger
6160: 20 74 68 65 20 63 72 61 73 68 20 77 68 65 6e 20   the crash when 
6170: 72 75 6e 6e 69 6e 67 20 61 6e 0a 69 6e 64 69 76  running an.indiv
6180: 69 64 75 61 6c 20 74 65 73 74 2e 0a 0a 46 6f 72  idual test...For
6190: 20 61 20 64 65 74 61 69 6c 65 64 20 69 6e 66 6f   a detailed info
61a0: 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 74 68  rmation about th
61b0: 65 20 66 75 7a 7a 65 72 27 73 20 66 6c 61 67 73  e fuzzer's flags
61c0: 20 61 6e 64 20 66 65 61 74 75 72 65 73 2c 20 73   and features, s
61d0: 65 65 3a 0a 0a 20 20 2a 20 20 5b 68 74 74 70 73  ee:..  *  [https
61e0: 3a 2f 2f 6c 6c 76 6d 2e 6f 72 67 2f 64 6f 63 73  ://llvm.org/docs
61f0: 2f 4c 69 62 46 75 7a 7a 65 72 2e 68 74 6d 6c 5d  /LibFuzzer.html]
6200: 0a 20 20 2a 20 20 5b 68 74 74 70 73 3a 2f 2f 67  .  *  [https://g
6210: 69 74 68 75 62 2e 63 6f 6d 2f 67 6f 6f 67 6c 65  ithub.com/google
6220: 2f 66 75 7a 7a 69 6e 67 2f 62 6c 6f 62 2f 6d 61  /fuzzing/blob/ma
6230: 73 74 65 72 2f 74 75 74 6f 72 69 61 6c 2f 6c 69  ster/tutorial/li
6240: 62 46 75 7a 7a 65 72 54 75 74 6f 72 69 61 6c 2e  bFuzzerTutorial.
6250: 6d 64 5d 0a 20 0a 46 6c 61 67 73 20 66 6f 72 20  md]. .Flags for 
6260: 74 68 65 20 66 75 7a 7a 65 72 20 63 61 6e 20 62  the fuzzer can b
6270: 65 20 70 61 73 73 65 64 20 64 69 72 65 63 74 6c  e passed directl
6280: 79 20 74 6f 20 66 6f 73 73 69 6c 2c 0a 65 2e 67  y to fossil,.e.g
6290: 2e 20 3c 74 74 3e 2d 6a 6f 62 73 3d 34 3c 2f 74  . <tt>-jobs=4</t
62a0: 74 3e 20 74 6f 20 73 74 61 72 74 20 66 6f 75 72  t> to start four
62b0: 20 66 75 7a 7a 65 72 20 6a 6f 62 73 20 69 6e 20   fuzzer jobs in 
62c0: 70 61 72 61 6c 6c 65 6c 2c 20 62 75 74 20 64 6f  parallel, but do
62d0: 69 6e 67 0a 73 6f 20 6d 61 79 20 63 61 75 73 65  ing.so may cause
62e0: 20 74 68 65 20 66 75 7a 7a 65 72 20 74 6f 20 3c   the fuzzer to <
62f0: 65 6d 3e 73 74 72 69 70 20 74 68 65 20 2d 2d 66  em>strip the --f
6300: 75 7a 7a 74 79 70 65 20 66 6c 61 67 3c 2f 65 6d  uzztype flag</em
6310: 3e 2c 20 6c 65 61 64 69 6e 67 0a 74 6f 20 69 74  >, leading.to it
6320: 20 74 65 73 74 69 6e 67 20 74 68 65 20 77 72 6f   testing the wro
6330: 6e 67 20 74 68 69 6e 67 2e 20 57 68 65 6e 20 70  ng thing. When p
6340: 61 73 73 69 6e 67 20 6f 6e 20 66 75 7a 7a 65 72  assing on fuzzer
6350: 2d 73 70 65 63 69 66 69 63 20 66 6c 61 67 73 0a  -specific flags.
6360: 61 6c 6f 6e 67 20 77 69 74 68 20 3c 74 74 3e 2d  along with <tt>-
6370: 2d 66 75 7a 7a 74 79 70 65 3c 2f 74 74 3e 2c 20  -fuzztype</tt>, 
6380: 62 65 20 73 75 72 65 20 74 6f 20 63 68 65 63 6b  be sure to check
6390: 20 79 6f 75 72 20 73 79 73 74 65 6d 27 73 20 70   your system's p
63a0: 72 6f 63 65 73 73 0a 6c 69 73 74 20 74 6f 20 65  rocess.list to e
63b0: 6e 73 75 72 65 20 74 68 61 74 20 79 6f 75 72 20  nsure that your 
63c0: 3c 74 74 3e 2d 2d 66 75 7a 7a 74 79 70 65 3c 2f  <tt>--fuzztype</
63d0: 74 74 3e 20 66 6c 61 67 20 69 73 20 74 68 65 72  tt> flag is ther
63e0: 65 2e 0a 0a 0a 3c 61 20 69 64 3d 27 77 61 73 6d  e....<a id='wasm
63f0: 27 3e 3c 2f 61 3e 0a 3c 68 32 3e 38 2e 30 20 42  '></a>.<h2>8.0 B
6400: 75 69 6c 64 69 6e 67 20 57 65 62 41 73 73 65 6d  uilding WebAssem
6410: 62 6c 79 20 43 6f 6d 70 6f 6e 65 6e 74 73 3c 2f  bly Components</
6420: 68 32 3e 0a 0a 41 73 20 6f 66 20 76 65 72 73 69  h2>..As of versi
6430: 6f 6e 20 32 2e 31 39 2c 20 66 6f 73 73 69 6c 20  on 2.19, fossil 
6440: 75 73 65 73 20 6f 6e 65 20 63 6f 6d 70 6f 6e 65  uses one compone
6450: 6e 74 20 62 75 69 6c 74 20 61 73 0a 5b 68 74 74  nt built as.[htt
6460: 70 73 3a 2f 2f 64 65 76 65 6c 6f 70 65 72 2e 6d  ps://developer.m
6470: 6f 7a 69 6c 6c 61 2e 6f 72 67 2f 65 6e 2d 55 53  ozilla.org/en-US
6480: 2f 64 6f 63 73 2f 57 65 62 41 73 73 65 6d 62 6c  /docs/WebAssembl
6490: 79 20 7c 20 57 65 62 41 73 73 65 6d 62 6c 79 5d  y | WebAssembly]
64a0: 0a 61 2e 6b 2e 61 2e 20 57 41 53 4d 2e 20 42 65  .a.k.a. WASM. Be
64b0: 63 61 75 73 65 20 63 6f 6d 70 69 6c 69 6e 67 20  cause compiling 
64c0: 57 41 53 4d 20 63 6f 64 65 20 72 65 71 75 69 72  WASM code requir
64d0: 65 73 20 6e 6f 6e 2d 74 72 69 76 69 61 6c 0a 63  es non-trivial.c
64e0: 6c 69 65 6e 74 2d 73 69 64 65 20 74 6f 6f 6c 69  lient-side tooli
64f0: 6e 67 2c 20 74 68 65 20 72 65 70 6f 73 69 74 6f  ng, the reposito
6500: 72 79 20 69 6e 63 6c 75 64 65 73 20 63 6f 6d 70  ry includes comp
6510: 69 6c 65 64 20 63 6f 70 69 65 73 20 6f 66 20 74  iled copies of t
6520: 68 65 73 65 0a 70 69 65 63 65 73 2e 20 4d 6f 73  hese.pieces. Mos
6530: 74 20 46 6f 73 73 69 6c 20 68 61 63 6b 65 72 73  t Fossil hackers
6540: 20 73 68 6f 75 6c 64 20 6e 65 76 65 72 20 6e 65   should never ne
6550: 65 64 20 74 6f 20 63 6f 6e 63 65 72 6e 20 74 68  ed to concern th
6560: 65 6d 73 65 6c 76 65 73 0a 77 69 74 68 20 74 68  emselves.with th
6570: 65 20 57 41 53 4d 20 70 61 72 74 73 2c 20 62 75  e WASM parts, bu
6580: 74 20 74 68 69 73 20 73 65 63 74 69 6f 6e 20 64  t this section d
6590: 65 73 63 72 69 62 65 73 20 68 6f 77 20 74 6f 20  escribes how to 
65a0: 66 6f 72 20 74 68 6f 73 65 20 77 68 6f 0a 77 61  for those who.wa
65b0: 6e 74 20 6f 72 20 6e 65 65 64 20 74 6f 20 64 6f  nt or need to do
65c0: 20 73 6f 2e 0a 0a 3c 73 74 72 6f 6e 67 3e 54 68   so...<strong>Th
65d0: 65 20 62 69 74 73 20 64 65 73 63 72 69 62 65 64  e bits described
65e0: 20 69 6e 20 74 68 69 73 20 73 65 63 74 69 6f 6e   in this section
65f0: 20 61 72 65 20 6e 65 63 65 73 73 61 72 79 20 77   are necessary w
6600: 68 65 6e 20 75 70 64 61 74 69 6e 67 0a 3c 74 74  hen updating.<tt
6610: 3e 65 78 74 73 72 63 2f 70 69 6b 63 68 72 2e 63  >extsrc/pikchr.c
6620: 3c 2f 74 74 3e 3c 2f 73 74 72 6f 6e 67 3e 20 66  </tt></strong> f
6630: 72 6f 6d 20 74 68 65 20 75 70 73 74 72 65 61 6d  rom the upstream
6640: 20 73 6f 75 72 63 65 2c 20 6f 72 20 74 68 65 0a   source, or the.
6650: 66 6f 73 73 69 6c 20 62 69 6e 61 72 79 20 77 69  fossil binary wi
6660: 6c 6c 20 75 73 65 20 61 20 64 69 66 66 65 72 65  ll use a differe
6670: 6e 74 20 76 65 72 73 69 6f 6e 20 6f 66 20 70 69  nt version of pi
6680: 6b 63 68 72 20 74 68 61 6e 0a 5b 2f 70 69 6b 63  kchr than.[/pikc
6690: 68 72 73 68 6f 77 5d 20 64 6f 65 73 20 28 61 73  hrshow] does (as
66a0: 20 74 68 65 20 6c 61 74 74 65 72 20 72 75 6e 73   the latter runs
66b0: 20 74 68 65 20 57 41 53 4d 20 62 75 69 6c 64 20   the WASM build 
66c0: 6f 66 20 70 69 6b 63 68 72 29 2e 0a 0a 54 68 65  of pikchr)...The
66d0: 73 65 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 20  se instructions 
66e0: 68 61 76 65 20 6f 6e 6c 79 20 65 76 65 72 20 62  have only ever b
66f0: 65 65 6e 20 74 65 73 74 65 64 20 6f 6e 20 4c 69  een tested on Li
6700: 6e 75 78 20 73 79 73 74 65 6d 73 2e 20 54 68 65  nux systems. The
6710: 79 0a 22 73 68 6f 75 6c 64 22 20 77 6f 72 6b 20  y."should" work 
6720: 6f 6e 20 61 6e 79 20 55 6e 69 78 2d 6c 69 6b 65  on any Unix-like
6730: 20 73 79 73 74 65 6d 20 73 75 70 70 6f 72 74 65   system supporte
6740: 64 20 62 79 20 45 6d 73 63 72 69 70 74 65 6e 2e  d by Emscripten.
6750: 20 54 68 65 0a 66 6f 73 73 69 6c 20 6d 61 6b 65   The.fossil make
6760: 66 69 6c 65 73 20 66 6f 72 20 57 69 6e 64 6f 77  files for Window
6770: 73 20 62 75 69 6c 64 73 20 3c 65 6d 3e 64 6f 20  s builds <em>do 
6780: 6e 6f 74 3c 2f 65 6d 3e 20 69 6e 63 6c 75 64 65  not</em> include
6790: 20 61 6e 79 20 6f 66 20 74 68 65 0a 57 41 53 4d   any of the.WASM
67a0: 2d 72 65 6c 61 74 65 64 20 63 6f 6d 70 6f 6e 65  -related compone
67b0: 6e 74 73 20 28 70 61 74 63 68 65 73 20 74 6f 20  nts (patches to 
67c0: 61 64 64 20 74 68 61 74 20 77 6f 75 6c 64 20 62  add that would b
67d0: 65 20 77 65 6c 63 6f 6d 65 64 2c 20 6f 66 0a 63  e welcomed, of.c
67e0: 6f 75 72 73 65 29 2e 0a 0a 54 68 65 20 66 69 72  ourse)...The fir
67f0: 73 74 20 73 74 65 70 20 69 73 20 74 6f 20 63 6f  st step is to co
6800: 6e 66 69 67 75 72 65 20 74 68 65 20 74 72 65 65  nfigure the tree
6810: 20 77 69 74 68 20 73 75 70 70 6f 72 74 20 66 6f   with support fo
6820: 72 0a 5b 68 74 74 70 73 3a 2f 2f 65 6d 73 63 72  r.[https://emscr
6830: 69 70 74 65 6e 2e 6f 72 67 2f 7c 45 6d 73 63 72  ipten.org/|Emscr
6840: 69 70 74 65 6e 5d 2e 20 54 68 69 73 20 72 65 71  ipten]. This req
6850: 75 69 72 65 73 20 74 68 61 74 20 74 68 65 20 73  uires that the s
6860: 79 73 74 65 6d 0a 68 61 73 20 74 68 65 20 45 6d  ystem.has the Em
6870: 73 63 72 69 70 74 65 6e 20 53 44 4b 20 28 61 2e  scripten SDK (a.
6880: 6b 2e 61 2e 20 65 6d 73 64 6b 29 20 69 6e 73 74  k.a. emsdk) inst
6890: 61 6c 6c 65 64 2c 20 61 73 20 64 6f 63 75 6d 65  alled, as docume
68a0: 6e 74 65 64 20 61 74 3a 0a 0a 5b 68 74 74 70 73  nted at:..[https
68b0: 3a 2f 2f 65 6d 73 63 72 69 70 74 65 6e 2e 6f 72  ://emscripten.or
68c0: 67 2f 64 6f 63 73 2f 67 65 74 74 69 6e 67 5f 73  g/docs/getting_s
68d0: 74 61 72 74 65 64 2f 64 6f 77 6e 6c 6f 61 64 73  tarted/downloads
68e0: 2e 68 74 6d 6c 5d 0a 0a 46 6f 72 20 69 6e 73 74  .html]..For inst
68f0: 72 75 63 74 69 6f 6e 73 20 6f 6e 20 6b 65 65 70  ructions on keep
6900: 69 6e 67 20 74 68 65 20 53 44 4b 20 75 70 20 74  ing the SDK up t
6910: 6f 20 64 61 74 65 2c 20 73 65 65 3a 0a 0a 5b 68  o date, see:..[h
6920: 74 74 70 73 3a 2f 2f 65 6d 73 63 72 69 70 74 65  ttps://emscripte
6930: 6e 2e 6f 72 67 2f 64 6f 63 73 2f 74 6f 6f 6c 73  n.org/docs/tools
6940: 5f 72 65 66 65 72 65 6e 63 65 2f 65 6d 73 64 6b  _reference/emsdk
6950: 2e 68 74 6d 6c 5d 0a 0a 20 20 20 20 53 69 64 65  .html]..    Side
6960: 62 61 72 3a 20 67 65 74 74 69 6e 67 20 45 6d 73  bar: getting Ems
6970: 63 72 69 70 74 65 6e 20 75 70 20 61 6e 64 20 72  cripten up and r
6980: 75 6e 6e 69 6e 67 20 69 73 20 74 72 69 76 69 61  unning is trivia
6990: 6c 20 61 6e 64 0a 20 20 20 20 70 61 69 6e 6c 65  l and.    painle
69a0: 73 73 2c 20 61 74 20 6c 65 61 73 74 20 6f 6e 20  ss, at least on 
69b0: 4c 69 6e 75 78 20 73 79 73 74 65 6d 73 2c 20 62  Linux systems, b
69c0: 75 74 20 74 68 65 20 69 6e 73 74 61 6c 6c 65 72  ut the installer
69d0: 20 64 6f 77 6e 6c 6f 61 64 73 0a 20 20 20 20 6d   downloads.    m
69e0: 61 6e 79 20 68 75 6e 64 72 65 64 73 20 6f 66 20  any hundreds of 
69f0: 6d 65 67 61 62 79 74 65 73 20 6f 66 20 74 6f 6f  megabytes of too
6a00: 6c 73 20 61 6e 64 20 64 65 70 65 6e 64 65 6e 63  ls and dependenc
6a10: 69 65 73 2c 20 61 6c 6c 20 6f 66 20 77 68 69 63  ies, all of whic
6a20: 68 0a 20 20 20 20 77 69 6c 6c 20 62 65 20 69 6e  h.    will be in
6a30: 73 74 61 6c 6c 65 64 20 75 6e 64 65 72 20 74 68  stalled under th
6a40: 65 20 73 69 6e 67 6c 65 20 53 44 4b 20 64 69 72  e single SDK dir
6a50: 65 63 74 6f 72 79 20 28 61 73 20 6f 70 70 6f 73  ectory (as oppos
6a60: 65 64 20 74 6f 0a 20 20 20 20 62 65 69 6e 67 20  ed to.    being 
6a70: 69 6e 73 74 61 6c 6c 65 64 20 61 74 20 74 68 65  installed at the
6a80: 20 73 79 73 74 65 6d 20 6c 65 76 65 6c 29 2e 20   system level). 
6a90: 49 74 20 64 6f 65 73 2c 20 68 6f 77 65 76 65 72  It does, however
6aa0: 2c 20 72 65 71 75 69 72 65 0a 20 20 20 20 74 68  , require.    th
6ab0: 61 74 20 70 79 74 68 6f 6e 33 20 62 65 20 69 6e  at python3 be in
6ac0: 73 74 61 6c 6c 65 64 20 61 74 20 74 68 65 20 73  stalled at the s
6ad0: 79 73 74 65 6d 20 6c 65 76 65 6c 20 61 6e 64 20  ystem level and 
6ae0: 69 74 20 63 61 6e 0a 20 20 20 20 6f 70 74 69 6f  it can.    optio
6af0: 6e 61 6c 6c 79 20 6d 61 6b 65 20 75 73 65 20 6f  nally make use o
6b00: 66 20 61 20 73 79 73 74 65 6d 2d 6c 65 76 65 6c  f a system-level
6b10: 20 63 6d 61 6b 65 20 66 6f 72 20 63 65 72 74 61   cmake for certa
6b20: 69 6e 20 74 61 73 6b 73 0a 20 20 20 20 75 6e 72  in tasks.    unr
6b30: 65 6c 61 74 65 64 20 74 6f 20 68 6f 77 20 66 6f  elated to how fo
6b40: 73 73 69 6c 20 75 73 65 73 20 74 68 65 20 53 44  ssil uses the SD
6b50: 4b 2e 0a 0a 41 66 74 65 72 20 69 6e 73 74 61 6c  K...After instal
6b60: 6c 69 6e 67 20 74 68 65 20 53 44 4b 2c 20 63 6f  ling the SDK, co
6b70: 6e 66 69 67 75 72 65 20 74 68 65 20 66 6f 73 73  nfigure the foss
6b80: 69 6c 20 74 72 65 65 20 77 69 74 68 20 65 6d 73  il tree with ems
6b90: 64 6b 0a 73 75 70 70 6f 72 74 3a 0a 0a 3c 70 72  dk.support:..<pr
6ba0: 65 3e 3c 63 6f 64 65 3e 24 20 2e 2f 63 6f 6e 66  e><code>$ ./conf
6bb0: 69 67 75 72 65 20 2d 2d 77 69 74 68 2d 65 6d 73  igure --with-ems
6bc0: 64 6b 3d 2f 70 61 74 68 2f 74 6f 2f 65 6d 73 64  dk=/path/to/emsd
6bd0: 6b 20 2e 2e 2e 6f 74 68 65 72 20 6f 70 74 69 6f  k ...other optio
6be0: 6e 73 2e 2e 2e 0a 3c 2f 63 6f 64 65 3e 3c 2f 70  ns....</code></p
6bf0: 72 65 3e 0a 0a 49 66 20 74 68 65 20 3c 74 74 3e  re>..If the <tt>
6c00: 2d 2d 77 69 74 68 2d 65 6d 73 64 6b 3c 2f 74 74  --with-emsdk</tt
6c10: 3e 20 66 6c 61 67 20 69 73 20 6e 6f 74 20 70 72  > flag is not pr
6c20: 6f 76 69 64 65 64 2c 20 74 68 65 20 63 6f 6e 66  ovided, the conf
6c30: 69 67 75 72 65 0a 73 63 72 69 70 74 20 77 69 6c  igure.script wil
6c40: 6c 20 63 68 65 63 6b 20 66 6f 72 20 74 68 65 20  l check for the 
6c50: 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69  environment vari
6c60: 61 62 6c 65 20 3c 74 74 3e 45 4d 53 44 4b 3c 2f  able <tt>EMSDK</
6c70: 74 74 3e 2c 20 77 68 69 63 68 0a 69 73 20 6f 6e  tt>, which.is on
6c80: 65 20 6f 66 20 74 68 65 20 73 74 61 6e 64 61 72  e of the standar
6c90: 64 20 76 61 72 69 61 62 6c 65 73 20 74 68 65 20  d variables the 
6ca0: 53 44 4b 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20  SDK environment 
6cb0: 75 73 65 73 2e 20 49 66 20 74 68 61 74 0a 76 61  uses. If that.va
6cc0: 72 69 61 62 6c 65 20 69 73 20 66 6f 75 6e 64 2c  riable is found,
6cd0: 20 69 74 73 20 76 61 6c 75 65 20 77 69 6c 6c 20   its value will 
6ce0: 69 6d 70 6c 69 63 69 74 6c 79 20 62 65 20 75 73  implicitly be us
6cf0: 65 64 20 69 6e 20 70 6c 61 63 65 20 6f 66 20 74  ed in place of t
6d00: 68 65 0a 6d 69 73 73 69 6e 67 20 3c 74 74 3e 2d  he.missing <tt>-
6d10: 2d 77 69 74 68 2d 65 6d 73 64 6b 3c 2f 74 74 3e  -with-emsdk</tt>
6d20: 20 66 6c 61 67 2e 20 54 68 75 73 2c 20 69 66 20   flag. Thus, if 
6d30: 74 68 65 20 3c 74 74 3e 65 6d 73 64 6b 5f 65 6e  the <tt>emsdk_en
6d40: 76 2e 73 68 3c 2f 74 74 3e 0a 73 63 72 69 70 74  v.sh</tt>.script
6d50: 20 69 73 20 73 6f 75 72 63 65 64 20 69 6e 74 6f   is sourced into
6d60: 20 74 68 65 20 73 68 65 6c 6c 20 62 65 66 6f 72   the shell befor
6d70: 65 20 72 75 6e 6e 69 6e 67 20 74 68 65 20 63 6f  e running the co
6d80: 6e 66 69 67 75 72 65 20 73 63 72 69 70 74 2c 0a  nfigure script,.
6d90: 74 68 65 20 53 44 4b 20 77 69 6c 6c 20 62 65 20  the SDK will be 
6da0: 64 65 74 65 63 74 65 64 20 65 76 65 6e 20 77 69  detected even wi
6db0: 74 68 6f 75 74 20 74 68 65 20 63 6f 6e 66 69 67  thout the config
6dc0: 20 66 6c 61 67 2e 0a 0a 54 68 65 20 63 6f 6e 66   flag...The conf
6dd0: 69 67 75 72 65 20 73 63 72 69 70 74 20 69 6e 73  igure script ins
6de0: 74 61 6c 6c 73 20 73 6f 6d 65 20 6d 61 6b 65 66  talls some makef
6df0: 69 6c 65 20 76 61 72 69 61 62 6c 65 73 20 77 68  ile variables wh
6e00: 69 63 68 20 74 65 6c 6c 20 74 68 65 0a 62 75 69  ich tell the.bui
6e10: 6c 64 20 77 68 65 72 65 20 74 6f 20 66 69 6e 64  ld where to find
6e20: 20 74 68 65 20 53 44 4b 20 61 6e 64 20 69 74 20   the SDK and it 
6e30: 67 65 6e 65 72 61 74 65 73 20 61 20 73 63 72 69  generates a scri
6e40: 70 74 20 6e 61 6d 65 64 0a 3c 74 74 3e 74 6f 6f  pt named.<tt>too
6e50: 6c 73 2f 65 6d 63 63 2e 73 68 3c 2f 74 74 3e 20  ls/emcc.sh</tt> 
6e60: 28 66 72 6f 6d 20 74 68 65 20 74 65 6d 70 6c 61  (from the templa
6e70: 74 65 20 66 69 6c 65 0a 3c 74 74 3e 5b 2f 66 69  te file.<tt>[/fi
6e80: 6c 65 2f 74 6f 6f 6c 73 2f 65 6d 63 63 2e 73 68  le/tools/emcc.sh
6e90: 2e 69 6e 7c 2f 74 6f 6f 6c 73 2f 65 6d 63 63 2e  .in|/tools/emcc.
6ea0: 73 68 2e 69 6e 5d 3c 2f 74 74 3e 29 2c 20 77 68  sh.in]</tt>), wh
6eb0: 69 63 68 20 69 73 20 61 0a 77 72 61 70 70 65 72  ich is a.wrapper
6ec0: 20 61 72 6f 75 6e 64 20 74 68 65 20 45 6d 73 63   around the Emsc
6ed0: 72 69 70 74 65 6e 20 43 20 63 6f 6d 70 69 6c 65  ripten C compile
6ee0: 72 20 28 3c 74 74 3e 65 6d 63 63 3c 2f 74 74 3e  r (<tt>emcc</tt>
6ef0: 29 2e 20 54 68 65 20 77 72 61 70 70 65 72 0a 73  ). The wrapper.s
6f00: 63 72 69 70 74 20 75 73 65 73 20 74 68 65 20 63  cript uses the c
6f10: 6f 6e 66 69 67 75 72 65 2d 74 69 6d 65 20 73 74  onfigure-time st
6f20: 61 74 65 20 74 6f 20 61 74 74 65 6d 70 74 20 74  ate to attempt t
6f30: 6f 20 73 65 74 20 75 70 20 74 68 65 20 76 61 72  o set up the var
6f40: 69 6f 75 73 0a 65 6e 76 69 72 6f 6e 6d 65 6e 74  ious.environment
6f50: 20 76 61 72 69 61 62 6c 65 73 20 77 68 69 63 68   variables which
6f60: 20 61 72 65 20 72 65 71 75 69 72 65 64 20 62 79   are required by
6f70: 20 3c 74 74 3e 65 6d 63 63 3c 2f 74 74 3e 20 61   <tt>emcc</tt> a
6f80: 6e 64 20 77 69 6c 6c 0a 66 61 69 6c 20 69 66 20  nd will.fail if 
6f90: 69 74 20 63 61 6e 6e 6f 74 20 64 6f 20 73 6f 2e  it cannot do so.
6fa0: 20 4f 6e 63 65 20 69 74 27 73 20 73 65 74 20 75   Once it's set u
6fb0: 70 20 74 68 65 20 65 6e 76 69 72 6f 6e 6d 65 6e  p the environmen
6fc0: 74 2c 20 69 74 20 70 61 73 73 65 73 0a 6f 6e 20  t, it passes.on 
6fd0: 61 6c 6c 20 6f 66 20 69 74 73 20 61 72 67 75 6d  all of its argum
6fe0: 65 6e 74 73 20 74 6f 20 3c 74 74 3e 65 6d 63 63  ents to <tt>emcc
6ff0: 3c 2f 74 74 3e 2e 0a 0a 54 68 65 20 57 41 53 4d  </tt>...The WASM
7000: 2d 72 65 6c 61 74 65 64 20 62 75 69 6c 64 20 70  -related build p
7010: 61 72 74 73 20 61 72 65 20 73 65 74 20 75 70 20  arts are set up 
7020: 73 75 63 68 20 74 68 61 74 20 6e 6f 6e 65 20 6f  such that none o
7030: 66 20 74 68 65 6d 20 73 68 6f 75 6c 64 0a 65 76  f them should.ev
7040: 65 72 20 74 72 69 67 67 65 72 20 69 6d 70 6c 69  er trigger impli
7050: 63 69 74 79 20 28 65 2e 67 2e 20 76 69 61 20 64  city (e.g. via d
7060: 65 70 65 6e 64 65 6e 63 69 65 73 20 72 65 73 6f  ependencies reso
7070: 6c 75 74 69 6f 6e 29 20 69 6e 20 61 20 6e 6f 72  lution) in a nor
7080: 6d 61 6c 0a 62 75 69 6c 64 20 63 79 63 6c 65 2e  mal.build cycle.
7090: 20 54 68 65 79 20 61 72 65 20 69 6e 73 74 65 61   They are instea
70a0: 64 20 65 78 70 6c 69 63 69 74 6c 79 20 62 75 69  d explicitly bui
70b0: 6c 74 20 61 73 20 64 65 73 63 72 69 62 65 64 20  lt as described 
70c0: 62 65 6c 6f 77 2e 0a 0a 46 72 6f 6d 20 74 68 65  below...From the
70d0: 20 74 6f 70 20 6f 66 20 74 68 65 20 73 6f 75 72   top of the sour
70e0: 63 65 20 74 72 65 65 2c 20 61 6c 6c 20 57 41 53  ce tree, all WAS
70f0: 4d 2d 72 65 6c 61 74 65 64 20 63 6f 6d 70 6f 6e  M-related compon
7100: 65 6e 74 73 20 63 61 6e 20 62 65 0a 62 75 69 6c  ents can be.buil
7110: 74 20 77 69 74 68 3a 0a 0a 3c 70 72 65 3e 3c 63  t with:..<pre><c
7120: 6f 64 65 3e 24 20 6d 61 6b 65 20 77 61 73 6d 3c  ode>$ make wasm<
7130: 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 41 73  /code></pre>..As
7140: 20 6f 66 20 74 68 69 73 20 77 72 69 74 69 6e 67   of this writing
7150: 2c 20 74 68 6f 73 65 20 70 61 72 74 73 20 69 6e  , those parts in
7160: 63 6c 75 64 65 3a 0a 0a 20 20 20 2a 20 20 3c 74  clude:..   *  <t
7170: 74 3e 65 78 74 73 72 63 2f 70 69 6b 63 68 72 2e  t>extsrc/pikchr.
7180: 77 61 73 6d 3c 2f 74 74 3e 20 69 73 20 61 20 57  wasm</tt> is a W
7190: 41 53 4d 2d 63 6f 6d 70 69 6c 65 64 20 66 6f 72  ASM-compiled for
71a0: 6d 20 6f 66 0a 20 20 20 20 20 20 3c 74 74 3e 65  m of.      <tt>e
71b0: 78 74 73 72 63 2f 70 69 6b 63 68 72 2e 63 3c 2f  xtsrc/pikchr.c</
71c0: 74 74 3e 2e 0a 20 20 20 2a 20 20 3c 74 74 3e 65  tt>..   *  <tt>e
71d0: 78 74 73 72 63 2f 70 69 6b 63 68 72 2e 6a 73 3c  xtsrc/pikchr.js<
71e0: 2f 74 74 3e 20 69 73 20 4a 53 2f 57 41 53 4d 20  /tt> is JS/WASM 
71f0: 67 6c 75 65 20 63 6f 64 65 20 67 65 6e 65 72 61  glue code genera
7200: 74 65 64 20 62 79 20 45 6d 73 63 72 69 70 74 65  ted by Emscripte
7210: 6e 0a 20 20 20 20 20 20 74 6f 20 67 69 76 65 20  n.      to give 
7220: 4a 53 20 63 6f 64 65 20 61 63 63 65 73 73 20 74  JS code access t
7230: 6f 20 74 68 65 20 41 50 49 20 65 78 70 6f 72 74  o the API export
7240: 65 64 20 62 79 20 74 68 65 20 57 41 53 4d 20 66  ed by the WASM f
7250: 69 6c 65 2e 0a 0a 20 20 20 20 53 69 64 65 62 61  ile...    Sideba
7260: 72 3a 20 54 68 65 20 66 69 6c 65 0a 20 20 20 20  r: The file.    
7270: 3c 74 74 3e 5b 2f 66 69 6c 65 2f 65 78 74 73 72  <tt>[/file/extsr
7280: 63 2f 70 69 6b 63 68 65 72 2d 77 6f 72 6b 65 72  c/pikcher-worker
7290: 2e 6a 73 7c 65 78 74 73 72 63 2f 70 69 6b 63 68  .js|extsrc/pikch
72a0: 65 72 2d 77 6f 72 6b 65 72 2e 6a 73 5d 3c 2f 74  er-worker.js]</t
72b0: 74 3e 0a 20 20 20 20 69 73 20 68 61 6e 64 2d 63  t>.    is hand-c
72c0: 6f 64 65 64 20 61 6e 64 20 69 6e 74 65 6e 64 65  oded and intende
72d0: 64 20 74 6f 20 62 65 20 6c 6f 61 64 65 64 20 61  d to be loaded a
72e0: 73 20 61 20 22 57 6f 72 6b 65 72 22 20 69 6e 0a  s a "Worker" in.
72f0: 20 20 20 20 4a 61 76 61 53 63 72 69 70 74 2e 20      JavaScript. 
7300: 54 68 61 74 20 66 69 6c 65 20 6c 6f 61 64 73 20  That file loads 
7310: 74 68 65 20 6d 61 69 6e 20 6d 6f 64 75 6c 65 20  the main module 
7320: 61 6e 64 20 70 72 6f 76 69 64 65 73 20 61 6e 0a  and provides an.
7330: 20 20 20 20 69 6e 74 65 72 66 61 63 65 20 76 69      interface vi
7340: 61 20 77 68 69 63 68 20 61 20 6d 61 69 6e 20 4a  a which a main J
7350: 61 76 61 53 63 72 69 70 74 20 74 68 72 65 61 64  avaScript thread
7360: 20 63 61 6e 20 63 6f 6d 6d 75 6e 69 63 61 74 65   can communicate
7370: 20 77 69 74 68 0a 20 20 20 20 70 69 6b 63 68 72   with.    pikchr
7380: 20 72 75 6e 6e 69 6e 67 20 69 6e 20 61 20 57 6f   running in a Wo
7390: 72 6b 65 72 20 74 68 72 65 61 64 2e 20 54 68 65  rker thread. The
73a0: 20 66 69 6c 65 0a 20 20 20 20 3c 74 74 3e 5b 2f   file.    <tt>[/
73b0: 66 69 6c 65 2f 73 72 63 2f 66 6f 73 73 69 6c 2e  file/src/fossil.
73c0: 70 61 67 65 2e 70 69 6b 63 68 72 73 68 6f 77 61  page.pikchrshowa
73d0: 73 6d 2e 6a 73 7c 73 72 63 2f 66 6f 73 73 69 6c  sm.js|src/fossil
73e0: 2e 70 61 67 65 2e 70 69 6b 63 68 72 73 68 6f 77  .page.pikchrshow
73f0: 61 73 6d 2e 6a 73 5d 3c 2f 74 74 3e 0a 20 20 20  asm.js]</tt>.   
7400: 20 69 6d 70 6c 65 6d 65 6e 74 73 20 74 68 65 20   implements the 
7410: 5b 2f 70 69 6b 63 68 72 73 68 6f 77 5d 20 61 70  [/pikchrshow] ap
7420: 70 20 61 6e 64 20 64 65 6d 6f 6e 73 74 72 61 74  p and demonstrat
7430: 65 73 20 68 6f 77 0a 20 20 20 20 3c 74 74 3e 70  es how.    <tt>p
7440: 69 6b 63 68 72 2d 77 6f 72 6b 65 72 2e 6a 73 3c  ikchr-worker.js<
7450: 2f 74 74 3e 20 69 73 20 75 73 65 64 2e 0a 0a 57  /tt> is used...W
7460: 68 65 6e 20 61 20 6e 65 77 20 76 65 72 73 69 6f  hen a new versio
7470: 6e 20 6f 66 20 3c 74 74 3e 65 78 74 73 72 63 2f  n of <tt>extsrc/
7480: 70 69 6b 63 68 72 2e 63 3c 2f 74 74 3e 20 69 73  pikchr.c</tt> is
7490: 20 69 6e 73 74 61 6c 6c 65 64 2c 20 74 68 65 0a   installed, the.
74a0: 66 69 6c 65 73 20 3c 74 74 3e 70 69 6b 63 68 72  files <tt>pikchr
74b0: 2e 7b 6a 73 2c 77 61 73 6d 7d 3c 2f 74 74 3e 20  .{js,wasm}</tt> 
74c0: 77 69 6c 6c 20 6e 65 65 64 20 74 6f 20 62 65 20  will need to be 
74d0: 72 65 63 6f 6d 70 69 6c 65 64 20 74 6f 20 61 63  recompiled to ac
74e0: 63 6f 75 6e 74 0a 66 6f 72 20 74 68 61 74 2e 20  count.for that. 
74f0: 52 75 6e 6e 69 6e 67 20 3c 74 74 3e 6d 61 6b 65  Running <tt>make
7500: 20 77 61 73 6d 3c 2f 74 74 3e 20 77 69 6c 6c 2c   wasm</tt> will,
7510: 20 69 66 20 74 68 65 20 62 75 69 6c 64 20 69 73   if the build is
7520: 20 73 65 74 20 75 70 20 66 6f 72 0a 74 68 65 20   set up for.the 
7530: 65 6d 73 64 6b 2c 20 72 65 63 6f 6d 70 69 6c 65  emsdk, recompile
7540: 20 74 68 6f 73 65 3a 0a 0a 3c 70 72 65 3e 3c 63   those:..<pre><c
7550: 6f 64 65 3e 24 20 6d 61 6b 65 20 77 61 73 6d 0a  ode>$ make wasm.
7560: 2e 2f 74 6f 6f 6c 73 2f 65 6d 63 63 2e 73 68 20  ./tools/emcc.sh 
7570: 2d 6f 20 65 78 74 73 72 63 2f 70 69 6b 63 68 72  -o extsrc/pikchr
7580: 2e 6a 73 20 2e 2e 2e 0a 24 20 6c 73 20 2d 6c 61  .js ....$ ls -la
7590: 20 65 78 74 73 72 63 2f 70 69 6b 63 68 72 2e 7b   extsrc/pikchr.{
75a0: 6a 73 2c 77 61 73 6d 7d 0a 2d 72 77 2d 72 77 2d  js,wasm}.-rw-rw-
75b0: 72 2d 2d 20 31 20 73 74 65 70 68 61 6e 20 73 74  r-- 1 stephan st
75c0: 65 70 68 61 6e 20 31 37 32 36 33 20 4a 75 6e 20  ephan 17263 Jun 
75d0: 20 38 20 30 33 3a 35 39 20 65 78 74 73 72 63 2f   8 03:59 extsrc/
75e0: 70 69 6b 63 68 72 2e 6a 73 0a 2d 72 77 2d 72 77  pikchr.js.-rw-rw
75f0: 2d 72 2d 2d 20 31 20 73 74 65 70 68 61 6e 20 73  -r-- 1 stephan s
7600: 74 65 70 68 61 6e 20 39 37 35 37 38 20 4a 75 6e  tephan 97578 Jun
7610: 20 20 38 20 30 33 3a 35 39 20 65 78 74 73 72 63    8 03:59 extsrc
7620: 2f 70 69 6b 63 68 72 2e 77 61 73 6d 0a 3c 2f 63  /pikchr.wasm.</c
7630: 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a 3c 62 6c 6f  ode></pre>..<blo
7640: 63 6b 71 75 6f 74 65 3e 53 69 64 65 62 61 72 3a  ckquote>Sidebar:
7650: 20 69 66 20 74 68 61 74 20 66 61 69 6c 73 20 77   if that fails w
7660: 69 74 68 20 61 20 6d 65 73 73 61 67 65 20 61 6c  ith a message al
7670: 6f 6e 67 20 74 68 65 20 6c 69 6e 65 73 20 6f 66  ong the lines of
7680: 3a 0a 0a 3c 70 72 65 3e 3c 63 6f 64 65 3e 73 65  :..<pre><code>se
7690: 74 74 69 6e 67 20 60 45 58 50 4f 52 54 45 44 5f  tting `EXPORTED_
76a0: 52 55 4e 54 49 4d 45 5f 4d 45 54 48 4f 44 53 60  RUNTIME_METHODS`
76b0: 20 65 78 70 65 63 74 73 20 60 3c 63 6c 61 73 73   expects `<class
76c0: 20 27 6c 69 73 74 27 3e 60 20 62 75 74 20 67 6f   'list'>` but go
76d0: 74 20 60 3c 63 6c 61 73 73 20 27 73 74 72 27 3e  t `<class 'str'>
76e0: 60 3c 2f 63 6f 64 65 3e 3c 2f 70 72 65 3e 0a 0a  `</code></pre>..
76f0: 74 68 65 6e 20 74 68 65 20 65 6d 63 63 20 62 65  then the emcc be
7700: 69 6e 67 20 69 6e 76 6f 6b 65 64 20 69 73 20 74  ing invoked is t
7710: 6f 6f 20 6f 6c 64 3a 20 65 6d 63 63 20 63 68 61  oo old: emcc cha
7720: 6e 67 65 64 20 74 68 65 20 66 6f 72 6d 61 74 20  nged the format 
7730: 6f 66 0a 6c 69 73 74 2d 74 79 70 65 20 61 72 67  of.list-type arg
7740: 75 6d 65 6e 74 73 20 61 74 20 73 6f 6d 65 20 70  uments at some p
7750: 6f 69 6e 74 2e 20 54 68 65 20 72 65 71 75 69 72  oint. The requir
7760: 65 64 20 6d 69 6e 69 6d 75 6d 20 76 65 72 73 69  ed minimum versi
7770: 6f 6e 20 69 73 0a 75 6e 6b 6e 6f 77 6e 2c 20 62  on is.unknown, b
7780: 75 74 20 61 6e 79 20 53 44 4b 20 76 65 72 73 69  ut any SDK versi
7790: 6f 6e 20 66 72 6f 6d 20 4d 61 79 20 32 30 32 32  on from May 2022
77a0: 20 6f 72 20 6c 61 74 65 72 20 22 73 68 6f 75 6c   or later "shoul
77b0: 64 22 20 28 61 73 20 6f 66 0a 74 68 69 73 20 77  d" (as of.this w
77c0: 72 69 74 69 6e 67 29 20 73 75 66 66 69 63 65 2e  riting) suffice.
77d0: 20 41 6e 79 20 6f 6c 64 65 72 20 76 65 72 73 69   Any older versi
77e0: 6f 6e 20 6d 61 79 20 6f 72 20 6d 61 79 20 6e 6f  on may or may no
77f0: 74 20 77 6f 72 6b 2e 0a 3c 2f 62 6c 6f 63 6b 71  t work..</blockq
7800: 75 6f 74 65 3e 0a 0a 41 66 74 65 72 20 74 68 61  uote>..After tha
7810: 74 20 73 75 63 63 65 65 64 73 2c 20 77 65 20 6e  t succeeds, we n
7820: 65 65 64 20 74 6f 20 72 75 6e 20 74 68 65 20 6e  eed to run the n
7830: 6f 72 6d 61 6c 20 62 75 69 6c 64 20 73 6f 20 74  ormal build so t
7840: 68 61 74 20 74 68 6f 73 65 0a 67 65 6e 65 72 61  hat those.genera
7850: 74 65 64 20 66 69 6c 65 73 20 63 61 6e 20 62 65  ted files can be
7860: 20 63 6f 6d 70 69 6c 65 64 20 69 6e 20 74 6f 20   compiled in to 
7870: 74 68 65 20 66 6f 73 73 69 6c 20 62 69 6e 61 72  the fossil binar
7880: 79 2c 20 61 63 63 65 73 73 69 62 6c 65 0a 76 69  y, accessible.vi
7890: 61 20 74 68 65 20 5b 2f 68 65 6c 70 3f 63 6d 64  a the [/help?cmd
78a0: 3d 2f 62 75 69 6c 74 69 6e 7c 2f 62 75 69 6c 74  =/builtin|/built
78b0: 69 6e 20 70 61 67 65 5d 3a 0a 0a 3c 70 72 65 3e  in page]:..<pre>
78c0: 3c 63 6f 64 65 3e 24 20 6d 61 6b 65 3c 2f 63 6f  <code>$ make</co
78d0: 64 65 3e 3c 2f 70 72 65 3e 0a 0a 42 65 66 6f 72  de></pre>..Befor
78e0: 65 20 63 68 65 63 6b 69 6e 67 20 69 6e 20 74 68  e checking in th
78f0: 6f 73 65 20 6e 65 77 6c 79 2d 62 75 69 6c 74 20  ose newly-built 
7900: 66 69 6c 65 73 2c 20 74 68 65 79 20 6e 65 65 64  files, they need
7910: 20 74 6f 20 62 65 20 74 65 73 74 65 64 20 62 79   to be tested by
7920: 0a 72 75 6e 6e 69 6e 67 20 74 68 65 20 5b 2f 70  .running the [/p
7930: 69 6b 63 68 72 73 68 6f 77 5d 20 70 61 67 65 2e  ikchrshow] page.
7940: 20 49 66 20 74 68 61 74 20 70 61 67 65 20 6c 6f   If that page lo
7950: 61 64 73 2c 20 74 68 65 20 63 6f 6d 70 69 6c 61  ads, the compila
7960: 74 69 6f 6e 0a 70 72 6f 63 65 73 73 20 66 75 6e  tion.process fun
7970: 64 61 6d 65 6e 74 61 6c 6c 79 20 77 6f 72 6b 65  damentally worke
7980: 64 20 28 61 20 6c 6f 61 64 20 66 61 69 6c 75 72  d (a load failur
7990: 65 20 77 69 6c 6c 20 62 65 20 6d 61 64 65 20 6f  e will be made o
79a0: 62 76 69 6f 75 73 20 74 6f 0a 74 68 65 20 76 69  bvious to.the vi
79b0: 65 77 65 72 29 2e 20 49 66 20 69 74 20 66 61 69  ewer). If it fai
79c0: 6c 73 20 74 6f 20 6c 6f 61 64 20 74 68 65 6e 20  ls to load then 
79d0: 74 68 65 20 62 72 6f 77 73 65 72 27 73 20 64 65  the browser's de
79e0: 76 20 74 6f 6f 6c 73 20 63 6f 6e 73 6f 6c 65 0a  v tools console.
79f0: 6c 69 6b 65 6c 79 20 70 72 6f 76 69 64 65 73 20  likely provides 
7a00: 61 74 20 6c 65 61 73 74 20 61 20 73 6d 61 6c 6c  at least a small
7a10: 20 68 69 6e 74 20 28 61 6e 64 20 3c 65 6d 3e 73   hint (and <em>s
7a20: 6f 6d 65 74 69 6d 65 73 3c 2f 65 6d 3e 20 61 20  ometimes</em> a 
7a30: 75 73 65 66 75 6c 0a 68 69 6e 74 29 20 61 62 6f  useful.hint) abo
7a40: 75 74 20 74 68 65 20 6e 61 74 75 72 65 20 6f 66  ut the nature of
7a50: 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e 20 44 6f   the problem. Do
7a60: 6e 27 74 20 63 68 65 63 6b 20 74 68 6f 73 65 20  n't check those 
7a70: 66 69 6c 65 73 20 69 6e 0a 75 6e 74 69 6c 20 5b  files in.until [
7a80: 2f 70 69 6b 63 68 72 73 68 6f 77 5d 20 72 75 6e  /pikchrshow] run
7a90: 73 2c 20 74 68 6f 75 67 68 21 0a 0a 53 68 6f 75  s, though!..Shou
7aa0: 6c 64 20 70 69 6b 63 68 72 27 73 20 43 20 69 6e  ld pikchr's C in
7ab0: 74 65 72 66 61 63 65 20 65 76 65 72 20 63 68 61  terface ever cha
7ac0: 6e 67 65 2c 20 3c 74 74 3e 70 69 6b 63 68 72 2d  nge, <tt>pikchr-
7ad0: 77 6f 72 6b 65 72 2e 6a 73 3c 2f 74 74 3e 0a 77  worker.js</tt>.w
7ae0: 69 6c 6c 20 6e 65 65 64 20 74 6f 20 62 65 20 75  ill need to be u
7af0: 70 64 61 74 65 64 20 74 6f 20 61 63 63 6f 6d 6d  pdated to accomm
7b00: 6f 64 61 74 65 20 69 74 2c 20 62 75 74 20 73 75  odate it, but su
7b10: 63 68 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e 20  ch modification 
7b20: 69 73 0a 74 79 70 69 63 61 6c 6c 79 20 74 72 69  is.typically tri
7b30: 76 69 61 6c 2e 0a 0a 3c 68 33 3e 38 2e 31 20 53  vial...<h3>8.1 S
7b40: 6f 6c 75 74 69 6f 6e 73 20 6f 74 68 65 72 20 74  olutions other t
7b50: 68 61 6e 20 45 6d 73 63 72 69 70 74 65 6e 3f 3c  han Emscripten?<
7b60: 2f 68 33 3e 0a 0a 45 6d 73 63 72 69 70 74 65 6e  /h3>..Emscripten
7b70: 20 69 73 20 6e 6f 74 20 74 68 65 20 6f 6e 6c 79   is not the only
7b80: 20 6f 70 74 69 6f 6e 20 66 6f 72 20 62 75 69 6c   option for buil
7b90: 64 69 6e 67 20 43 20 61 73 20 57 41 53 4d 2c 20  ding C as WASM, 
7ba0: 62 75 74 20 69 74 0a 70 72 6f 76 69 64 65 73 20  but it.provides 
7bb0: 61 20 63 6f 6d 70 6c 65 74 65 20 74 6f 6f 6c 63  a complete toolc
7bc0: 68 61 69 6e 20 77 68 69 63 68 20 65 6c 69 6d 69  hain which elimi
7bd0: 6e 61 74 65 73 20 6d 61 6e 79 20 6f 74 68 65 72  nates many other
7be0: 20 73 74 65 70 73 20 77 68 69 63 68 0a 6d 75 73   steps which.mus
7bf0: 74 20 6f 74 68 65 72 77 69 73 65 20 62 65 20 61  t otherwise be a
7c00: 63 63 6f 75 6e 74 65 64 20 66 6f 72 20 6f 6e 20  ccounted for on 
7c10: 61 20 70 65 72 2d 70 72 6f 6a 65 63 74 20 62 61  a per-project ba
7c20: 73 69 73 2e 20 20 44 65 73 70 69 74 65 20 69 74  sis.  Despite it
7c30: 73 0a 63 6f 6e 76 65 6e 69 65 6e 63 65 2c 20 69  s.convenience, i
7c40: 74 20 62 65 68 6f 6f 76 65 73 20 75 73 20 74 6f  t behooves us to
7c50: 20 65 78 70 6c 6f 72 65 20 6f 74 68 65 72 20 62   explore other b
7c60: 75 69 6c 64 20 6f 70 74 69 6f 6e 73 20 66 6f 72  uild options for
7c70: 20 74 68 65 0a 73 61 6b 65 20 6f 66 20 70 6f 72   the.sake of por
7c80: 74 61 62 69 6c 69 74 79 20 61 6e 64 20 61 76 6f  tability and avo
7c90: 69 64 69 6e 67 20 77 68 61 74 20 61 6d 6f 75 6e  iding what amoun
7ca0: 74 73 20 74 6f 20 76 65 6e 64 6f 72 20 6c 6f 63  ts to vendor loc
7cb0: 6b 2d 69 6e 2e 0a 0a 46 6f 72 20 6c 61 74 65 72  k-in...For later
7cc0: 20 72 65 66 65 72 65 72 65 6e 63 65 2c 20 68 65   refererence, he
7cd0: 72 65 20 61 72 65 20 61 72 74 69 63 6c 65 73 20  re are articles 
7ce0: 73 70 65 63 69 66 69 63 61 6c 6c 79 20 63 6f 76  specifically cov
7cf0: 65 72 69 6e 67 0a 62 75 69 6c 64 69 6e 67 20 57  ering.building W
7d00: 41 53 4d 20 70 72 6f 6a 65 63 74 73 20 77 69 74  ASM projects wit
7d10: 68 6f 75 74 20 75 73 69 6e 67 20 45 6d 73 63 72  hout using Emscr
7d20: 69 70 74 65 6e 3a 0a 0a 20 20 20 2a 20 20 5b 68  ipten:..   *  [h
7d30: 74 74 70 73 3a 2f 2f 73 75 72 6d 61 2e 64 65 76  ttps://surma.dev
7d40: 2f 74 68 69 6e 67 73 2f 63 2d 74 6f 2d 77 65 62  /things/c-to-web
7d50: 61 73 73 65 6d 62 6c 79 2f 5d 0a 20 20 20 2a 20  assembly/].   * 
7d60: 20 5b 68 74 74 70 73 3a 2f 2f 73 63 68 65 6c 6c   [https://schell
7d70: 63 6f 64 65 2e 67 69 74 68 75 62 2e 69 6f 2f 77  code.github.io/w
7d80: 65 62 61 73 73 65 6d 62 6c 79 2d 77 69 74 68 6f  ebassembly-witho
7d90: 75 74 2d 65 6d 73 63 72 69 70 74 65 6e 5d 0a     ut-emscripten].