From 2ed422e11f4399287d5af701fcd35aac31e69cd9 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 4 Dec 2018 00:53:56 -0500 Subject: [PATCH 1/4] boots with lifecycle formula, without persistent kernel formula removes now-unused vortex functions --- include/noun/vortex.h | 15 ++------------ noun/manage.c | 12 ++++++++--- noun/trace.c | 2 +- noun/vortex.c | 48 +++++++++++++------------------------------ 4 files changed, 26 insertions(+), 51 deletions(-) diff --git a/include/noun/vortex.h b/include/noun/vortex.h index 345f312e5e..d84dbf2c60 100644 --- a/include/noun/vortex.h +++ b/include/noun/vortex.h @@ -33,7 +33,6 @@ u3_noun roe; // temporary unsaved events u3_noun key; // log key, or 0 - u3_noun ken; // kernel formula u3_noun roc; // kernel core struct { // ova waiting to process @@ -65,15 +64,10 @@ u3_noun u3v_do(const c3_c* txt_c, u3_noun arg); - /* u3v_make(): make a new pier by loading a pill. + /* u3v_boot(): evaluate boot sequence, making a kernel */ void - u3v_make(c3_c* pas_c); - - /* u3v_jack(): execute kernel formula to bind jets. - */ - void - u3v_jack(void); + u3v_boot(u3_noun eve); /* u3v_start(): start time. */ @@ -160,11 +154,6 @@ void u3v_hose(void); - /* u3v_louse(): last-minute deviltry upon a bail. - */ - void - u3v_louse(c3_m how_m); - /* u3v_mark(): mark arvo kernel. */ c3_w diff --git a/noun/manage.c b/noun/manage.c index 3e30b75be4..94579b1db1 100644 --- a/noun/manage.c +++ b/noun/manage.c @@ -1707,11 +1707,17 @@ u3m_boot(c3_o nuu_o, c3_o bug_o, c3_c* dir_c, _boot_home(dir_c, pil_c, url_c, arv_c); snprintf(ful_c, 2048, "%s/.urb/urbit.pill", dir_c); - printf("boot: loading %s\r\n", ful_c); - u3v_make(ful_c); - u3v_jack(); + { + u3_noun sys = u3ke_cue(u3m_file(ful_c)); + u3_noun bot; + + u3x_trel(sys, &bot, 0, 0); + u3v_boot(u3k(bot)); + + u3z(sys); + } } else { u3v_hose(); diff --git a/noun/trace.c b/noun/trace.c index 0fbe833243..bb3a228488 100644 --- a/noun/trace.c +++ b/noun/trace.c @@ -66,7 +66,7 @@ u3t_slog(u3_noun hod) old = 1; #endif - if ( c3y == u3du(hod) ) { + if ( (0 != u3A->roc) && (c3y == u3du(hod)) ) { u3_noun pri = u3h(hod); switch ( pri ) { diff --git a/noun/vortex.c b/noun/vortex.c index 46538a5d33..7ca632efb3 100644 --- a/noun/vortex.c +++ b/noun/vortex.c @@ -24,29 +24,26 @@ _cv_nock_wish(u3_noun txt) return pro; } -/* u3v_make(): make a new pier and instantiate pill. +/* u3v_boot(): evaluate boot sequence, making a kernel */ void -u3v_make(c3_c* pas_c) +u3v_boot(u3_noun eve) { - u3_noun sys = u3ke_cue(u3m_file(pas_c)); + // ensure zero-initialized kernel + // + // So that u3t_slog won't try to print tanks. + // + u3A->roc = 0; - u3A->ken = u3k(u3h(sys)); - u3A->roc = u3k(u3t(sys)); + // lifecycle formula + // + u3_noun lyf = u3nt(2, u3nc(0, 3), u3nc(0, 2)); + u3_noun cor = u3n_nock_on(eve, lyf); - u3z(sys); -} + // save the Arvo core (at +7 of the Arvo gate) + // + u3A->roc = u3k(u3x_at(7, cor)); -/* u3v_jack(): execute kernel formula to bind jets. -*/ -void -u3v_jack(void) -{ - u3_noun cor; - - fprintf(stderr, "jack: kernel %x\r\n", u3r_mug(u3A->ken)); - cor = u3n_nock_on(0, u3k(u3A->ken)); - fprintf(stderr, "jacked\r\n"); u3z(cor); } @@ -450,22 +447,6 @@ u3v_plow(u3_noun ova) u3z(ova); } -/* u3v_louse(): last-minute deviltry upon a bail. -*/ -void -u3v_louse(c3_m how_m) -{ -#if 0 - if ( c3__exit == how_m ) { - printf("louse: nocks: %d\n", NOX); - printf("louse: washing kernel %x %d\n", u3A->ken, u3a_is_dog(u3A->ken)); - u3m_wash(u3A->ken); - - printf("kernel %x; washed mug %x\n", u3A->ken, u3r_mug(u3A->ken)); - } -#endif -} - /* _cv_mark_ova(): mark ova queue. */ c3_w @@ -503,7 +484,6 @@ u3v_mark(void) tot_w += u3a_mark_noun(arv_u->roe); tot_w += u3a_mark_noun(arv_u->key); - tot_w += u3a_mark_noun(arv_u->ken); tot_w += u3a_mark_noun(arv_u->roc); tot_w += _cv_mark_ova(arv_u->ova.egg_p); From bf4e7910dcdaf1cd2314848477f03dea15a70829 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 4 Dec 2018 00:54:56 -0500 Subject: [PATCH 2/4] loads initial filesystem from pill, -A optional for all ships --- vere/main.c | 11 ----------- vere/sist.c | 26 +++++++++++++++++++------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/vere/main.c b/vere/main.c index 0ae11fca2c..ebcd0c2a23 100644 --- a/vere/main.c +++ b/vere/main.c @@ -196,11 +196,6 @@ _main_getopt(c3_i argc, c3_c** argv) c3_t imp_t = ( (0 != u3_Host.ops_u.who_c) && (4 == strlen(u3_Host.ops_u.who_c)) ); - if ( u3_Host.ops_u.arv_c != 0 && !imp_t ) { - fprintf(stderr, "-A only makes sense when creating a new galaxy\n"); - return c3n; - } - if ( u3_Host.ops_u.ets_c == 0 && c3y == u3_Host.ops_u.etn ) { fprintf(stderr, "can't trust Ethereum snapshot without specifying " "snapshot with -E\n"); @@ -213,12 +208,6 @@ _main_getopt(c3_i argc, c3_c** argv) return c3n; } - if ( u3_Host.ops_u.arv_c == 0 && imp_t ) { - fprintf(stderr, "can't create a new galaxy without specifying " - "the initial sync path with -A\n"); - return c3n; - } - if ( u3_Host.ops_u.gen_c != 0 && u3_Host.ops_u.nuu == c3n ) { fprintf(stderr, "-G only makes sense when bootstrapping a new instance\n"); return c3n; diff --git a/vere/sist.c b/vere/sist.c index 4644ea551b..620ead285f 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -1696,15 +1696,27 @@ u3_sist_boot(void) // Authenticate and initialize terminal. u3_term_ef_bake(pig); - // queue initial galaxy sync - { - u3_noun rac = u3do("clan:title", u3k(u3A->own)); + // queue initial filesystem sync + // + // from the Arvo directory if specified + if ( 0 != u3_Host.ops_u.arv_c ) { + u3_unix_ef_initial_into(); + } + // otherwise from the pill + else { + c3_c ful_c[2048]; - if ( c3__czar == rac ) { - u3_unix_ef_initial_into(); + snprintf(ful_c, 2048, "%s/.urb/urbit.pill", u3_Host.dir_c); + + { + u3_noun sys = u3ke_cue(u3m_file(ful_c)); + u3_noun fil; + + u3x_trel(sys, 0, 0, &fil); + u3v_plow(u3k(fil)); + + u3z(sys); } - - u3z(rac); } // Create the event log From 6b3956dda0b2fa78553289170e16c2c393ede55f Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 4 Dec 2018 02:27:17 -0500 Subject: [PATCH 3/4] [CI] updates pinned arvo commit --- .travis/pin-arvo-commit.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/pin-arvo-commit.txt b/.travis/pin-arvo-commit.txt index 92c82b8d06..dfd8a1c12e 100644 --- a/.travis/pin-arvo-commit.txt +++ b/.travis/pin-arvo-commit.txt @@ -1 +1 @@ -e71c57b4455c84062230b4277f95eb7047a26146 +cae4b03c5c95722fb0e5f1947ba988f72703816d From 6ea1248f9424a919c6157e68046e7d0f2382fcfe Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 4 Dec 2018 03:12:05 -0500 Subject: [PATCH 4/4] [CI] skip arvo download, retrieve pill directly --- .travis.yml | 4 ---- .travis/test.js | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3170289dc..a957eb3154 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,6 @@ before_install: install: # pwd: ~/urbit - pip3 install --user -I meson==0.44.1 - - git clone https://github.com/urbit/arvo - - cd ./arvo - - git checkout $(cat ../.travis/pin-arvo-commit.txt) - - cd .. script: - meson . ./build --buildtype=debugoptimized -Dgc=true -Dprof=true diff --git a/.travis/test.js b/.travis/test.js index 4afc094170..4efa960081 100644 --- a/.travis/test.js +++ b/.travis/test.js @@ -1,11 +1,15 @@ 'use strict'; +var fs = require('fs') var runner = require('urbit-runner') var Urbit = runner.Urbit; var ERROR = runner.ERROR; var actions = runner.actions -var args = ['-A', '../arvo', '-csgPSF', 'zod', 'zod']; +var hash = fs.readFileSync('./pin-arvo-commit.txt', 'utf-8').slice(0, 10) +var pill = 'https://bootstrap.urbit.org/git-' + hash + '.pill' + +var args = ['-u', pill, '-cgPSF', 'zod', 'zod']; var urbit = new Urbit(args); // vere hangs (always?) with run in travis-ci with -P