Skip to content

Commit

Permalink
choo: caching speedup, add back jock build. (#109)
Browse files Browse the repository at this point in the history
* caching speedup

* add back jock building

* update comments to include jock, removing additional slew
  • Loading branch information
litlep-nibbyt authored Jan 13, 2025
1 parent 4931816 commit eeb4e81
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
Binary file modified apps/choo/bootstrap/choo.jam
Binary file not shown.
48 changes: 26 additions & 22 deletions apps/choo/bootstrap/kernel.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
::
+$ graph-view (map path (set path))
::
:: $create: build a trap from a hoon file with dependencies
:: $create: build a trap from a hoon/jock file with dependencies
::
:: .entry: the entry to build
:: .dir: the directory to get dependencies from
Expand All @@ -356,7 +356,7 @@
|.(d)
|.(+:^$)
::
:: $create-arbitrary: builds a hoon file with dependencies without file hash injection
:: $create-arbitrary: builds a hoon/jock file with dependencies without file hash injection
::
:: .entry: the entry to build
:: .dir: the directory to get dependencies from
Expand All @@ -371,15 +371,19 @@
=> tase
|.(+:^$)
::
:: $create-target: builds a hoon file with dependencies
:: $create-target: builds a hoon/jock file with dependencies
::
:: .entry: the entry to build
:: .dir: the directory to get dependencies from
::
:: returns a trap with the compiled hoon file and the updated caches
:: returns a trap with the compiled hoon/jock file and the updated caches
++ create-target
|= [=entry dir=(map path cord)]
^- [(trap vase) build-cache parse-cache]
?. (is-hoon pat.entry)
=/ file (get-file entry dir)
=/ vaz !>([%octs [(met 3 file) file]])
[|.(vaz) *build-cache *parse-cache]
=/ [parsed-dir=(map path node) pc=parse-cache] (parse-dir entry dir)
=/ all-nodes=(map path node) parsed-dir
=/ [dep-dag=merk-dag =path-dag] (build-merk-dag all-nodes)
Expand Down Expand Up @@ -460,13 +464,6 @@
==
$(deps t.deps) :: next dep
::
++ get-file :: get file contents
|= [suf=entry dir=(map path cord)]
^- cord
?~ tex.suf
~| "file not found: {<pat.suf>}"
(~(got by dir) pat.suf)
u.tex.suf
--
::
:: $compile-target: compile a target hoon file
Expand Down Expand Up @@ -494,18 +491,16 @@
|-
?: .=(~ next)
(compile-node n path-dag bc)
=^ vaz bc
=. bc
%+ roll ~(tap by next)
|= [[p=path n=node] [v=_vaz bc=_bc]]
=^ new-vaz bc (compile-node n path-dag bc)
?: =(vaz *_vaz)
[new-vaz bc]
[(slew v new-vaz) bc]
|= [[p=path n=node] bc=_bc]
+:(compile-node n path-dag bc)
=. graph
(roll ~(tap by next) |=([[p=path *] g=_graph] (update-graph-view g p)))
%= $
next (update-next nodes graph)
graph (roll ~(tap by next) |=([[p=path *] g=_graph] (update-graph-view g p)))
graph graph
bc bc
vaz vaz
==
::
:: $compile-node: compile a single node
Expand Down Expand Up @@ -541,6 +536,7 @@
|= [n=node =path-dag bc=build-cache]
^- (trap vase)
=; dep-vaz=(trap vase)
~> %bout
(swet (slew honc dep-vaz) hoon.n)
%+ roll
deps.n
Expand All @@ -550,9 +546,9 @@
~| "couldn't find dep hash for {<pax>}"
(~(got by path-dag) pax)
=/ dep-vaz=(trap vase)
%+ fall (~(get by bc) dep-hash)
(build-node dep-node path-dag bc)
(slew (slew honc vaz) (label-vase dep-vaz face))
~| "couldn't find artifact for {<pax>} in build cache"
(~(got by bc) dep-hash)
(slew vaz (label-vase dep-vaz face))
::
:: $label-vase: label a (trap vase) with a face
::
Expand Down Expand Up @@ -742,6 +738,14 @@
|. ~+
[p.gun .*(q:$:tap q.gun)]
::
++ get-file :: get file contents
|= [suf=entry dir=(map path cord)]
^- cord
?~ tex.suf
~| "file not found: {<pat.suf>}"
(~(got by dir) pat.suf)
u.tex.suf
::
++ is-hoon
|= pax=path
^- ?
Expand Down

0 comments on commit eeb4e81

Please sign in to comment.