Login
Hex Artifact Content
Login

Artifact 597015337c61750bdd4ab62c90fa97602e1f1d5b96d9bcfebf5f29d7bf625af6:

Also attachment "stage-aarch64.md" to tech note [b71cd91d66] added by aarch64-1-ollama-session 2026-11-04 15:14:54.
0000: 54 68 65 20 61 61 72 63 68 36 34 20 73 74 61 67  The aarch64 stag
0010: 65 20 70 61 74 74 65 72 6e 3a 20 5b 74 68 65 20  e pattern: [the 
0020: 73 74 61 67 65 20 70 61 74 74 65 72 6e 5d 28 73  stage pattern](s
0030: 74 61 67 65 2e 6d 64 29 20 66 6f 72 20 61 6e 20  tage.md) for an 
0040: 61 61 72 63 68 36 34 20 62 75 69 6c 64 65 72 2c  aarch64 builder,
0050: 20 64 69 66 66 65 72 69 6e 67 20 6f 6e 6c 79 20   differing only 
0060: 69 6e 20 74 68 65 20 61 72 63 68 69 74 65 63 74  in the architect
0070: 75 72 65 20 69 74 73 20 62 75 69 6c 64 20 6e 61  ure its build na
0080: 6d 65 73 2e 20 41 20 73 65 73 73 69 6f 6e 20 73  mes. A session s
0090: 65 6e 64 73 20 69 74 20 74 68 65 20 73 61 6d 65  ends it the same
00a0: 20 77 61 79 2c 20 77 69 74 68 20 74 68 69 73 20   way, with this 
00b0: 66 69 6c 65 27 73 20 6f 77 6e 20 63 6f 6e 74 65  file's own conte
00c0: 6e 74 2d 61 64 64 72 65 73 73 65 64 20 72 61 77  nt-addressed raw
00d0: 20 55 52 4c 3a 20 60 6f 63 78 32 20 63 72 65 61   URL: `ocx2 crea
00e0: 74 65 20 22 73 74 61 67 65 20 43 48 45 43 4b 49  te "stage CHECKI
00f0: 4e 22 20 2d 2d 70 61 74 74 65 72 6e 20 55 52 4c  N" --pattern URL
0100: 20 2d 2d 6c 6f 67 69 6e 20 4c 4f 47 49 4e 20 2d   --login LOGIN -
0110: 2d 63 6c 6f 6e 65 20 43 4f 44 45 20 2d 2d 74 6f  -clone CODE --to
0120: 20 50 4f 53 54 20 2d 2d 6f 66 20 43 48 45 43 4b   POST --of CHECK
0130: 49 4e 60 2c 20 4c 4f 47 49 4e 20 61 6e 64 20 43  IN`, LOGIN and C
0140: 4f 44 45 20 6e 61 6d 69 6e 67 20 74 68 65 20 61  ODE naming the a
0150: 61 72 63 68 36 34 20 62 75 69 6c 64 65 72 27 73  arch64 builder's
0160: 20 61 63 74 69 6e 67 20 6c 6f 67 69 6e 20 61 6e   acting login an
0170: 64 20 69 74 73 20 63 6c 6f 6e 65 27 73 20 73 65  d its clone's se
0180: 72 76 65 72 2d 63 6f 64 65 2c 20 61 6e 64 20 60  rver-code, and `
0190: 2d 2d 6f 66 60 20 74 68 65 20 63 68 65 63 6b 2d  --of` the check-
01a0: 69 6e 27 73 20 66 75 6c 6c 20 68 61 73 68 2e 0a  in's full hash..
01b0: 0a 54 68 65 20 72 75 6e 20 63 6c 6f 6e 65 73 20  .The run clones 
01c0: 74 68 65 20 73 65 72 76 65 72 20 61 6e 6f 6e 79  the server anony
01d0: 6d 6f 75 73 6c 79 2c 20 6f 70 65 6e 73 20 43 48  mously, opens CH
01e0: 45 43 4b 49 4e 20 61 6e 64 20 72 75 6e 73 20 60  ECKIN and runs `
01f0: 63 72 79 73 74 61 6c 20 72 75 6e 20 63 69 2e 63  crystal run ci.c
0200: 72 20 2d 2d 20 62 75 69 6c 64 20 24 24 77 6f 72  r -- build $$wor
0210: 6b 73 70 61 63 65 24 24 2f 72 65 6c 65 61 73 65  kspace$$/release
0220: 20 61 61 72 63 68 36 34 60 20 74 68 65 72 65 2c   aarch64` there,
0230: 20 6e 69 63 65 64 2e 20 54 68 61 74 20 62 75 69   niced. That bui
0240: 6c 64 20 69 73 20 6c 69 6e 6b 65 64 20 60 2d 2d  ld is linked `--
0250: 73 74 61 74 69 63 60 2c 20 73 6f 20 69 74 73 20  static`, so its 
0260: 60 6f 63 78 32 60 20 64 65 70 65 6e 64 73 20 6f  `ocx2` depends o
0270: 6e 20 6e 6f 20 68 6f 73 74 27 73 20 6c 69 62 63  n no host's libc
0280: 3a 20 6f 6e 65 20 62 69 6e 61 72 79 20 72 75 6e  : one binary run
0290: 73 20 6f 6e 20 74 68 65 20 6d 75 73 6c 20 62 75  s on the musl bu
02a0: 69 6c 64 65 72 20 61 6e 64 20 6f 6e 20 61 20 67  ilder and on a g
02b0: 6c 69 62 63 20 68 6f 73 74 20 73 75 63 68 20 61  libc host such a
02c0: 73 20 61 20 42 65 61 67 6c 65 42 61 64 67 65 27  s a BeagleBadge'
02d0: 73 20 44 65 62 69 61 6e 2e 20 54 68 65 20 62 75  s Debian. The bu
02e0: 69 6c 64 65 72 20 6e 65 65 64 73 20 43 72 79 73  ilder needs Crys
02f0: 74 61 6c 20 61 73 20 60 73 68 61 72 64 2e 79 6d  tal as `shard.ym
0300: 6c 60 20 70 69 6e 73 20 69 74 20 61 6e 64 20 74  l` pins it and t
0310: 68 65 20 73 74 61 74 69 63 20 6c 69 62 72 61 72  he static librar
0320: 69 65 73 20 60 6f 63 78 2d 6e 6f 64 65 2f 44 6f  ies `ocx-node/Do
0330: 63 6b 65 72 66 69 6c 65 60 20 69 6e 73 74 61 6c  ckerfile` instal
0340: 6c 73 2e 20 4f 43 58 20 73 65 6e 64 73 20 60 6f  ls. OCX sends `o
0350: 63 78 32 60 2c 20 60 72 65 6c 65 61 73 65 2e 74  cx2`, `release.t
0360: 78 74 60 20 61 6e 64 20 60 67 61 74 65 2e 74 78  xt` and `gate.tx
0370: 74 60 20 61 73 20 75 6e 76 65 72 73 69 6f 6e 65  t` as unversione
0380: 64 20 66 69 6c 65 73 20 75 6e 64 65 72 20 60 72  d files under `r
0390: 65 6c 65 61 73 65 73 2f 24 24 72 75 6e 24 24 2f  eleases/$$run$$/
03a0: 60 2c 20 61 73 20 74 68 65 20 73 74 61 67 65 20  `, as the stage 
03b0: 70 61 74 74 65 72 6e 20 64 6f 65 73 2c 20 61 6e  pattern does, an
03c0: 64 20 74 68 65 20 62 75 69 6c 64 65 72 27 73 20  d the builder's 
03d0: 60 65 6e 64 65 64 60 20 72 65 63 6f 72 64 73 20  `ended` records 
03e0: 65 61 63 68 20 6f 6e 65 27 73 20 53 48 41 2d 32  each one's SHA-2
03f0: 35 36 2c 20 77 68 69 6c 65 20 69 74 73 20 60 73  56, while its `s
0400: 74 61 72 74 65 64 60 20 6e 61 6d 65 73 20 74 68  tarted` names th
0410: 65 20 63 68 65 63 6b 2d 69 6e 20 69 6e 20 66 75  e check-in in fu
0420: 6c 6c 2e 0a 0a 54 68 61 74 20 72 65 63 6f 72 64  ll...That record
0430: 20 69 73 20 74 68 65 20 6d 61 70 70 69 6e 67 20   is the mapping 
0440: 66 72 6f 6d 20 73 6f 75 72 63 65 20 74 6f 20 62  from source to b
0450: 69 6e 61 72 79 2e 20 49 6d 70 6f 72 74 20 74 61  inary. Import ta
0460: 6b 65 73 20 6f 6e 6c 79 20 74 68 65 20 73 65 72  kes only the ser
0470: 76 65 72 27 73 20 6f 77 6e 20 61 72 63 68 69 74  ver's own archit
0480: 65 63 74 75 72 65 2c 20 73 69 6e 63 65 20 69 74  ecture, since it
0490: 20 73 6d 6f 6b 65 73 20 60 6f 63 78 32 60 20 69   smokes `ocx2` i
04a0: 6e 20 74 68 65 20 73 65 72 76 65 72 27 73 20 72  n the server's r
04b0: 6f 6f 74 2c 20 73 6f 20 61 6e 20 61 61 72 63 68  oot, so an aarch
04c0: 36 34 20 72 75 6e 20 69 73 20 6e 6f 74 20 69 6d  64 run is not im
04d0: 70 6f 72 74 65 64 20 69 6e 74 6f 20 61 6e 20 78  ported into an x
04e0: 38 36 5f 36 34 20 73 65 72 76 65 72 2e 20 41 20  86_64 server. A 
04f0: 68 6f 73 74 20 74 68 61 74 20 72 75 6e 73 20 74  host that runs t
0500: 68 65 20 62 75 69 6c 64 20 66 65 74 63 68 65 73  he build fetches
0510: 20 69 74 73 20 66 69 6c 65 73 20 62 79 20 6e 61   its files by na
0520: 6d 65 20 61 6e 64 20 63 68 65 63 6b 73 20 74 68  me and checks th
0530: 65 6d 20 61 67 61 69 6e 73 74 20 74 68 65 20 60  em against the `
0540: 65 6e 64 65 64 60 20 68 61 73 68 65 73 2c 20 6b  ended` hashes, k
0550: 65 65 70 69 6e 67 20 74 68 65 20 62 75 69 6c 64  eeping the build
0560: 20 69 74 20 72 75 6e 73 20 66 6f 72 20 72 6f 6c   it runs for rol
0570: 6c 62 61 63 6b 2e 20 41 20 70 65 72 73 6f 6e 20  lback. A person 
0580: 74 68 65 6e 20 72 65 6d 6f 76 65 73 20 74 68 65  then removes the
0590: 20 73 68 61 72 65 64 20 66 69 6c 65 73 2c 20 73   shared files, s
05a0: 6f 20 62 75 69 6c 64 73 20 64 6f 20 6e 6f 74 20  o builds do not 
05b0: 70 69 6c 65 20 75 70 20 69 6e 20 74 68 65 20 72  pile up in the r
05c0: 65 70 6f 73 69 74 6f 72 79 3b 20 6f 6e 63 65 20  epository; once 
05d0: 61 20 62 75 69 6c 64 20 69 73 20 6c 6f 73 74 2c  a build is lost,
05e0: 20 69 74 20 69 73 20 6c 6f 73 74 2c 20 61 6e 64   it is lost, and
05f0: 20 69 74 73 20 73 6f 75 72 63 65 20 63 61 6e 20   its source can 
0600: 73 74 69 6c 6c 20 62 65 20 66 6f 75 6e 64 20 66  still be found f
0610: 72 6f 6d 20 74 68 65 20 72 65 63 6f 72 64 2e 0a  rom the record..
0620: 0a 60 60 60 6a 73 6f 6e 0a 7b 0a 20 20 22 77 6f  .```json.{.  "wo
0630: 72 6b 73 70 61 63 65 22 3a 20 5b 0a 20 20 20 20  rkspace": [.    
0640: 7b 0a 20 20 20 20 20 20 22 73 74 65 70 22 3a 20  {.      "step": 
0650: 22 64 69 72 65 63 74 6f 72 79 22 2c 0a 20 20 20  "directory",.   
0660: 20 20 20 22 61 74 22 3a 20 22 24 24 72 6f 6f 74     "at": "$$root
0670: 24 24 2f 24 24 70 72 6f 63 65 73 73 5f 75 73 65  $$/$$process_use
0680: 72 24 24 2f 70 72 6f 6a 65 63 74 73 2f 24 24 72  r$$/projects/$$r
0690: 65 70 6f 73 69 74 6f 72 79 5f 6e 61 6d 65 24 24  epository_name$$
06a0: 2f 24 24 72 75 6e 24 24 22 2c 0a 20 20 20 20 20  /$$run$$",.     
06b0: 20 22 72 65 6d 6f 76 65 5f 6f 6e 22 3a 20 22 73   "remove_on": "s
06c0: 61 76 65 64 22 0a 20 20 20 20 7d 0a 20 20 5d 2c  aved".    }.  ],
06d0: 0a 20 20 22 73 61 6e 64 62 6f 78 22 3a 20 7b 0a  .  "sandbox": {.
06e0: 20 20 20 20 22 75 69 64 22 3a 20 31 30 30 30 2c      "uid": 1000,
06f0: 0a 20 20 20 20 22 67 69 64 22 3a 20 31 30 30 30  .    "gid": 1000
0700: 2c 0a 20 20 20 20 22 6c 69 6e 75 78 5f 63 61 70  ,.    "linux_cap
0710: 61 62 69 6c 69 74 69 65 73 22 3a 20 5b 5d 2c 0a  abilities": [],.
0720: 20 20 20 20 22 6e 65 74 77 6f 72 6b 22 3a 20 74      "network": t
0730: 72 75 65 2c 0a 20 20 20 20 22 69 73 6f 6c 61 74  rue,.    "isolat
0740: 65 5f 74 65 72 6d 69 6e 61 6c 22 3a 20 74 72 75  e_terminal": tru
0750: 65 2c 0a 20 20 20 20 22 65 6e 64 73 5f 77 69 74  e,.    "ends_wit
0760: 68 5f 70 61 72 65 6e 74 22 3a 20 74 72 75 65 2c  h_parent": true,
0770: 0a 20 20 20 20 22 72 65 61 64 5f 6f 6e 6c 79 22  .    "read_only"
0780: 3a 20 5b 0a 20 20 20 20 20 20 22 2f 75 73 72 22  : [.      "/usr"
0790: 2c 20 22 2f 62 69 6e 22 2c 20 22 2f 73 62 69 6e  , "/bin", "/sbin
07a0: 22 2c 20 22 2f 6c 69 62 22 2c 20 22 2f 6c 69 62  ", "/lib", "/lib
07b0: 36 34 22 2c 0a 20 20 20 20 20 20 22 2f 65 74 63  64",.      "/etc
07c0: 2f 72 65 73 6f 6c 76 2e 63 6f 6e 66 22 2c 20 22  /resolv.conf", "
07d0: 2f 65 74 63 2f 68 6f 73 74 73 22 2c 20 22 2f 65  /etc/hosts", "/e
07e0: 74 63 2f 6e 73 73 77 69 74 63 68 2e 63 6f 6e 66  tc/nsswitch.conf
07f0: 22 2c 20 22 2f 65 74 63 2f 73 73 6c 2f 63 65 72  ", "/etc/ssl/cer
0800: 74 73 22 0a 20 20 20 20 5d 2c 0a 20 20 20 20 22  ts".    ],.    "
0810: 72 65 61 64 5f 77 72 69 74 65 22 3a 20 5b 22 24  read_write": ["$
0820: 24 77 6f 72 6b 73 70 61 63 65 24 24 22 5d 2c 0a  $workspace$$"],.
0830: 20 20 20 20 22 68 6f 6d 65 73 22 3a 20 5b 5d 2c      "homes": [],
0840: 0a 20 20 20 20 22 63 72 65 61 74 65 64 5f 66 69  .    "created_fi
0850: 6c 65 73 22 3a 20 5b 0a 20 20 20 20 20 20 7b 0a  les": [.      {.
0860: 20 20 20 20 20 20 20 20 22 61 74 22 3a 20 22 2f          "at": "/
0870: 65 74 63 2f 70 61 73 73 77 64 22 2c 0a 20 20 20  etc/passwd",.   
0880: 20 20 20 20 20 22 74 65 78 74 22 3a 20 22 24 24       "text": "$$
0890: 70 72 6f 63 65 73 73 5f 75 73 65 72 24 24 3a 78  process_user$$:x
08a0: 3a 31 30 30 30 3a 31 30 30 30 3a 3a 24 24 77 6f  :1000:1000::$$wo
08b0: 72 6b 73 70 61 63 65 24 24 3a 2f 62 69 6e 2f 73  rkspace$$:/bin/s
08c0: 68 5c 6e 22 0a 20 20 20 20 20 20 7d 0a 20 20 20  h\n".      }.   
08d0: 20 5d 2c 0a 20 20 20 20 22 70 72 6f 63 22 3a 20   ],.    "proc": 
08e0: 22 2f 70 72 6f 63 22 2c 0a 20 20 20 20 22 64 65  "/proc",.    "de
08f0: 76 22 3a 20 22 2f 64 65 76 22 2c 0a 20 20 20 20  v": "/dev",.    
0900: 22 74 6d 70 22 3a 20 22 2f 74 6d 70 22 0a 20 20  "tmp": "/tmp".  
0910: 7d 2c 0a 20 20 22 6c 69 6d 69 74 73 22 3a 20 7b  },.  "limits": {
0920: 0a 20 20 20 20 22 77 61 6c 6c 22 3a 20 22 32 68  .    "wall": "2h
0930: 22 2c 0a 20 20 20 20 22 63 70 75 22 3a 20 33 36  ",.    "cpu": 36
0940: 30 30 2c 0a 20 20 20 20 22 70 72 6f 63 65 73 73  00,.    "process
0950: 65 73 22 3a 20 35 31 32 2c 0a 20 20 20 20 22 66  es": 512,.    "f
0960: 69 6c 65 5f 73 69 7a 65 22 3a 20 22 32 35 36 4d  ile_size": "256M
0970: 22 0a 20 20 7d 2c 0a 20 20 22 70 72 6f 63 65 73  ".  },.  "proces
0980: 73 22 3a 20 7b 0a 20 20 20 20 22 75 73 65 72 22  s": {.    "user"
0990: 3a 20 22 73 74 61 67 65 2d 74 61 73 6b 22 2c 0a  : "stage-task",.
09a0: 20 20 20 20 22 63 6f 6d 6d 61 6e 64 22 3a 20 5b      "command": [
09b0: 0a 20 20 20 20 20 20 22 2f 62 69 6e 2f 73 68 22  .      "/bin/sh"
09c0: 2c 20 22 2d 63 22 2c 0a 20 20 20 20 20 20 22 66  , "-c",.      "f
09d0: 6f 73 73 69 6c 20 63 6c 6f 6e 65 20 24 24 73 65  ossil clone $$se
09e0: 72 76 65 72 5f 75 72 6c 24 24 20 24 24 77 6f 72  rver_url$$ $$wor
09f0: 6b 73 70 61 63 65 24 24 2f 63 6c 6f 6e 65 2e 66  kspace$$/clone.f
0a00: 6f 73 73 69 6c 20 26 26 20 6d 6b 64 69 72 20 24  ossil && mkdir $
0a10: 24 77 6f 72 6b 73 70 61 63 65 24 24 2f 74 72 65  $workspace$$/tre
0a20: 65 20 26 26 20 66 6f 73 73 69 6c 20 6f 70 65 6e  e && fossil open
0a30: 20 24 24 77 6f 72 6b 73 70 61 63 65 24 24 2f 63   $$workspace$$/c
0a40: 6c 6f 6e 65 2e 66 6f 73 73 69 6c 20 24 24 63 68  lone.fossil $$ch
0a50: 65 63 6b 69 6e 24 24 20 2d 2d 63 68 64 69 72 20  eckin$$ --chdir 
0a60: 24 24 77 6f 72 6b 73 70 61 63 65 24 24 2f 74 72  $$workspace$$/tr
0a70: 65 65 20 2d 2d 6e 6f 73 79 6e 63 20 26 26 20 63  ee --nosync && c
0a80: 64 20 24 24 77 6f 72 6b 73 70 61 63 65 24 24 2f  d $$workspace$$/
0a90: 74 72 65 65 20 26 26 20 6e 69 63 65 20 2d 6e 20  tree && nice -n 
0aa0: 31 39 20 69 6f 6e 69 63 65 20 2d 63 33 20 63 72  19 ionice -c3 cr
0ab0: 79 73 74 61 6c 20 72 75 6e 20 63 69 2e 63 72 20  ystal run ci.cr 
0ac0: 2d 2d 20 62 75 69 6c 64 20 24 24 77 6f 72 6b 73  -- build $$works
0ad0: 70 61 63 65 24 24 2f 72 65 6c 65 61 73 65 20 61  pace$$/release a
0ae0: 61 72 63 68 36 34 22 0a 20 20 20 20 5d 2c 0a 20  arch64".    ],. 
0af0: 20 20 20 22 63 77 64 22 3a 20 22 24 24 77 6f 72     "cwd": "$$wor
0b00: 6b 73 70 61 63 65 24 24 22 2c 0a 20 20 20 20 22  kspace$$",.    "
0b10: 6b 65 65 70 22 3a 20 7b 22 73 74 64 65 72 72 22  keep": {"stderr"
0b20: 3a 20 22 34 4b 22 2c 20 22 73 74 64 6f 75 74 22  : "4K", "stdout"
0b30: 3a 20 22 34 4b 22 2c 20 22 73 74 64 6f 75 74 5f  : "4K", "stdout_
0b40: 77 68 65 6e 22 3a 20 22 61 6c 77 61 79 73 22 7d  when": "always"}
0b50: 2c 0a 20 20 20 20 22 75 6e 76 65 72 73 69 6f 6e  ,.    "unversion
0b60: 65 64 5f 66 69 6c 65 73 22 3a 20 5b 0a 20 20 20  ed_files": [.   
0b70: 20 20 20 7b 22 61 74 22 3a 20 22 24 24 77 6f 72     {"at": "$$wor
0b80: 6b 73 70 61 63 65 24 24 2f 72 65 6c 65 61 73 65  kspace$$/release
0b90: 2f 6f 63 78 32 22 2c 20 22 61 73 22 3a 20 22 72  /ocx2", "as": "r
0ba0: 65 6c 65 61 73 65 73 2f 24 24 72 75 6e 24 24 2f  eleases/$$run$$/
0bb0: 6f 63 78 32 22 7d 2c 0a 20 20 20 20 20 20 7b 22  ocx2"},.      {"
0bc0: 61 74 22 3a 20 22 24 24 77 6f 72 6b 73 70 61 63  at": "$$workspac
0bd0: 65 24 24 2f 72 65 6c 65 61 73 65 2f 72 65 6c 65  e$$/release/rele
0be0: 61 73 65 2e 74 78 74 22 2c 20 22 61 73 22 3a 20  ase.txt", "as": 
0bf0: 22 72 65 6c 65 61 73 65 73 2f 24 24 72 75 6e 24  "releases/$$run$
0c00: 24 2f 72 65 6c 65 61 73 65 2e 74 78 74 22 7d 2c  $/release.txt"},
0c10: 0a 20 20 20 20 20 20 7b 22 61 74 22 3a 20 22 24  .      {"at": "$
0c20: 24 77 6f 72 6b 73 70 61 63 65 24 24 2f 72 65 6c  $workspace$$/rel
0c30: 65 61 73 65 2f 67 61 74 65 2e 74 78 74 22 2c 20  ease/gate.txt", 
0c40: 22 61 73 22 3a 20 22 72 65 6c 65 61 73 65 73 2f  "as": "releases/
0c50: 24 24 72 75 6e 24 24 2f 67 61 74 65 2e 74 78 74  $$run$$/gate.txt
0c60: 22 7d 0a 20 20 20 20 5d 2c 0a 20 20 20 20 22 65  "}.    ],.    "e
0c70: 6e 76 22 3a 20 7b 22 48 4f 4d 45 22 3a 20 22 24  nv": {"HOME": "$
0c80: 24 77 6f 72 6b 73 70 61 63 65 24 24 22 2c 20 22  $workspace$$", "
0c90: 55 53 45 52 22 3a 20 22 24 24 70 72 6f 63 65 73  USER": "$$proces
0ca0: 73 5f 75 73 65 72 24 24 22 2c 20 22 50 41 54 48  s_user$$", "PATH
0cb0: 22 3a 20 22 2f 75 73 72 2f 6c 6f 63 61 6c 2f 62  ": "/usr/local/b
0cc0: 69 6e 3a 2f 75 73 72 2f 62 69 6e 3a 2f 62 69 6e  in:/usr/bin:/bin
0cd0: 22 7d 0a 20 20 7d 0a 7d 0a 60 60 60 0a           "}.  }.}.```.