lib: move pill creation into /lib/pill

In preparation for pill building from outside the generators.
This commit is contained in:
fang 2021-10-29 01:08:25 +02:00
parent 0750c3f8ce
commit 74e653053d
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
5 changed files with 190 additions and 177 deletions

View File

@ -39,50 +39,10 @@
?~ arg %base
?>(?=(@ base.arg) base.arg)
/(scot %p p.bec)/[desk]/(scot %da now)/sys
=/ bas=path
(scag 3 sys)
=/ dez=(list [desk path])
?~ arg ~
%+ turn rest.arg
|= =desk
[desk /(scot %p p.bec)/[desk]/(scot %da now)]
::
:: compiler-source: hoon source file producing compiler, `sys/hoon`
::
=+ compiler-source=.^(@t %cx (welp sys /hoon/hoon))
::
:: compiler-twig: compiler as hoon expression
::
~& %brass-parsing
=+ compiler-twig=(rain /sys/hoon/hoon compiler-source)
~& %brass-parsed
::
:: compiler-formula: compiler as nock formula
::
~& %brass-compiling
=+ compiler-formula=q:(~(mint ut %noun) %noun compiler-twig)
~& %brass-compiled
::
:: arvo-source: hoon source file producing arvo kernel, `sys/arvo`
::
=+ arvo-source=.^(@t %cx (welp sys /arvo/hoon))
::
:: boot-ova: startup events
::
=/ boot-ova=(list)
:~ aeon:eden:part
boot:eden:part
compiler-formula
compiler-source
arvo-source
==
:: a pill is a 3-tuple of event-lists: [boot kernel userspace]
::
:+ %pill %brass
:+ boot-ova
:~ (boot-ovum:pill compiler-source arvo-source)
(file-ovum2:pill bas)
==
%+ turn
(snoc dez [%base bas])
file-ovum:pill
(brass:pill sys dez)

View File

@ -17,60 +17,4 @@
=/ sys=path
?^ arg top.arg
/(scot %p p.bec)/[q.bec]/(scot %da now)/sys
=/ lib
(welp (flop (tail (flop sys))) /lib)
::
|^ =/ ver
=/ sub *(trap vase)
=. sub (build-sys sub %hoon)
=. sub (build-sys sub %arvo)
=. sub (build-sys sub %lull)
=. sub (build-sys sub %zuse)
=. sub (build-lib sub & %ethereum)
=. sub (build-lib sub & %azimuth)
(build-lib sub | %vere)
=/ nok !.
=> *[ver=(trap vase) ~]
!= q:$:ver
ivory/[nok ver ~]
::
++ build-sys
|= [sub=(trap vase) nam=term] ^- (trap vase)
~> %slog.[0 leaf+"ivory: building /sys/{(trip nam)}"]
(swat sub (rain /sys/[nam]/hoon .^(@t cx+(welp sys /[nam]/hoon))))
::
++ build-lib
|= [sub=(trap vase) imp=? nam=term] ^- (trap vase)
~> %slog.[0 leaf+"ivory: building /lib/{(trip nam)}"]
=/ hun=hoon
%+ mist /lib/[nam]/hoon
.^(@t cx+(welp lib /[nam]/hoon))
?. imp (swat sub hun)
(swel sub [%ktts nam hun])
:: +mist: +rain but skipping past ford runes
::
++ mist
|= [bon=path txt=@]
^- hoon
=+ vas=vast
~| bon
%+ scan (trip txt)
%- full
=; fud
(ifix [;~(plug gay fud) gay] tall:vas(wer bon))
%- star
;~ pose vul
%+ ifix [fas (just `@`10)]
(star ;~(less (just `@`10) next))
==
:: +swel: +swat but with +slop
::
++ swel
|= [tap=(trap vase) gen=hoon]
^- (trap vase)
=/ gun (~(mint ut p:$:tap) %noun gen)
=> [tap=tap gun=gun]
|. ~+
=/ pro q:$:tap
[[%cell p.gun p:$:tap] [.*(pro q.gun) pro]]
--
(ivory:pill sys)

View File

@ -31,9 +31,6 @@
==
:- %pill
^- pill:pill
:: sys: root path to boot system, `/~me/[desk]/now/sys`
:: bas: root path to boot system' desk
:: dez: secondary desks and their root paths
::
=/ sys=path
?: ?=([^ *] arg)
@ -42,84 +39,10 @@
?~ arg %base
?>(?=(@ base.arg) base.arg)
/(scot %p p.bec)/[desk]/(scot %da now)/sys
=/ bas=path
(scag 3 sys)
=/ dez=(list [desk path])
?~ arg ~
%+ turn rest.arg
|= =desk
[desk /(scot %p p.bec)/[desk]/(scot %da now)]
::
=/ compiler-path (weld sys /hoon)
=/ arvo-path (weld sys /arvo)
~& %solid-start
=/ compiler-src .^(@t %cx (weld compiler-path /hoon))
=/ arvo-src .^(@t %cx (weld arvo-path /hoon))
=/ arvo-formula
~& %solid-loaded
=/ compiler-hoon (rain compiler-path compiler-src)
?. dub
:: compile arvo against hoon, with our current compiler
::
=/ whole-hoon=hoon
[%tsgr compiler-hoon [%tsgr [%$ 7] (rain arvo-path arvo-src)]]
~& %solid-parsed
=/ whole-formula q:(~(mint ut %noun) %noun whole-hoon)
~& %solid-arvo
whole-formula
:: compile arvo against hoon, with a freshly compiled hoon (via +ride)
::
~& %solid-parsed
=/ compiler-formula q:(~(mint ut %noun) %noun compiler-hoon)
~& %solid-compiled
=/ whole-src
(rap 3 ['=> ' compiler-src '=> +7 ' arvo-src ~])
~& %solid-double-loaded
=/ whole-formula
=< +
.* [%noun whole-src]
[%8 compiler-formula [%9 2 %10 [6 %0 3] [%0 2]]]
~& %solid-double-compiled
whole-formula
::
~& [%solid-kernel `@ux`(mug arvo-formula)]
::
:: installed: Arvo gate (formal interface) with %zuse and vanes installed
::
=/ installed
=< q
%^ spin
^- (list ovum)
:- (boot-ovum:pill compiler-src arvo-src)
%+ turn
(snoc (turn dez tail) bas)
file-ovum2:pill
.*(0 arvo-formula)
|= [ovo=ovum ken=*]
[~ (slum ken [now ovo])]
::
:: boot-two: startup formula
::
:: We evaluate :arvo-formula (for jet registration),
:: then ignore the result and produce .installed
::
=/ boot-two
=> *[arvo-formula=^ installed=^ tale=*]
!= =+(.*(0 arvo-formula) [installed tale])
::
:: boot-ova
::
=/ boot-ova=(list)
[aeon:eden:part boot-two arvo-formula installed ~]
::
:: a pill is a 3-tuple of event-lists: [boot kernel userspace]
::
:: Our kernel event-list is ~, as we've already installed them.
:: Our userspace event-list is a list containing a full %clay
:: filesystem sync event.
::
:+ %pill %solid
:+ boot-ova ~
%+ turn
(snoc dez [%base bas])
file-ovum:pill
(solid:pill sys dez dub now)

View File

@ -1,4 +1,3 @@
/+ pill
=* card card:agent:gall
|%
+$ state state-2

View File

@ -135,4 +135,191 @@
|- ^+ hav
?~ all hav
$(all t.all, hav ^$(tyl [p.i.all tyl]))
::
++ solid
:: sys: root path to boot system, `/~me/[desk]/now/sys`
:: dez: secondary desks and their root paths
::
|= [sys=path dez=(list [desk path]) dub=? now=@da]
^- pill
=/ bas=path (scag 3 sys)
=/ compiler-path (weld sys /hoon)
=/ arvo-path (weld sys /arvo)
~& %solid-start
=/ compiler-src .^(@t %cx (weld compiler-path /hoon))
=/ arvo-src .^(@t %cx (weld arvo-path /hoon))
=/ arvo-formula
~& %solid-loaded
=/ compiler-hoon (rain compiler-path compiler-src)
?. dub
:: compile arvo against hoon, with our current compiler
::
=/ whole-hoon=hoon
[%tsgr compiler-hoon [%tsgr [%$ 7] (rain arvo-path arvo-src)]]
~& %solid-parsed
=/ whole-formula q:(~(mint ut %noun) %noun whole-hoon)
~& %solid-arvo
whole-formula
:: compile arvo against hoon, with a freshly compiled hoon (via +ride)
::
~& %solid-parsed
=/ compiler-formula q:(~(mint ut %noun) %noun compiler-hoon)
~& %solid-compiled
=/ whole-src
(rap 3 ['=> ' compiler-src '=> +7 ' arvo-src ~])
~& %solid-double-loaded
=/ whole-formula
=< +
.* [%noun whole-src]
[%8 compiler-formula [%9 2 %10 [6 %0 3] [%0 2]]]
~& %solid-double-compiled
whole-formula
::
~& [%solid-kernel `@ux`(mug arvo-formula)]
::
:: installed: Arvo gate (formal interface) with %zuse and vanes installed
::
=/ installed
=< q
%^ spin
^- (list ovum)
:- (boot-ovum:pill compiler-src arvo-src)
%+ turn
(snoc (turn dez tail) bas)
file-ovum2:pill
.*(0 arvo-formula)
|= [ovo=ovum ken=*]
[~ (slum ken [now ovo])]
::
:: boot-two: startup formula
::
:: We evaluate :arvo-formula (for jet registration),
:: then ignore the result and produce .installed
::
=/ boot-two
=> *[arvo-formula=^ installed=^ tale=*]
!= =+(.*(0 arvo-formula) [installed tale])
::
:: boot-ova
::
=/ boot-ova=(list)
[aeon:eden:part boot-two arvo-formula installed ~]
::
:: a pill is a 3-tuple of event-lists: [boot kernel userspace]
::
:: Our kernel event-list is ~, as we've already installed them.
:: Our userspace event-list is a list containing a full %clay
:: filesystem sync event.
::
:+ %pill %solid
:+ boot-ova ~
%+ turn
(snoc dez [%base bas])
file-ovum:pill
::
++ brass
:: sys: root path to boot system, `/~me/[desk]/now/sys`
:: dez: secondary desks and their root paths
::
|= [sys=path dez=(list [desk path])]
^- pill
=/ bas=path (scag 3 sys)
:: compiler-source: hoon source file producing compiler, `sys/hoon`
::
=+ compiler-source=.^(@t %cx (welp sys /hoon/hoon))
::
:: compiler-twig: compiler as hoon expression
::
~& %brass-parsing
=+ compiler-twig=(rain /sys/hoon/hoon compiler-source)
~& %brass-parsed
::
:: compiler-formula: compiler as nock formula
::
~& %brass-compiling
=+ compiler-formula=q:(~(mint ut %noun) %noun compiler-twig)
~& %brass-compiled
::
:: arvo-source: hoon source file producing arvo kernel, `sys/arvo`
::
=+ arvo-source=.^(@t %cx (welp sys /arvo/hoon))
::
:: boot-ova: startup events
::
=/ boot-ova=(list)
:~ aeon:eden:part
boot:eden:part
compiler-formula
compiler-source
arvo-source
==
:: a pill is a 3-tuple of event-lists: [boot kernel userspace]
::
:+ %pill %brass
:+ boot-ova
:~ (boot-ovum:pill compiler-source arvo-source)
(file-ovum2:pill bas)
==
%+ turn
(snoc dez [%base bas])
file-ovum:pill
::
++ ivory
|= sys=path
^- pill
=/ lib (snoc (scag 3 sys) %lib)
|^ =/ ver
=/ sub *(trap vase)
=. sub (build-sys sub %hoon)
=. sub (build-sys sub %arvo)
=. sub (build-sys sub %lull)
=. sub (build-sys sub %zuse)
=. sub (build-lib sub & %ethereum)
=. sub (build-lib sub & %azimuth)
(build-lib sub | %vere)
=/ nok !.
=> *[ver=(trap vase) ~]
!= q:$:ver
ivory/[nok ver ~]
::
++ build-sys
|= [sub=(trap vase) nam=term] ^- (trap vase)
~> %slog.[0 leaf+"ivory: building /sys/{(trip nam)}"]
(swat sub (rain /sys/[nam]/hoon .^(@t cx+(welp sys /[nam]/hoon))))
::
++ build-lib
|= [sub=(trap vase) imp=? nam=term] ^- (trap vase)
~> %slog.[0 leaf+"ivory: building /lib/{(trip nam)}"]
=/ hun=hoon
%+ mist /lib/[nam]/hoon
.^(@t cx+(welp lib /[nam]/hoon))
?. imp (swat sub hun)
(swel sub [%ktts nam hun])
:: +mist: +rain but skipping past ford runes
::
++ mist
|= [bon=path txt=@]
^- hoon
=+ vas=vast
~| bon
%+ scan (trip txt)
%- full
=; fud
(ifix [;~(plug gay fud) gay] tall:vas(wer bon))
%- star
;~ pose vul
%+ ifix [fas (just `@`10)]
(star ;~(less (just `@`10) next))
==
:: +swel: +swat but with +slop
::
++ swel
|= [tap=(trap vase) gen=hoon]
^- (trap vase)
=/ gun (~(mint ut p:$:tap) %noun gen)
=> [tap=tap gun=gun]
|. ~+
=/ pro q:$:tap
[[%cell p.gun p:$:tap] [.*(pro q.gun) pro]]
--
--