From 50cf54ddde88b8d5fa4059af5273ee03e0714609 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 27 Sep 2019 22:59:36 -0500 Subject: [PATCH 1/4] basis: Move signal word and fix tests. --- basis/bootstrap/stage2.factor | 1 - basis/debugger/debugger.factor | 18 +++++++++++------- basis/debugger/unix/unix.factor | 7 ++----- basis/unix/signals/signals.factor | 6 +++++- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/basis/bootstrap/stage2.factor b/basis/bootstrap/stage2.factor index b0fab89b45..3ec2024827 100644 --- a/basis/bootstrap/stage2.factor +++ b/basis/bootstrap/stage2.factor @@ -82,7 +82,6 @@ CONSTANT: default-components "stage2: deployment mode" print ] [ "debugger" require - os unix? [ "debugger.unix" require ] when "listener" require ] if diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index 0630bc11f8..433941496c 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -2,13 +2,15 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien alien.strings arrays assocs classes classes.builtin classes.mixin classes.tuple classes.tuple.parser -combinators combinators.short-circuit compiler.errors compiler.units -continuations definitions destructors effects.parser fry generic -generic.math generic.parser generic.single grouping io io.encodings -io.styles kernel kernel.private lexer libc make math math.order -math.parser math.ratios namespaces parser prettyprint sequences -sequences.private slots source-files.errors strings strings.parser -summary system vocabs vocabs.loader vocabs.parser words ; +combinators combinators.short-circuit compiler.errors +compiler.units continuations definitions destructors +effects.parser fry generic generic.math generic.parser +generic.single grouping io io.encodings io.styles kernel +kernel.private lexer libc make math math.order math.parser +math.ratios namespaces parser prettyprint sequences +sequences.private slots source-files.errors strings +strings.parser summary system vocabs vocabs.loader vocabs.parser +words ; IN: debugger GENERIC: error-help ( error -- topic ) @@ -383,3 +385,5 @@ M: callsite-not-compiled summary drop "Caller not compiled with the optimizing compiler" ; { "threads" "debugger" } "debugger.threads" require-when + +os unix? [ "debugger.unix" require ] when diff --git a/basis/debugger/unix/unix.factor b/basis/debugger/unix/unix.factor index 1f27bc1dbb..62b2969c5a 100644 --- a/basis/debugger/unix/unix.factor +++ b/basis/debugger/unix/unix.factor @@ -1,12 +1,9 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors debugger io kernel math prettyprint sequences -system unix.signals ; +USING: debugger io kernel prettyprint sequences system +unix.signals ; IN: debugger.unix -: signal-name. ( n -- ) - signal-name [ " (" ")" surround write ] when* ; - M: unix signal-error. ( obj -- ) "Unix signal #" write third [ pprint ] [ signal-name. ] bi nl ; diff --git a/basis/unix/signals/signals.factor b/basis/unix/signals/signals.factor index ec94cb2245..25abdfba07 100644 --- a/basis/unix/signals/signals.factor +++ b/basis/unix/signals/signals.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2011 Joe Groff. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors assocs kernel math namespaces sequences threads ; +USING: accessors assocs io kernel math namespaces sequences +system threads ; IN: unix.signals CONSTANT: signal-names @@ -21,6 +22,9 @@ M: signal signal-name n>> signal-name ; M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ; +: signal-name. ( n -- ) + signal-name [ " (" ")" surround write ] when* ; + SYMBOL: dispatch-signal-hook dispatch-signal-hook [ [ drop ] ] initialize From 6f6bc00cb1a0b19825f20f55c6a538b0ac94057d Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 27 Sep 2019 23:13:51 -0500 Subject: [PATCH 2/4] io.launcher.unix: Fix test. --- basis/io/launcher/unix/unix-tests.factor | 12 +++++------- basis/io/launcher/unix/unix.factor | 5 ++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/basis/io/launcher/unix/unix-tests.factor b/basis/io/launcher/unix/unix-tests.factor index a1913058c0..4e34966f10 100644 --- a/basis/io/launcher/unix/unix-tests.factor +++ b/basis/io/launcher/unix/unix-tests.factor @@ -1,12 +1,10 @@ -USING: accessors calendar concurrency.promises continuations -debugger.unix destructors io io.backend.unix io.directories -io.encodings.ascii io.encodings.binary io.encodings.utf8 -io.files io.launcher io.launcher.unix io.streams.duplex -io.timeouts kernel libc locals math namespaces sequences threads -tools.test unix.process ; +USING: accessors calendar concurrency.promises destructors io +io.backend.unix io.directories io.encodings.ascii +io.encodings.binary io.encodings.utf8 io.files io.launcher +io.streams.duplex io.timeouts kernel libc locals math namespaces +sequences threads tools.test unix.process unix.signals ; IN: io.launcher.unix.tests - [ { } [ { "touch" "launcher-test-1" } try-process ] unit-test diff --git a/basis/io/launcher/unix/unix.factor b/basis/io/launcher/unix/unix.factor index ad0a76cf67..ce75d91cc2 100644 --- a/basis/io/launcher/unix/unix.factor +++ b/basis/io/launcher/unix/unix.factor @@ -5,6 +5,7 @@ continuations environment fry io.backend io.backend.unix io.files.private io.files.unix io.launcher io.launcher.private io.pathnames io.ports kernel libc math namespaces sequences simple-tokenizer strings system unix unix.ffi unix.process ; +QUALIFIED-WITH: unix.signals sig IN: io.launcher.unix : get-arguments ( process -- seq ) @@ -104,10 +105,8 @@ M: unix (kill-process) ( process -- ) : find-process ( handle -- process ) processes get keys [ handle>> = ] with find nip ; -TUPLE: signal n ; - : code>status ( code -- obj ) - dup WIFSIGNALED [ WTERMSIG signal boa ] [ WEXITSTATUS ] if ; + dup WIFSIGNALED [ WTERMSIG sig:signal boa ] [ WEXITSTATUS ] if ; M: unix (wait-for-processes) ( -- ? ) { int } [ -1 swap WNOHANG waitpid ] with-out-parameters From afe188efb363988632a6e220561aa8dca5b44623 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 28 Sep 2019 09:40:47 -0500 Subject: [PATCH 3/4] openssl: Fallback for versions of macOS < 10.15. We probably want a word that finds libssl.x.dylib where x is the highest version so that we don't have to update the libary-loading code in the future. This is all because loading libssl.dylib causes a SIGABORT signal 6, perhaps there's another workaround? --- basis/openssl/libcrypto/libcrypto.factor | 2 +- basis/openssl/libssl/libssl.factor | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/openssl/libcrypto/libcrypto.factor b/basis/openssl/libcrypto/libcrypto.factor index 1273ba6a21..68065aef13 100644 --- a/basis/openssl/libcrypto/libcrypto.factor +++ b/basis/openssl/libcrypto/libcrypto.factor @@ -11,7 +11,7 @@ IN: openssl.libcrypto << "libcrypto" { { [ os windows? ] [ "libcrypto-37.dll" ] } - { [ os macosx? ] [ { "libcrypto.46.dylib" "libcrypto.44.dylib" } find-library-from-list ] } + { [ os macosx? ] [ { "libcrypto.46.dylib" "libcrypto.44.dylib" "libcrypto.dylib" } find-library-from-list ] } { [ os unix? ] [ "libcrypto.so" ] } } cond cdecl add-library >> diff --git a/basis/openssl/libssl/libssl.factor b/basis/openssl/libssl/libssl.factor index 5337751d30..444f0f45ca 100644 --- a/basis/openssl/libssl/libssl.factor +++ b/basis/openssl/libssl/libssl.factor @@ -9,7 +9,7 @@ IN: openssl.libssl << "libssl" { { [ os windows? ] [ "libssl-38.dll" ] } - { [ os macosx? ] [ { "libssl.44.dylib" "libssl.42.dylib" } find-library-from-list ] } + { [ os macosx? ] [ { "libssl.44.dylib" "libssl.42.dylib" "libssl.dylib" } find-library-from-list ] } { [ os unix? ] [ "libssl.so" ] } } cond cdecl add-library >> From dc10c08158ac987fd59a2115de972aeb0148ab94 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 28 Sep 2019 09:43:07 -0500 Subject: [PATCH 4/4] tools.deploy: Bump the deploy size. We should look at deploy sizes and try to fix them correctly. --- basis/tools/deploy/deploy-tests.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/tools/deploy/deploy-tests.factor b/basis/tools/deploy/deploy-tests.factor index 6e8ebf2d73..6ad4627851 100644 --- a/basis/tools/deploy/deploy-tests.factor +++ b/basis/tools/deploy/deploy-tests.factor @@ -59,7 +59,7 @@ delete-staging-images ! { } [ "bunny" shake-and-bake 2559640 small-enough? ] long-unit-test { } [ "bunny" shake-and-bake 2700000 small-enough? ] long-unit-test -{ } [ "gpu.demos.bunny" shake-and-bake 3650000 small-enough? ] long-unit-test +{ } [ "gpu.demos.bunny" shake-and-bake 3660000 small-enough? ] long-unit-test os macosx? [ [ ] [ "webkit-demo" shake-and-bake 600000 small-enough? ] long-unit-test