builder: refactoring
parent
29ef996639
commit
e5c567c739
|
@ -39,29 +39,27 @@ IN: builder
|
||||||
|
|
||||||
: record-git-id ( -- ) git-id "../git-id" [ . ] with-file-writer ;
|
: record-git-id ( -- ) git-id "../git-id" [ . ] with-file-writer ;
|
||||||
|
|
||||||
: make-clean ( -- desc ) { "make" "clean" } ;
|
: do-make-clean ( -- desc ) { "make" "clean" } try-process ;
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: target ( -- target ) { os [ cpu "." split ] } to-strings "-" join ;
|
! : target ( -- target ) { os [ cpu "." split ] } to-strings "-" join ;
|
||||||
|
|
||||||
: make-vm ( -- desc )
|
: make-vm ( -- desc )
|
||||||
<process*>
|
<process*>
|
||||||
{ "make" target } to-strings >>arguments
|
{ "make" } >>arguments
|
||||||
"../compile-log" >>stdout
|
"../compile-log" >>stdout
|
||||||
+stdout+ >>stderr
|
+stdout+ >>stderr
|
||||||
>desc ;
|
>desc ;
|
||||||
|
|
||||||
|
: do-make-vm ( -- )
|
||||||
|
make-vm [ "vm compile error" print "../compile-log" cat ] run-or-bail ;
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: copy-image ( -- )
|
: copy-image ( -- )
|
||||||
"../../factor/" my-boot-image-name append
|
builds "factor" path+ my-boot-image-name path+ ".." copy-file-into
|
||||||
"../" my-boot-image-name append
|
builds "factor" path+ my-boot-image-name path+ "." copy-file-into ;
|
||||||
copy-file
|
|
||||||
|
|
||||||
"../../factor/" my-boot-image-name append
|
|
||||||
my-boot-image-name
|
|
||||||
copy-file ;
|
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
@ -77,6 +75,9 @@ IN: builder
|
||||||
20 minutes >>timeout
|
20 minutes >>timeout
|
||||||
>desc ;
|
>desc ;
|
||||||
|
|
||||||
|
: do-bootstrap ( -- )
|
||||||
|
bootstrap [ "Bootstrap error" print "../boot-log" cat ] run-or-bail ;
|
||||||
|
|
||||||
: builder-test-cmd ( -- cmd )
|
: builder-test-cmd ( -- cmd )
|
||||||
{ "./factor" "-run=builder.test" } to-strings ;
|
{ "./factor" "-run=builder.test" } to-strings ;
|
||||||
|
|
||||||
|
@ -89,6 +90,9 @@ IN: builder
|
||||||
45 minutes >>timeout
|
45 minutes >>timeout
|
||||||
>desc ;
|
>desc ;
|
||||||
|
|
||||||
|
: do-builder-test ( -- )
|
||||||
|
builder-test [ "Test error" print "../test-log" 100 cat-n ] run-or-bail ;
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
SYMBOL: build-status
|
SYMBOL: build-status
|
||||||
|
@ -101,52 +105,46 @@ SYMBOL: build-status
|
||||||
|
|
||||||
enter-build-dir
|
enter-build-dir
|
||||||
|
|
||||||
"report" [
|
"report"
|
||||||
|
[
|
||||||
|
"Build machine: " write host-name print
|
||||||
|
"CPU: " write cpu print
|
||||||
|
"OS: " write os print
|
||||||
|
"Build directory: " write cwd print nl
|
||||||
|
|
||||||
"Build machine: " write host-name print
|
git-clone [ "git clone failed" print ] run-or-bail
|
||||||
"CPU: " write cpu print
|
|
||||||
"OS: " write os print
|
|
||||||
"Build directory: " write cwd print nl
|
|
||||||
|
|
||||||
git-clone [ "git clone failed" print ] run-or-bail
|
"factor"
|
||||||
|
[
|
||||||
|
record-git-id
|
||||||
|
do-make-clean
|
||||||
|
do-make-vm
|
||||||
|
copy-image
|
||||||
|
do-bootstrap
|
||||||
|
do-builder-test
|
||||||
|
]
|
||||||
|
with-directory
|
||||||
|
|
||||||
"factor" cd
|
"test-log" delete-file
|
||||||
|
|
||||||
record-git-id
|
"Boot time: " write "boot-time" eval-file milli-seconds>time print
|
||||||
|
"Load time: " write "load-time" eval-file milli-seconds>time print
|
||||||
|
"Test time: " write "test-time" eval-file milli-seconds>time print nl
|
||||||
|
|
||||||
make-clean run-process drop
|
"Did not pass load-everything: " print "load-everything-vocabs" cat
|
||||||
|
"Did not pass test-all: " print "test-all-vocabs" cat
|
||||||
|
|
||||||
make-vm [ "vm compile error" print "../compile-log" cat ] run-or-bail
|
"Benchmarks: " print "benchmarks" eval-file benchmarks.
|
||||||
|
|
||||||
copy-image
|
nl
|
||||||
|
|
||||||
bootstrap [ "Bootstrap error" print "../boot-log" cat ] run-or-bail
|
show-benchmark-deltas
|
||||||
|
|
||||||
builder-test [ "Test error" print "../test-log" 100 cat-n ] run-or-bail
|
"benchmarks" ".." copy-file-into
|
||||||
|
|
||||||
"../test-log" delete-file
|
maybe-release
|
||||||
|
]
|
||||||
"Boot time: " write "../boot-time" eval-file milli-seconds>time print
|
with-file-writer
|
||||||
"Load time: " write "../load-time" eval-file milli-seconds>time print
|
|
||||||
"Test time: " write "../test-time" eval-file milli-seconds>time print nl
|
|
||||||
|
|
||||||
"Did not pass load-everything: " print "../load-everything-vocabs" cat
|
|
||||||
"Did not pass test-all: " print "../test-all-vocabs" cat
|
|
||||||
|
|
||||||
"Benchmarks: " print
|
|
||||||
"../benchmarks" [ stdio get contents eval ] with-file-reader benchmarks.
|
|
||||||
|
|
||||||
nl
|
|
||||||
|
|
||||||
show-benchmark-deltas
|
|
||||||
|
|
||||||
"../benchmarks" "../../benchmarks" copy-file
|
|
||||||
|
|
||||||
".." cd
|
|
||||||
|
|
||||||
maybe-release
|
|
||||||
|
|
||||||
] with-file-writer
|
|
||||||
|
|
||||||
build-status on ;
|
build-status on ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue