From 93950e7d7a664cec706d83b311e475cd1ab667e8 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Fri, 7 Mar 2008 08:52:23 -0600 Subject: [PATCH] builder.*: update for new code changes --- extra/builder/builder.factor | 27 +++++++++++++------------- extra/builder/release/release.factor | 2 +- extra/builder/util/util.factor | 29 ++++++++++++++-------------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor index 41096e863c..728e87f28d 100644 --- a/extra/builder/builder.factor +++ b/extra/builder/builder.factor @@ -2,6 +2,7 @@ USING: kernel namespaces sequences splitting system combinators continuations parser io io.files io.launcher io.sockets prettyprint threads bootstrap.image benchmark vars bake smtp builder.util accessors + io.encodings.utf8 calendar builder.common builder.benchmark @@ -35,20 +36,20 @@ IN: builder ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : git-id ( -- id ) - { "git" "show" } [ readln ] with-stream " " split second ; + { "git" "show" } utf8 + [ readln ] with-stream " " split second ; -: record-git-id ( -- ) git-id "../git-id" [ . ] with-file-writer ; +: record-git-id ( -- ) git-id "../git-id" utf8 [ . ] with-file-writer ; : do-make-clean ( -- ) { "make" "clean" } try-process ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : make-vm ( -- desc ) - - { "make" } >>arguments + + { "make" } >>command "../compile-log" >>stdout - +stdout+ >>stderr - >desc ; + +stdout+ >>stderr ; : do-make-vm ( -- ) make-vm [ "vm compile error" print "../compile-log" cat ] run-or-bail ; @@ -65,13 +66,12 @@ IN: builder { "./factor" { "-i=" my-boot-image-name } "-no-user-init" } to-strings ; : bootstrap ( -- desc ) - - bootstrap-cmd >>arguments + + bootstrap-cmd >>command +closed+ >>stdin "../boot-log" >>stdout +stdout+ >>stderr - 20 minutes >>timeout - >desc ; + 20 minutes >>timeout ; : do-bootstrap ( -- ) bootstrap [ "Bootstrap error" print "../boot-log" cat ] run-or-bail ; @@ -80,13 +80,12 @@ IN: builder { "./factor" "-run=builder.test" } to-strings ; : builder-test ( -- desc ) - - builder-test-cmd >>arguments + + builder-test-cmd >>command +closed+ >>stdin "../test-log" >>stdout +stdout+ >>stderr - 45 minutes >>timeout - >desc ; + 45 minutes >>timeout ; : do-builder-test ( -- ) builder-test [ "Test error" print "../test-log" 100 cat-n ] run-or-bail ; diff --git a/extra/builder/release/release.factor b/extra/builder/release/release.factor index 849d1a54a3..f0cf0ee113 100644 --- a/extra/builder/release/release.factor +++ b/extra/builder/release/release.factor @@ -19,7 +19,7 @@ IN: builder.release { "boot.x86.32.image" "boot.x86.64.image" - "boot.macosx-ppc.boot" + "boot.macosx-ppc.image" "vm" "temp" "logs" diff --git a/extra/builder/util/util.factor b/extra/builder/util/util.factor index 9682fc1346..50d74ddfc8 100644 --- a/extra/builder/util/util.factor +++ b/extra/builder/util/util.factor @@ -4,6 +4,7 @@ USING: kernel words namespaces classes parser continuations math math.parser combinators sequences splitting quotations arrays strings tools.time sequences.deep new-slots accessors assocs.lib + io.encodings.utf8 combinators.cleave bake calendar calendar.format ; IN: builder.util @@ -14,7 +15,7 @@ IN: builder.util : minutes>ms ( min -- ms ) 60 * 1000 * ; -: file>string ( file -- string ) [ stdio get contents ] with-file-reader ; +: file>string ( file -- string ) utf8 [ stdio get contents ] with-file-reader ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -39,18 +40,18 @@ DEFER: to-strings ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -TUPLE: process* arguments stdin stdout stderr timeout ; +! TUPLE: process* arguments stdin stdout stderr timeout ; -: process* construct-empty ; +! : process* construct-empty ; -: >desc ( process* -- desc ) - H{ } clone - over arguments>> [ +arguments+ swap put-at ] when* - over stdin>> [ +stdin+ swap put-at ] when* - over stdout>> [ +stdout+ swap put-at ] when* - over stderr>> [ +stderr+ swap put-at ] when* - over timeout>> [ +timeout+ swap put-at ] when* - nip ; +! : >desc ( process* -- desc ) +! H{ } clone +! over arguments>> [ +arguments+ swap put-at ] when* +! over stdin>> [ +stdin+ swap put-at ] when* +! over stdout>> [ +stdout+ swap put-at ] when* +! over stderr>> [ +stderr+ swap put-at ] when* +! over timeout>> [ +timeout+ swap put-at ] when* +! nip ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -71,7 +72,7 @@ TUPLE: process* arguments stdin stdout stderr timeout ; : eval-file ( file -- obj ) file-contents eval ; -: cat ( file -- ) file-contents print ; +: cat ( file -- ) utf8 file-contents print ; : run-or-bail ( desc quot -- ) [ [ try-process ] curry ] @@ -96,7 +97,7 @@ USING: bootstrap.image bootstrap.image.download io.streams.null ; if ; : cat-n ( file n -- ) - [ file-lines ] [ ] bi* + [ utf8 file-lines ] [ ] bi* maybe-tail* [ print ] each ; @@ -104,7 +105,7 @@ USING: bootstrap.image bootstrap.image.download io.streams.null ; USE: prettyprint -: to-file ( object file -- ) [ . ] with-file-writer ; +: to-file ( object file -- ) utf8 [ . ] with-file-writer ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!