From 3137fc3b87aae78ef8d95a60f2668344fde96946 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 17 Dec 2018 12:30:02 -0500 Subject: [PATCH] builds urbit-worker separately from urbit --- include/vere/vere.h | 6 ------ meson-scripts/make-worker.sh | 5 ----- meson.build | 13 ++++++++----- scripts/build | 2 +- vere/main.c | 14 -------------- vere/serf.c | 4 ++-- 6 files changed, 11 insertions(+), 33 deletions(-) delete mode 100755 meson-scripts/make-worker.sh diff --git a/include/vere/vere.h b/include/vere/vere.h index a7135116d..ca5f25d82 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -1210,12 +1210,6 @@ void u3_newt_read(u3_moat* mot_u); - /** Main for worker process. - **/ - c3_i - u3_serf_main(c3_i arg_i, - c3_c** arg_c); - /** Pier control. **/ /* u3_pier_create(): create a pier, loading existing. diff --git a/meson-scripts/make-worker.sh b/meson-scripts/make-worker.sh deleted file mode 100755 index 7a5e6d412..000000000 --- a/meson-scripts/make-worker.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -if ! [[ -f $MESON_BUILD_ROOT/urbit-worker ]]; then - ln -s $MESON_BUILD_ROOT/urbit $MESON_BUILD_ROOT/urbit-worker -fi diff --git a/meson.build b/meson.build index 1e7637791..1c5e776fb 100644 --- a/meson.build +++ b/meson.build @@ -222,7 +222,6 @@ vere_lib_src = [ 'vere/pier.c', 'vere/reck.c', 'vere/save.c', - 'vere/serf.c', 'vere/term.c', 'vere/time.c', 'vere/unix.c', @@ -367,10 +366,14 @@ dependencies: vere_deps + os_deps, link_with: libnoun, install: true) -# XX remove once urbit-worker is a separate executable -# XX add similar workaround for install -# -run_target('worker', command: 'meson-scripts/make-worker.sh') +executable('urbit-worker', +sources : vere_lib_src + [ 'vere/serf.c' ], +include_directories : incdir, +c_args : os_c_flags, +link_args: os_link_flags, +dependencies: vere_deps + os_deps, +link_with: libnoun, +install: true) test_hashtable = executable('test-hashtable', sources : vere_lib_src + ['tests/hashtable_tests.c'], diff --git a/scripts/build b/scripts/build index 62a9358f3..879618f28 100755 --- a/scripts/build +++ b/scripts/build @@ -2,4 +2,4 @@ mkdir ./build &> /dev/null meson . ./build --buildtype=release "$@" -ninja -C build urbit && ninja -C build worker +ninja -C build diff --git a/vere/main.c b/vere/main.c index 957663588..9f44c1dc6 100644 --- a/vere/main.c +++ b/vere/main.c @@ -518,20 +518,6 @@ c3_i main(c3_i argc, c3_c** argv) { - // Detect executable purpose. - // - { - c3_c* nam_c = strrchr(argv[0], '/'); - - if ( !nam_c ) - nam_c = argv[0]; - else nam_c++; - - if ( !strcmp("urbit-worker", nam_c) ) { - return u3_serf_main(argc, argv); - } - } - // Parse options. // if ( c3n == _main_getopt(argc, argv) ) { diff --git a/vere/serf.c b/vere/serf.c index 188ef8d22..15d0f029f 100644 --- a/vere/serf.c +++ b/vere/serf.c @@ -406,10 +406,10 @@ u3_serf_boot(void) _serf_send(u3nc(c3__play, dat)); } -/* u3_serf_main(): main() when run as urbit-client +/* main(): main() when run as urbit-worker */ c3_i -u3_serf_main(c3_i argc, c3_c* argv[]) +main(c3_i argc, c3_c* argv[]) { uv_loop_t* lup_u = uv_default_loop(); c3_c* dir_c = argv[1];