From fb4000b3f0a0eff7893161d9c87de7204802e95a Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Sun, 6 Dec 2020 03:23:26 -0800 Subject: [PATCH] arvo: adds %wyrd event validation (disabled) and switches runtime version to $path --- pkg/arvo/sys/arvo.hoon | 109 +++++++++++++++++++++--------------- pkg/urbit/include/c/motes.h | 1 + pkg/urbit/vere/pier.c | 11 ++-- 3 files changed, 69 insertions(+), 52 deletions(-) diff --git a/pkg/arvo/sys/arvo.hoon b/pkg/arvo/sys/arvo.hoon index 30ca9a5655..8e6c7d943a 100644 --- a/pkg/arvo/sys/arvo.hoon +++ b/pkg/arvo/sys/arvo.hoon @@ -253,12 +253,7 @@ == == +$ vane [=vase =worm] -+$ vere - $: $: non=@ta - rev=(pair term (trel @ud @ud @ud)) :: XX path? - == - kel=wynn - == ++$ vere [[non=@ta rev=path] kel=wynn] +$ vile $: typ=type :: -:!>(*type) duc=type :: -:!>(*duct) @@ -341,48 +336,66 @@ == ~>(%slog.[0 leaf+"arvo: scry-lost"] ~) [~ ~ q.vax] -:: +wyrd: kelvin negotiation +:: |wyrd: kelvin negotiation :: :: specified but unimplemented: :: arvo should produce a [wend/wynn] effect :: to signal downgrade :: ++ wyrd - |= [run=wynn hav=wynn] - :: wyr: ~: runtime supports all required kelvins - :: ^: runtime support is missing or lagging + |% + :: +sane: kelvin stack for validity :: - =; wyr !. - ?~ wyr - same - ~& wyrd=wyr - ~_ :+ %rose - [" " ~ ~] - :~ =+ p.u.wyr - leaf/"%{(trip p)} %{(scow %ud q)} required;" - ?~ q.u.wyr - leaf/"runtime missing support" - leaf/"runtime only supports %{(scow %ud u.q.u.wyr)}" - == - ~> %mean.'arvo: upgrade blocked' - ~> %mean.'wyrd' - !! + ++ sane + |= kel=wynn + ^- ? + & + :: ?: =(~ kel) & + :: =^ las=(pair term @ud) kel kel + :: |- ^- ? + :: ?~ kel & + :: ?& (gte q.las q.i.kel) + :: $(las i.kel, kel t.kel) + :: == + :: +need: require kelvins :: - |- ^- (unit (pair (pair term @ud) (unit @ud))) - ?~ hav ~ - :: - :: fel: %&: runtime kelvin for [i.hav] - :: %|: no specified runtime support - :: - =/ fel - |- ^- (each @ud (pair term @ud)) - ?~ run |/i.hav - ?:(=(p.i.hav p.i.run) &/q.i.run $(run t.run)) - :: - ?- -.fel - %| `[p.fel ~] - %& ?.((lte p.fel q.i.hav) `[i.hav `p.fel] $(hav t.hav)) - == + ++ need + |= [run=wynn hav=wynn] + :: wyr: ~: runtime supports all required kelvins + :: ^: runtime support is missing or lagging + :: + =; wyr !. + ?~ wyr + same + ~& wyrd=wyr + ~_ :+ %rose + [" " ~ ~] + :~ =+ p.u.wyr + leaf/"%{(trip p)} %{(scow %ud q)} required;" + ?~ q.u.wyr + leaf/"runtime missing support" + leaf/"runtime only supports %{(scow %ud u.q.u.wyr)}" + == + ~> %mean.'arvo: upgrade blocked' + ~> %mean.'wyrd' + !! + :: + |- ^- (unit (pair (pair term @ud) (unit @ud))) + ?~ hav ~ + :: + :: fel: %&: runtime kelvin for [i.hav] + :: %|: no specified runtime support + :: + =/ fel + |- ^- (each @ud (pair term @ud)) + ?~ run |/i.hav + ?:(=(p.i.hav p.i.run) &/q.i.run $(run t.run)) + :: + ?- -.fel + %| `[p.fel ~] + %& ?.((lte p.fel q.i.hav) `[i.hav `p.fel] $(hav t.hav)) + == + -- :: :: |de: axal engine :: @@ -1302,7 +1315,7 @@ (smit:va "lull" pit /sys/lull/hoon u.lul.job) =? zus.mod.sol ?=(^ zus.job) (smit:va "zuse" lul.mod.sol /sys/zuse/hoon u.zus.job) - %- %+ wyrd kel.ver.zen + %- %+ need:wyrd kel.ver.zen :~ lull/;;(@ud q:(slap lul.mod.sol limb/%lull)) zuse/;;(@ud q:(slap zus.mod.sol limb/%zuse)) == @@ -1386,7 +1399,9 @@ :: :: %wyrd: check for runtime kelvin compatibility :: - %wyrd %- %+ wyrd kel.p.buz + %wyrd ?. (sane:wyrd kel.p.buz) + ~>(%mean.'wyrd: insane' !!) + %- %+ need:wyrd kel.p.buz ^- (list (pair term @)) :~ hoon/hoon-version arvo/arvo @@ -1456,7 +1471,7 @@ ~>(%mean.'wyrd: vega:' !!) :: require runtime compatibility :: - %- (wyrd kel [hoon/nex ~]) + %- (need:wyrd kel [hoon/nex ~]) :: :: if we're upgrading language versions, recompile the compiler :: @@ -1559,7 +1574,7 @@ :: =. van.mod (~(run by van.mod) |=(=vane vane(worm *worm))) :: - %- %+ wyrd kel.ver.zen + %- %+ need:wyrd kel.ver.zen ^- (list (pair term @)) :~ hoon/hoon-version arvo/arvo @@ -1648,7 +1663,7 @@ ~ =/ lul $:u.lul =/ zus $:u.zus - %- %+ wyrd kel.u.ver + %- %+ need:wyrd kel.u.ver ^- (list (pair term @)) :~ hoon/hoon-version arvo/arvo @@ -1736,7 +1751,9 @@ %what ..poke(gub (what gub p.wip)) %whom ..poke(who ~|(%whom-once ?>(?=(~ who) `p.wip))) :: - %wyrd %- %+ wyrd kel.p.wip + %wyrd ?. (sane:wyrd kel.p.wip) + ~>(%mean.'wyrd: insane' !!) + %- %+ need:wyrd kel.p.wip ^- (list (pair term @)) :* hoon/hoon-version arvo/arvo diff --git a/pkg/urbit/include/c/motes.h b/pkg/urbit/include/c/motes.h index 206f69dcc7..240086ec9f 100644 --- a/pkg/urbit/include/c/motes.h +++ b/pkg/urbit/include/c/motes.h @@ -1079,6 +1079,7 @@ # define c3__sym c3_s3('s','y','m') # define c3__sync c3_s4('s','y','n','c') # define c3__sys c3_s3('s','y','s') +# define c3__ta c3_s2('t','a') # define c3__tab c3_s3('t','a','b') # define c3__tack c3_s4('t','a','c','k') # define c3__tag c3_s3('t','a','g') diff --git a/pkg/urbit/vere/pier.c b/pkg/urbit/vere/pier.c index 02d15f2834..479f6a9a9a 100644 --- a/pkg/urbit/vere/pier.c +++ b/pkg/urbit/vere/pier.c @@ -668,11 +668,8 @@ _pier_wyrd_fail(u3_pier* pir_u, u3_ovum* egg_u, u3_noun lud) // XX organizing version constants // -#define VERE_NAME "vere" -#define VERE_MAJOR 0 -#define VERE_MINOR 10 -#define VERE_PATCH 9 -#define VERE_ZUSE 309 +#define VERE_NAME "vere" +#define VERE_ZUSE 309 /* _pier_wyrd_aver(): check for %wend effect and version downgrade. RETAIN */ @@ -791,7 +788,9 @@ _pier_wyrd_card(u3_pier* pir_u) // XX god_u not necessarily available yet, refactor call sites // - u3_noun ver = u3nq(u3i_string(VERE_NAME), VERE_MAJOR, VERE_MINOR, VERE_PATCH); + u3_noun ver = u3nt(u3i_string(VERE_NAME), + u3dc("scot", c3__ta, u3i_string(URBIT_VERSION)), + u3_nul); u3_noun kel = u3nl(u3nc(c3__zuse, VERE_ZUSE), // XX god_u->zus_w u3nc(c3__lull, u3i_string("lull-kelvin")), // XX define u3nc(c3__arvo, u3i_string("arvo-kelvin")), // XX from both king and serf?