distro-build: add #:pause-before' and #:pause-after' options

I'm hoping this will help reduce failures in my snapshot builds.
This commit is contained in:
Matthew Flatt 2013-07-29 07:01:47 -06:00
parent bf5795ea4c
commit bcc0b335a3
3 changed files with 13 additions and 1 deletions

View File

@ -145,6 +145,8 @@
[(#:site-dest) (path-string? val)]
[(#:pdf-doc?) (boolean? val)]
[(#:max-snapshots) (real? val)]
[(#:pause-before) (and (real? val) (not (negative? val)))]
[(#:pause-after) (and (real? val) (not (negative? val)))]
[(#:readme) (or (string? val)
(and (procedure? val)
(procedure-arity-includes? val 1)))]

View File

@ -239,6 +239,14 @@ Site-configuration keywords (where <string*> means no spaces, etc.):
#:max-snapshots <number> --- number of snapshots to keep, used by
the `snapshot-site' makefile target
#:pause-before <nonnegative-number> --- a pause in seconds to
wait before starting a machine, which may help a virtual machine
avoid confusion from being stopped and started too quickly; the
default is 0
#:pause-after <nonnegative-number> --- a pause in seconds to
wait after stopping a machine; the default is 0
#:custom <hash-table> --- a hash table mapping arbitrary keywords to
arbitrary values; when a value for `#:custom' is overriden in a
nested configuration, the new table is merged with the overriden

View File

@ -458,6 +458,7 @@
(limit-and-report-failure
c 2
(lambda ()
(sleep (get-opt c '#:pause-before 0))
;; start client, if a VM:
(start-client c (or (get-opt c '#:max-vm) 1))
;; catch failure in build step proper, so we
@ -467,6 +468,7 @@
c 1
(lambda () (client-build c)))
;; stop client, if a VM:
(stop-client c))))))]))))
(stop-client c)
(sleep (get-opt c '#:pause-after 0)))))))]))))
(display-time)