]> gitweb.factorcode.org Git - factor.git/commitdiff
More deployment fixes
authorSlava Pestov <slava@factorcode.org>
Fri, 14 Mar 2008 22:39:57 +0000 (17:39 -0500)
committerSlava Pestov <slava@factorcode.org>
Fri, 14 Mar 2008 22:39:57 +0000 (17:39 -0500)
extra/hello-world/deploy.factor
extra/sudoku/deploy.factor
extra/tools/deploy/backend/backend.factor
extra/tools/deploy/deploy-tests.factor
extra/tools/deploy/shaker/shaker.factor

index 45d19cb891c752fb1ba024dc511fd364264be78f..2341aabc9ddf302ff44eb74f7b1c7d92f8365835 100755 (executable)
@@ -1,14 +1,14 @@
 USING: tools.deploy.config ;
 H{
-    { deploy-io 2 }
-    { deploy-math? f }
-    { deploy-threads? f }
-    { deploy-compiler? f }
-    { deploy-word-props? f }
-    { deploy-word-defs? f }
     { deploy-name "Hello world (console)" }
-    { deploy-reflection 2 }
+    { deploy-threads? f }
     { deploy-c-types? f }
+    { deploy-compiler? f }
     { deploy-ui? f }
+    { deploy-math? f }
+    { deploy-reflection 1 }
+    { deploy-word-defs? f }
+    { deploy-io 2 }
+    { deploy-word-props? f }
     { "stop-after-last-window?" t }
 }
index de60bed20bf8e8cca929ee31177934e450d99c65..11a06f46bc685bd9e1c0a020f2668f892d4a436f 100755 (executable)
@@ -1,13 +1,14 @@
 USING: tools.deploy.config ;
 H{
-    { deploy-reflection 2 }
-    { deploy-word-props? f }
+    { deploy-name "Sudoku" }
+    { deploy-threads? f }
+    { deploy-c-types? f }
     { deploy-compiler? t }
+    { deploy-ui? f }
     { deploy-math? f }
-    { deploy-c-types? f }
+    { deploy-reflection 1 }
+    { deploy-word-defs? f }
     { deploy-io 2 }
-    { deploy-ui? f }
-    { deploy-name "Sudoku" }
+    { deploy-word-props? f }
     { "stop-after-last-window?" t }
-    { deploy-word-defs? f }
 }
index 15dc32115e8715c137d7ec9db4b788bce218f6b2..60dc11257f138696e0d7de0af96b995ea264bf4e 100755 (executable)
@@ -65,8 +65,12 @@ IN: tools.deploy.backend
 : run-factor ( vm flags -- )
     swap add* dup . run-with-output ; inline
 
-: make-staging-image ( vm config -- )
-    staging-command-line run-factor ;
+: make-staging-image ( config -- )
+    vm swap staging-command-line run-factor ;
+
+: ?make-staging-image ( config -- )
+    dup [ staging-image-name ] bind exists?
+    [ drop ] [ make-staging-image ] if ;
 
 : deploy-command-line ( image vocab config -- flags )
     [
@@ -85,9 +89,7 @@ IN: tools.deploy.backend
 
 : make-deploy-image ( vm image vocab config -- )
     make-boot-image
-    dup staging-image-name exists? [
-        >r pick r> tuck make-staging-image
-    ] unless
+    dup ?make-staging-image
     deploy-command-line run-factor ;
 
 SYMBOL: deploy-implementation
index a6e126ea9e1bc3baf7e66a8154be130a2323d75c..6d3385d0a4d63cb23f5c38dfcea508aa06bc2a0e 100755 (executable)
@@ -1,44 +1,47 @@
 IN: tools.deploy.tests\r
 USING: tools.test system io.files kernel tools.deploy.config\r
-tools.deploy.backend math sequences io.launcher ;\r
+tools.deploy.backend math sequences io.launcher arrays ;\r
 \r
-: shake-and-bake\r
+: shake-and-bake ( vocab -- )\r
     "." resource-path [\r
-        vm\r
+        >r vm\r
         "test.image" temp-file\r
-        rot dup deploy-config make-deploy-image\r
+        r> dup deploy-config make-deploy-image\r
     ] with-directory ;\r
 \r
+: small-enough? ( n -- ? )\r
+    >r "test.image" temp-file file-info file-info-size r> <= ;\r
+\r
 [ ] [ "hello-world" shake-and-bake ] unit-test\r
 \r
 [ t ] [\r
-    "hello.image" temp-file file-info file-info-size 500000 <=\r
+    500000 small-enough?\r
 ] unit-test\r
 \r
 [ ] [ "sudoku" shake-and-bake ] unit-test\r
 \r
 [ t ] [\r
-    "hello.image" temp-file file-info file-info-size 1500000 <=\r
+    1500000 small-enough?\r
 ] unit-test\r
 \r
 [ ] [ "hello-ui" shake-and-bake ] unit-test\r
 \r
 [ t ] [\r
-    "hello.image" temp-file file-info file-info-size 2000000 <=\r
+    2000000 small-enough?\r
 ] unit-test\r
 \r
 [ ] [ "bunny" shake-and-bake ] unit-test\r
 \r
 [ t ] [\r
-    "hello.image" temp-file file-info file-info-size 3000000 <=\r
+    3000000 small-enough?\r
 ] unit-test\r
 \r
 [ ] [\r
     "tools.deploy.test.1" shake-and-bake\r
-    vm "-i=" "test.image" temp-file append try-process\r
+    vm "-i=" "test.image" temp-file append 2array try-process\r
 ] unit-test\r
 \r
 [ ] [\r
     "tools.deploy.test.2" shake-and-bake\r
-    vm "-i=" "test.image" temp-file append try-process\r
+    vm "-i=" "test.image" temp-file append 2array try-process\r
 ] unit-test\r
index bddf3d76c97a0106c9259a7e7b48a60a0071450b..edf78de4799588124857de122f85725a2ec46694 100755 (executable)
@@ -13,7 +13,6 @@ QUALIFIED: definitions
 QUALIFIED: init
 QUALIFIED: inspector
 QUALIFIED: io.backend
-QUALIFIED: io.nonblocking
 QUALIFIED: io.thread
 QUALIFIED: layouts
 QUALIFIED: libc.private
@@ -133,8 +132,10 @@ IN: tools.deploy.shaker
 
         strip-io? [ io.backend:io-backend , ] when
 
-        { io.backend:io-backend io.nonblocking:default-buffer-size }
-        { "alarms" "io" "tools" } strip-vocab-globals %
+        [
+            io.backend:io-backend
+            "default-buffer-size" "io.nonblocking" lookup ,
+        ] { "alarms" "io" "tools" } strip-vocab-globals %
 
         strip-dictionary? [
             { } { "cpu" } strip-vocab-globals %