From ce42aea6a4594e5ee74e7674d74ef26f5eb0ed56 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 31 Mar 2010 13:29:44 -0400 Subject: [PATCH] tools.deploy.shaker: make sure an io-multiplex method remains even if C streams are stripped out --- basis/tools/deploy/shaker/shaker.factor | 10 ++++++---- basis/tools/deploy/shaker/strip-c-io.factor | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 basis/tools/deploy/shaker/strip-c-io.factor diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 21f28d6ae2..a2a2dbbc86 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -392,13 +392,15 @@ IN: tools.deploy.shaker ] [ drop ] if ; : strip-c-io ( -- ) + ! On all platforms, if deploy-io is 1, we strip out C streams. + ! On Unix, if deploy-io is 3, we strip out C streams as well. + ! On Windows, even if deploy-io is 3, C streams are still used + ! for the console, so don't strip it there. strip-io? deploy-io get 3 = os windows? not and or [ - [ - c-io-backend forget - "io.streams.c" forget-vocab - ] with-compilation-unit + "Stripping C I/O" show + "vocab:tools/deploy/shaker/strip-c-io.factor" run-file ] when ; : compress ( pred post-process string -- ) diff --git a/basis/tools/deploy/shaker/strip-c-io.factor b/basis/tools/deploy/shaker/strip-c-io.factor new file mode 100644 index 0000000000..44c63c509c --- /dev/null +++ b/basis/tools/deploy/shaker/strip-c-io.factor @@ -0,0 +1,10 @@ +USING: compiler.units definitions io.backend io.streams.c kernel +math threads.private vocabs ; + +[ + c-io-backend forget + "io.streams.c" forget-vocab +] with-compilation-unit + +M: object io-multiplex + dup 0 = [ drop ] [ 60 60 * 1000 * 1000 * or (sleep) ] if ;