diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor index d8305041ab..d9961f9452 100644 --- a/extra/builder/builder.factor +++ b/extra/builder/builder.factor @@ -2,21 +2,15 @@ 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 - builder.benchmark ; + calendar + builder.common + builder.benchmark + builder.release ; IN: builder ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -SYMBOL: builds-dir - -: builds ( -- path ) - builds-dir get - home "/builds" append - or ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - : prepare-build-machine ( -- ) builds make-directory builds cd @@ -32,8 +26,6 @@ SYMBOL: builds-dir ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -VAR: stamp - : enter-build-dir ( -- ) datestamp >stamp builds cd @@ -89,7 +81,7 @@ VAR: stamp +closed+ >>stdin "../boot-log" >>stdout +stdout+ >>stderr - 20 minutes>ms >>timeout + 20 minutes >>timeout >desc ; : builder-test-cmd ( -- cmd ) @@ -101,7 +93,7 @@ VAR: stamp +closed+ >>stdin "../test-log" >>stdout +stdout+ >>stderr - 45 minutes>ms >>timeout + 45 minutes >>timeout >desc ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -225,7 +217,7 @@ USE: bootstrap.image.download ] [ drop ] recover - 5 minutes>ms sleep + 5 minutes sleep build-loop ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/extra/builder/common/common.factor b/extra/builder/common/common.factor new file mode 100644 index 0000000000..6ebe1d625a --- /dev/null +++ b/extra/builder/common/common.factor @@ -0,0 +1,18 @@ + +USING: kernel namespaces io.files sequences vars ; + +IN: builder.common + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +SYMBOL: builds-dir + +: builds ( -- path ) + builds-dir get + home "/builds" append + or ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +VAR: stamp + diff --git a/extra/builder/release/release.factor b/extra/builder/release/release.factor new file mode 100644 index 0000000000..db903c9501 --- /dev/null +++ b/extra/builder/release/release.factor @@ -0,0 +1,117 @@ + +USING: kernel namespaces sequences combinators io.files io.launcher + combinators.cleave builder.common builder.util ; + +IN: builder.release + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: releases ( -- path ) builds "/releases" append ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: common-files ( -- seq ) + { + "boot.x86.32.image" + "boot.x86.64.image" + "boot.macosx-ppc.boot" + "vm" + "temp" + "logs" + ".git" + ".gitignore" + "Makefile" + "cp_dir" + "unmaintained" + "misc/target" + "misc/wordsize" + "misc/wordsize.c" + "misc/macos-release.sh" + "misc/source-release.sh" + "misc/windows-release.sh" + "misc/version.sh" + } ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +USING: system sequences splitting ; + +: cpu- ( -- cpu ) cpu "." split "-" join ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: base-name ( -- string ) { "factor" os cpu- stamp> } to-strings "-" join ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: extension ( -- extension ) + os + { + { "linux" [ ".tar.gz" ] } + { "winnt" [ ".zip" ] } + { "macosx" [ ".dmg" ] } + } + case ; + +: archive-name ( -- string ) base-name extension append ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: move-file ( source destination -- ) swap { "mv" , , } run-process drop ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: linux-release ( -- ) + + { "rm" "-rf" "Factor.app" } run-process drop + + { "rm" "-rf" common-files } to-strings run-process drop + + ".." cd + + { "tar" "-cvzf" archive-name "factor" } to-strings run-process drop + + archive-name releases move-file ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: windows-release ( -- ) + + { "rm" "-rf" "Factor.app" } run-process drop + + { "rm" "-rf" common-files } to-strings run-process drop + + ".." cd + + { "zip" "-r" archive-name "factor" } to-strings run-process drop + + archive-name releases move-file ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: macosx-release ( -- ) + + { "rm" "-rf" common-files } to-strings run-process drop + + ".." cd + + { "hdiutil" "create" + "-srcfolder" "factor" + "-fs" "HFS+" + "-volname" "factor" + archive-name } + to-strings run-process drop + + archive-name releases move-file ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: release ( -- ) + os + { + { "linux" [ linux-release ] } + { "winnt" [ windows-release ] } + { "macosx" [ macosx-release ] } + } + case ; + \ No newline at end of file diff --git a/extra/smtp/smtp.factor b/extra/smtp/smtp.factor index 47bc16e029..c74a6e72fb 100755 --- a/extra/smtp/smtp.factor +++ b/extra/smtp/smtp.factor @@ -10,7 +10,7 @@ IN: smtp SYMBOL: smtp-domain SYMBOL: smtp-host "localhost" smtp-host set-global SYMBOL: smtp-port 25 smtp-port set-global -SYMBOL: read-timeout 60000 read-timeout set-global +SYMBOL: read-timeout 1 minutes read-timeout set-global SYMBOL: esmtp t esmtp set-global : log-smtp-connection ( host port -- ) 2drop ;