From 4f3e99f79782ba92be90a49af3c69b0590046396 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Sat, 17 Jul 2021 02:54:20 +0300 Subject: [PATCH] clay,hood: seems to boot for real now --- pkg/arvo/app/hood.hoon | 13 ++++++------- pkg/arvo/lib/hood/drum.hoon | 14 +++++++------- pkg/arvo/lib/hood/helm.hoon | 4 ++-- pkg/arvo/lib/hood/kiln.hoon | 20 +++++++++++-------- pkg/arvo/sys/vane/clay.hoon | 38 ++++++++++++++++++++++++++++++------- 5 files changed, 58 insertions(+), 31 deletions(-) diff --git a/pkg/arvo/app/hood.hoon b/pkg/arvo/app/hood.hoon index d07ce7e55c..de8862677b 100644 --- a/pkg/arvo/app/hood.hoon +++ b/pkg/arvo/app/hood.hoon @@ -100,19 +100,18 @@ |= =path ^- step:agent:gall ?+ path (on-watch:def +<) - [%drum *] =^(c drum.state (peer:drum-core +<) [c this]) - [%kiln *] =^(c kiln.state (peer:kiln-core +<) [c this]) + [%drum *] =^(c drum.state (peer:drum-core t.path) [c this]) + [%kiln *] =^(c kiln.state (peer:kiln-core t.path) [c this]) == :: ++ on-agent - |= [=wire =sign:agent:gall] + |= [=wire syn=sign:agent:gall] ^- step:agent:gall ?+ wire ~|([%hood-bad-wire wire] !!) - [%drum *] =^(c drum.state (take-agent:drum-core +<) [c this]) - [%helm *] =^(c helm.state (take-agent:helm-core +<) [c this]) - [%kiln *] =^(c kiln.state (take-agent:kiln-core +<) [c this]) + [%drum *] =^(c drum.state (take-agent:drum-core t.wire syn) [c this]) + [%helm *] =^(c helm.state (take-agent:helm-core t.wire syn) [c this]) + [%kiln *] =^(c kiln.state (take-agent:kiln-core t.wire syn) [c this]) == -:: TODO: symmetry between adding and stripping wire prefixes :: ++ on-arvo |= [=wire syn=sign-arvo] diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index cd13fbb5ca..b19f1f6d3f 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -102,7 +102,7 @@ ++ peer :: |= pax=path ~| [%drum-unauthorized our+our.hid src+src.hid] :: ourself - ?> (team:title our.hid src.hid) :: or our own moon + ?> (team:title our.hid src.hid) :: or our own moon =< se-abet =< se-view (se-text "[{}, driving {}]") :: @@ -178,14 +178,14 @@ :: ++ take-agent |= [=wire =sign:agent:gall] - ?+ wire ~|([%drum-bad-take-agent wire -.sign] !!) - [%drum %phat *] + ?+ wire ~|([%drum-bad-take-agent wire -.sign] !!) + [%phat *] ?- -.sign - %poke-ack (take-coup-phat t.t.wire p.sign) - %watch-ack (reap-phat t.t.wire p.sign) - %kick (quit-phat t.t.wire) + %poke-ack (take-coup-phat t.wire p.sign) + %watch-ack (reap-phat t.wire p.sign) + %kick (quit-phat t.wire) %fact - %+ diff-sole-effect-phat t.t.wire + %+ diff-sole-effect-phat t.wire ?> ?=(%sole-effect p.cage.sign) !<(sole-effect q.cage.sign) == diff --git a/pkg/arvo/lib/hood/helm.hoon b/pkg/arvo/lib/hood/helm.hoon index 0f71669d62..03d1c613dc 100644 --- a/pkg/arvo/lib/hood/helm.hoon +++ b/pkg/arvo/lib/hood/helm.hoon @@ -222,8 +222,8 @@ ++ take-agent |= [=wire =sign:agent:gall] ?+ wire ~|([%helm-bad-take-agent wire -.sign] !!) - [%helm %hi *] ?> ?=(%poke-ack -.sign) - (coup-hi t.t.wire p.sign) + [%hi *] ?> ?=(%poke-ack -.sign) + (coup-hi t.wire p.sign) == :: ++ take-bound diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index f0c701e736..564c6a1426 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -407,8 +407,9 @@ ^+ vats =/ onto ?>(?=([%gall %onto *] syn) p.syn) ?- -.onto - %& ?> ?=([@ @ ~] wire) - =+ ;;([=desk =dude:gall] [i i.t]:wire) + %& ~_ leaf/"kiln: %onto bad wire {}" + ?> ?=([@ @ @ ~] wire) + =+ ;;([=desk =dude:gall] [i i.t.t]:wire) ?. (is-fish dude desk) vats =/ =cage [%drum-link !>([our dude])] @@ -665,16 +666,19 @@ :: ++ take-agent |= [=wire =sign:agent:gall] - ?+ wire ~|([%kiln-bad-take-agent wire -.sign] !!) - [%kiln %fancy *] ?> ?=(%poke-ack -.sign) - (take-coup-fancy t.t.wire p.sign) - [%kiln %spam *] ?> ?=(%poke-ack -.sign) - (take-coup-spam t.t.wire p.sign) + ?+ wire ~|([%kiln-bad-take-agent wire -.sign] !!) + [%fancy *] + ?> ?=(%poke-ack -.sign) + (take-coup-fancy t.wire p.sign) + :: + [%spam *] + ?> ?=(%poke-ack -.sign) + (take-coup-spam t.wire p.sign) == :: ++ take-arvo |= [=wire =sign-arvo] - ?- wire + ?- wire [%sync %merg *] %+ take-mere-sync t.t.wire ?>(?=(%mere +<.sign-arvo) +>.sign-arvo) [%find-ship *] %+ take-writ-find-ship t.wire diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 3346acc32a..c4acb3261a 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -493,6 +493,7 @@ ?: (~(has in cycle.nub) vale+path) ~|(cycle+vale+path^stack.nub !!) =. cycle.nub (~(put in cycle.nub) vale+path) + ::~> %slog.0^leaf/"ford: read file {(spud path)}" ?^ change=(~(get by changes) path) =^ page nub ?: ?=(%& -.u.change) @@ -523,6 +524,7 @@ =^ top stack.nub pop-stack =. naves.cache.nub (~(put by naves.cache.nub) mak [vase.res top]) [vase.res nub] + ~> %slog.0^leaf/"ford: make mark {}" =^ cor=vase nub (build-fit %mar mak) =/ gad=vase (slap cor limb/%grad) ?@ q.gad @@ -597,6 +599,7 @@ =. marks.cache.nub (~(put by marks.cache.nub) mak [dais.res top]) [dais.res nub] =^ nav=vase nub (build-nave mak) + ~> %slog.0^leaf/"ford: make dais {}" :_ nub ^- dais |_ sam=vase @@ -651,6 +654,7 @@ [vase.res nub] :: try +grow; is there a +grow core with a .b arm? :: + ~> %slog.0^leaf/"ford: make cast {} -> {}" =^ old=vase nub (build-fit %mar a) ?: =/ ram (mule |.((slap old !,(*hoon grow)))) ?: ?=(%| -.ram) %.n @@ -710,6 +714,7 @@ =. tubes.cache.nub (~(put by tubes.cache.nub) [a b] [tube.res top]) [tube.res nub] =^ gat=vase nub (build-cast a b) + ~> %slog.0^leaf/"ford: make tube {} -> {}" :_(nub |=(v=vase (slam gat v))) :: ++ lobe-to-page @@ -798,6 +803,7 @@ =. stack.nub =- [(sy - ~) stack.nub] ?:(?=(%| -.dep) dep [& dir.p.dep]) + ~> %slog.0^leaf/"ford: make file {(spud path)}" =^ cag=cage nub (read-file path) ?> =(%hoon p.cag) =/ tex=tape (trip !<(@t q.cag)) @@ -1508,13 +1514,18 @@ :: promote and fill in ankh :: promote and fill in mime cache :: - ?: &(=(%base syd) !updated) + =/ invalid (~(uni in deletes) ~(key by changes)) + ?: &(=(%base syd) !updated (~(any in invalid) is-kernel-path)) (sys-update yoki new-data) + :: + =? updated updated (did-kernel-update invalid) + => ?. updated . + ~>(%slog.0^leaf/"clay: rebuilding {} after after kernel update" .) :: clear caches if zuse reloaded :: =. fod.dom ?: updated *ford-cache - (promote-ford fod.dom deletes ~(key by changes)) + (promote-ford fod.dom invalid) =? ank.dom updated *ankh =? changes updated (changes-for-upgrade q.old-yaki deletes changes) :: @@ -1565,7 +1576,14 @@ =. ..park (emil (print q.old-yaki data)) :: wake:(ergo mim) + :: +is-kernel-path: should changing .pax cause a kernel or vane reload? :: + ++ is-kernel-path |=(pax=path ?=([%sys *] pax)) + :: + ++ did-kernel-update + |= invalid=(set path) + %- ~(any in invalid) + |=(p=path &((is-kernel-path p) !?=([%sys %vane *] p))) :: +get-kelvin: read the desk's kernel version from /sys/kelvin :: ++ get-kelvin @@ -1654,13 +1672,13 @@ :: Make sure to invalidate any paths whose '-'s or '/'s could be :: converted in an import; i.e. /mar, /lib, and /sur hoon files. :: + :: If anything in the kernel other than a vane updated, + :: clear the cache. + :: ++ promote-ford - |= [=ford-cache deletes=(set path) changes=(set path)] + |= [=ford-cache invalid=(set path)] ^+ ford-cache - ?: (~(has in changes) /sys/kelvin) - ~> %slog.0^'clay: desk kelvin changed, clearing ford cache' - *^ford-cache - =/ invalid=(set path) (~(uni in deletes) changes) + :: =. invalid %- ~(gas in invalid) %- zing @@ -1678,6 +1696,8 @@ %+ turn (tail (spud pux)) :: lose leading '/' |=(c=@tD `@tD`?:(=('/' c) '-' c)) :: convert '/' to '-' :: + ~> %slog.0^leaf/"ford: {<~(wyt in invalid)>} cache invalidations" + :: :* ((invalidate path vase) files.ford-cache invalid) ((invalidate mark vase) naves.ford-cache invalid) ((invalidate mark dais) marks.ford-cache invalid) @@ -3660,19 +3680,23 @@ |= [=aeon =path] ^- [(unit (unit (each cage lobe))) ford-cache] ?. =(aeon let.dom) + ~> %slog.0^leaf/"clay: %a unknown aeon {<[aeon path]>}" [~ fod.dom] =/ cached=(unit [=vase *]) (~(get by files.fod.dom) path) ?^ cached :_(fod.dom [~ ~ %& %vase !>(vase.u.cached)]) =/ x (read-x aeon path) ?~ x + ~> %slog.0^leaf/"clay: %a can't resolve file at path {}" [~ fod.dom] ?~ u.x + ~> %slog.0^leaf/"clay: %a no file at path {}" [[~ ~] fod.dom] :: should never happen at current aeon ?: ?=(%| -.u.u.x) [~ fod.dom] =^ =vase fod.dom + ~_ leaf/"clay: %a build failed {}" %- wrap:fusion (build-file:(ford:fusion static-ford-args) path) :_(fod.dom [~ ~ %& %vase !>(vase)])