2008-01-31 01:25:06 -05:00
|
|
|
|
2008-02-16 04:43:51 -05:00
|
|
|
USING: kernel namespaces sequences splitting system combinators continuations
|
|
|
|
parser io io.files io.launcher io.sockets prettyprint threads
|
2008-02-19 07:09:06 -05:00
|
|
|
bootstrap.image benchmark vars bake smtp builder.util accessors
|
2008-02-22 18:48:20 -05:00
|
|
|
calendar
|
2008-02-22 18:26:09 -05:00
|
|
|
builder.common
|
|
|
|
builder.benchmark
|
|
|
|
builder.release ;
|
2008-01-31 01:25:06 -05:00
|
|
|
|
|
|
|
IN: builder
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-15 06:22:52 -05:00
|
|
|
: prepare-build-machine ( -- )
|
|
|
|
builds make-directory
|
|
|
|
builds cd
|
|
|
|
{ "git" "clone" "git://factorcode.org/git/factor.git" } run-process drop ;
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
|
|
|
: builds-check ( -- ) builds exists? not [ prepare-build-machine ] when ;
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-10 02:04:14 -05:00
|
|
|
: git-clone ( -- desc ) { "git" "clone" "../factor" } ;
|
2008-02-04 22:26:59 -05:00
|
|
|
|
2008-02-12 06:38:09 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-10 02:04:14 -05:00
|
|
|
: enter-build-dir ( -- )
|
|
|
|
datestamp >stamp
|
2008-02-15 06:22:52 -05:00
|
|
|
builds cd
|
2008-02-10 02:04:14 -05:00
|
|
|
stamp> make-directory
|
|
|
|
stamp> cd ;
|
2008-02-04 22:26:59 -05:00
|
|
|
|
2008-02-12 06:38:09 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-11 15:59:02 -05:00
|
|
|
: git-id ( -- id )
|
|
|
|
{ "git" "show" } <process-stream> [ readln ] with-stream " " split second ;
|
|
|
|
|
2008-02-15 23:20:31 -05:00
|
|
|
: record-git-id ( -- ) git-id "../git-id" [ . ] with-file-writer ;
|
2008-02-04 22:26:59 -05:00
|
|
|
|
2008-02-10 02:04:14 -05:00
|
|
|
: make-clean ( -- desc ) { "make" "clean" } ;
|
2008-02-08 21:09:59 -05:00
|
|
|
|
2008-02-14 02:01:09 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
|
|
|
: target ( -- target ) { os [ cpu "." split ] } to-strings "-" join ;
|
|
|
|
|
2008-02-14 01:43:50 -05:00
|
|
|
: make-vm ( -- desc )
|
|
|
|
<process*>
|
|
|
|
{ "make" target } to-strings >>arguments
|
|
|
|
"../compile-log" >>stdout
|
|
|
|
+stdout+ >>stderr
|
|
|
|
>desc ;
|
|
|
|
|
2008-02-14 02:01:09 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-18 09:13:35 -05:00
|
|
|
: copy-image ( -- )
|
2008-02-18 18:16:37 -05:00
|
|
|
"../../factor/" my-boot-image-name append
|
|
|
|
"../" my-boot-image-name append
|
|
|
|
copy-file
|
|
|
|
|
|
|
|
"../../factor/" my-boot-image-name append
|
|
|
|
my-boot-image-name
|
2008-02-18 09:13:35 -05:00
|
|
|
copy-file ;
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-25 17:27:31 -05:00
|
|
|
! : factor-binary ( -- name )
|
|
|
|
! os "macosx" =
|
|
|
|
! [ "./Factor.app/Contents/MacOS/factor" ]
|
|
|
|
! [ "./factor" ]
|
|
|
|
! if ;
|
2008-02-14 02:01:09 -05:00
|
|
|
|
2008-02-14 01:43:50 -05:00
|
|
|
: bootstrap-cmd ( -- cmd )
|
2008-02-25 17:27:31 -05:00
|
|
|
{ "./factor" { "-i=" my-boot-image-name } "-no-user-init" } to-strings ;
|
2008-02-04 22:26:59 -05:00
|
|
|
|
2008-02-10 02:04:14 -05:00
|
|
|
: bootstrap ( -- desc )
|
2008-02-14 01:43:50 -05:00
|
|
|
<process*>
|
|
|
|
bootstrap-cmd >>arguments
|
2008-02-14 06:20:38 -05:00
|
|
|
+closed+ >>stdin
|
2008-02-14 01:43:50 -05:00
|
|
|
"../boot-log" >>stdout
|
|
|
|
+stdout+ >>stderr
|
2008-02-22 18:48:20 -05:00
|
|
|
20 minutes >>timeout
|
2008-02-14 01:43:50 -05:00
|
|
|
>desc ;
|
|
|
|
|
2008-02-18 10:01:31 -05:00
|
|
|
: builder-test-cmd ( -- cmd )
|
2008-02-25 17:27:31 -05:00
|
|
|
{ "./factor" "-run=builder.test" } to-strings ;
|
2008-02-18 10:01:31 -05:00
|
|
|
|
|
|
|
: builder-test ( -- desc )
|
|
|
|
<process*>
|
|
|
|
builder-test-cmd >>arguments
|
|
|
|
+closed+ >>stdin
|
|
|
|
"../test-log" >>stdout
|
|
|
|
+stdout+ >>stderr
|
2008-02-22 18:48:20 -05:00
|
|
|
45 minutes >>timeout
|
2008-02-18 10:01:31 -05:00
|
|
|
>desc ;
|
|
|
|
|
2008-02-12 00:42:21 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-15 04:17:30 -05:00
|
|
|
SYMBOL: build-status
|
|
|
|
|
2008-02-11 19:13:49 -05:00
|
|
|
: (build) ( -- )
|
|
|
|
|
2008-02-16 10:05:01 -05:00
|
|
|
builds-check
|
|
|
|
|
2008-02-15 04:17:30 -05:00
|
|
|
build-status off
|
|
|
|
|
2008-02-11 19:13:49 -05:00
|
|
|
enter-build-dir
|
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
"report" [
|
2008-02-11 19:13:49 -05:00
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
"Build machine: " write host-name print
|
2008-02-15 04:17:30 -05:00
|
|
|
"CPU: " write cpu print
|
|
|
|
"OS: " write os print
|
2008-02-15 08:46:20 -05:00
|
|
|
"Build directory: " write cwd print nl
|
2008-02-12 00:42:21 -05:00
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
git-clone [ "git clone failed" print ] run-or-bail
|
2008-02-10 02:04:14 -05:00
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
"factor" cd
|
2008-02-10 02:04:14 -05:00
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
record-git-id
|
2008-02-10 02:04:14 -05:00
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
make-clean run-process drop
|
2008-02-10 02:04:14 -05:00
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
make-vm [ "vm compile error" print "../compile-log" cat ] run-or-bail
|
2008-02-10 02:04:14 -05:00
|
|
|
|
2008-02-18 09:13:35 -05:00
|
|
|
copy-image
|
2008-02-10 02:04:14 -05:00
|
|
|
|
2008-02-14 06:20:38 -05:00
|
|
|
bootstrap [ "Bootstrap error" print "../boot-log" cat ] run-or-bail
|
|
|
|
|
2008-02-19 17:45:19 -05:00
|
|
|
builder-test [ "Test error" print "../test-log" 100 cat-n ] run-or-bail
|
2008-02-11 19:13:49 -05:00
|
|
|
|
2008-02-19 15:37:33 -05:00
|
|
|
"../test-log" delete-file
|
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
"Boot time: " write "../boot-time" eval-file milli-seconds>time print
|
|
|
|
"Load time: " write "../load-time" eval-file milli-seconds>time print
|
2008-02-15 08:46:20 -05:00
|
|
|
"Test time: " write "../test-time" eval-file milli-seconds>time print nl
|
2008-02-12 05:42:47 -05:00
|
|
|
|
|
|
|
"Did not pass load-everything: " print "../load-everything-vocabs" cat
|
|
|
|
"Did not pass test-all: " print "../test-all-vocabs" cat
|
|
|
|
|
2008-02-13 06:50:45 -05:00
|
|
|
"Benchmarks: " print
|
2008-02-15 23:20:31 -05:00
|
|
|
"../benchmarks" [ stdio get contents eval ] with-file-reader benchmarks.
|
2008-02-13 06:50:45 -05:00
|
|
|
|
2008-02-18 18:16:37 -05:00
|
|
|
nl
|
|
|
|
|
|
|
|
show-benchmark-deltas
|
|
|
|
|
|
|
|
"../benchmarks" "../../benchmarks" copy-file
|
|
|
|
|
2008-02-15 23:20:31 -05:00
|
|
|
] with-file-writer
|
2008-02-15 04:17:30 -05:00
|
|
|
|
|
|
|
build-status on ;
|
2008-02-11 19:13:49 -05:00
|
|
|
|
2008-02-14 02:01:09 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-15 06:22:52 -05:00
|
|
|
SYMBOL: builder-from
|
|
|
|
|
2008-02-14 02:01:09 -05:00
|
|
|
SYMBOL: builder-recipients
|
|
|
|
|
|
|
|
: tag-subject ( str -- str ) { "builder@" host-name* ": " , } bake to-string ;
|
|
|
|
|
2008-02-15 06:22:52 -05:00
|
|
|
: subject ( -- str ) build-status get [ "report" ] [ "error" ] if tag-subject ;
|
2008-02-15 04:17:30 -05:00
|
|
|
|
2008-02-15 06:22:52 -05:00
|
|
|
: send-builder-email ( -- )
|
2008-02-14 01:43:50 -05:00
|
|
|
<email>
|
2008-02-15 06:22:52 -05:00
|
|
|
builder-from get >>from
|
2008-02-14 01:43:50 -05:00
|
|
|
builder-recipients get >>to
|
2008-02-15 04:17:30 -05:00
|
|
|
subject >>subject
|
2008-02-14 01:43:50 -05:00
|
|
|
"../report" file>string >>body
|
|
|
|
send ;
|
2008-02-12 05:42:47 -05:00
|
|
|
|
2008-02-18 18:16:37 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-19 16:32:53 -05:00
|
|
|
: compress-image ( -- )
|
|
|
|
{ "bzip2" my-boot-image-name } to-strings run-process drop ;
|
|
|
|
|
2008-02-15 06:22:52 -05:00
|
|
|
: build ( -- )
|
|
|
|
[ (build) ] [ drop ] recover
|
2008-02-25 17:27:31 -05:00
|
|
|
build-status get [ maybe-release ] when
|
2008-02-18 18:16:37 -05:00
|
|
|
[ send-builder-email ] [ drop "not sending mail" . ] recover
|
2008-02-19 16:32:53 -05:00
|
|
|
".." cd { "rm" "-rf" "factor" } run-process drop
|
|
|
|
[ compress-image ] [ drop ] recover ;
|
2008-02-15 06:22:52 -05:00
|
|
|
|
2008-02-12 05:42:47 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-18 09:13:35 -05:00
|
|
|
USE: bootstrap.image.download
|
|
|
|
|
2008-02-14 02:01:09 -05:00
|
|
|
: git-pull ( -- desc )
|
|
|
|
{
|
|
|
|
"git"
|
|
|
|
"pull"
|
|
|
|
"--no-summary"
|
|
|
|
"git://factorcode.org/git/factor.git"
|
|
|
|
"master"
|
|
|
|
} ;
|
|
|
|
|
2008-02-11 15:59:02 -05:00
|
|
|
: updates-available? ( -- ? )
|
|
|
|
git-id
|
|
|
|
git-pull run-process drop
|
|
|
|
git-id
|
|
|
|
= not ;
|
|
|
|
|
2008-02-18 09:13:35 -05:00
|
|
|
: new-image-available? ( -- ? )
|
2008-02-18 18:16:37 -05:00
|
|
|
my-boot-image-name need-new-image?
|
2008-02-18 09:13:35 -05:00
|
|
|
[ download-my-image t ]
|
|
|
|
[ f ]
|
|
|
|
if ;
|
|
|
|
|
2008-02-11 15:59:02 -05:00
|
|
|
: build-loop ( -- )
|
2008-02-15 06:54:19 -05:00
|
|
|
builds-check
|
2008-02-11 15:59:02 -05:00
|
|
|
[
|
2008-02-15 07:04:53 -05:00
|
|
|
builds "/factor" append cd
|
2008-02-18 09:13:35 -05:00
|
|
|
updates-available? new-image-available? or
|
2008-02-11 15:59:02 -05:00
|
|
|
[ build ]
|
|
|
|
when
|
|
|
|
]
|
|
|
|
[ drop ]
|
|
|
|
recover
|
2008-02-22 18:48:20 -05:00
|
|
|
5 minutes sleep
|
2008-02-11 15:59:02 -05:00
|
|
|
build-loop ;
|
2008-01-31 01:25:06 -05:00
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-11 15:59:02 -05:00
|
|
|
MAIN: build-loop
|