builder: more tweaks

db4
Eduardo Cavazos 2008-02-14 01:01:09 -06:00
parent 0cc1c0d597
commit a8cd31311d
2 changed files with 51 additions and 47 deletions

View File

@ -11,28 +11,6 @@ IN: builder
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
SYMBOL: builder-recipients
: tag-subject ( str -- str ) { "builder@" host-name* ": " , } bake to-string ;
: target ( -- target ) { os [ cpu "." split ] } to-strings "-" join ;
: factor-binary ( -- name )
os
{ { "macosx" [ "./Factor.app/Contents/MacOS/factor" ] }
{ "winnt" [ "./factor-nt.exe" ] }
[ drop "./factor" ] }
case ;
: git-pull ( -- desc )
{
"git"
"pull"
"--no-summary"
"git://factorcode.org/git/factor.git"
"master"
} ;
: git-clone ( -- desc ) { "git" "clone" "../factor" } ; : git-clone ( -- desc ) { "git" "clone" "../factor" } ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -54,6 +32,10 @@ VAR: stamp
: make-clean ( -- desc ) { "make" "clean" } ; : make-clean ( -- desc ) { "make" "clean" } ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: target ( -- target ) { os [ cpu "." split ] } to-strings "-" join ;
: make-vm ( -- desc ) : make-vm ( -- desc )
<process*> <process*>
{ "make" target } to-strings >>arguments { "make" target } to-strings >>arguments
@ -61,6 +43,15 @@ VAR: stamp
+stdout+ >>stderr +stdout+ >>stderr
>desc ; >desc ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: factor-binary ( -- name )
os
{ { "macosx" [ "./Factor.app/Contents/MacOS/factor" ] }
{ "winnt" [ "./factor-nt.exe" ] }
[ drop "./factor" ] }
case ;
: bootstrap-cmd ( -- cmd ) : bootstrap-cmd ( -- cmd )
{ factor-binary [ "-i=" my-boot-image-name append ] "-no-user-init" } { factor-binary [ "-i=" my-boot-image-name append ] "-no-user-init" }
to-strings ; to-strings ;
@ -75,8 +66,6 @@ VAR: stamp
: builder-test ( -- desc ) { factor-binary "-run=builder.test" } to-strings ; : builder-test ( -- desc ) { factor-binary "-run=builder.test" } to-strings ;
SYMBOL: build-status
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: (build) ( -- ) : (build) ( -- )
@ -134,6 +123,12 @@ SYMBOL: build-status
] with-file-out ; ] with-file-out ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
SYMBOL: builder-recipients
: tag-subject ( str -- str ) { "builder@" host-name* ": " , } bake to-string ;
: build ( -- ) : build ( -- )
[ (build) ] [ drop ] recover [ (build) ] [ drop ] recover
<email> <email>
@ -145,6 +140,15 @@ SYMBOL: build-status
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: git-pull ( -- desc )
{
"git"
"pull"
"--no-summary"
"git://factorcode.org/git/factor.git"
"master"
} ;
: updates-available? ( -- ? ) : updates-available? ( -- ? )
git-id git-id
git-pull run-process drop git-pull run-process drop

View File

@ -41,28 +41,28 @@ IN: builder.server
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: build-server ( -- ) ! : build-server ( -- )
receive ! receive
{ ! {
{ ! {
"start" ! "start"
[ ! [
build-status get "idle" = ! build-status get "idle" =
build-status get f = ! build-status get f =
or ! or
[ ! [
[ [ build ] [ drop ] recover "idle" build-status set-global ] ! [ [ build ] [ drop ] recover "idle" build-status set-global ]
in-thread ! in-thread
] ! ]
when ! when
] ! ]
} ! }
{ ! {
{ ?from ?tag "status" } ! { ?from ?tag "status" }
[ `{ ?tag ,[ build-status get ] } ?from send ] ! [ `{ ?tag ,[ build-status get ] } ?from send ]
} ! }
} ! }
match-cond ! match-cond
build-server ; ! build-server ;