]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.deploy.shaker: make sure an io-multiplex method remains even if C streams are...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 31 Mar 2010 17:29:44 +0000 (13:29 -0400)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 31 Mar 2010 17:29:44 +0000 (13:29 -0400)
basis/tools/deploy/shaker/shaker.factor
basis/tools/deploy/shaker/strip-c-io.factor [new file with mode: 0644]

index 21f28d6ae2578f438b16d9d6ebef811135cc58eb..a2a2dbbc86d964574118179d969c478dbdcd34eb 100755 (executable)
@@ -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 (file)
index 0000000..44c63c5
--- /dev/null
@@ -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 ;