www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ea81482bf177da5e201ceaf3be6129c06318778a
parent 3ad9d3b3b4cf16dbe02242576022e6164fe2d1ba
Author: Matthew Flatt <mflatt@racket-lang.org>
Date:   Wed, 10 Jul 2013 16:23:37 -0600

installers site: include documentation of built packages

original commit: b9fd9ad78c931117219aec92121b46e24bb4852d

Diffstat:
Mpkgs/distro-build/assemble-site.rkt | 8++++++++
Mpkgs/distro-build/download-page.rkt | 17+++++++++++++++--
Mpkgs/distro-build/drive-clients.rkt | 6+++++-
Apkgs/distro-build/install-for-docs.rkt | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/pkgs/distro-build/assemble-site.rkt b/pkgs/distro-build/assemble-site.rkt @@ -9,10 +9,12 @@ (define built-dir (build-path build-dir "built")) (define native-dir (build-path build-dir "native")) +(define docs-dir (build-path build-dir "docs")) (define installers-dir (build-path "installers")) (define pkgs-dir (build-path "pkgs")) (define catalog-dir (build-path "catalog")) +(define doc-dir (build-path "doc")) (define-values (config-file config-mode) (command-line @@ -92,10 +94,16 @@ (copy installers-dir) +(define doc-path (build-path docs-dir doc-dir)) +(when (directory-exists? doc-path) + (copy doc-dir docs-dir)) + (make-download-page (build-path build-dir installers-dir "table.rktd") #:installers-url "installers/" + #:docs-url (and (directory-exists? doc-path) + "doc/index.html") #:dest (build-path dest-dir "index.html") #:git-clone (current-directory)) diff --git a/pkgs/distro-build/download-page.rkt b/pkgs/distro-build/download-page.rkt @@ -37,6 +37,7 @@ (define (make-download-page table-file #:dest [dest "index.html"] #:installers-url [installers-url "./"] + #:docs-url [docs-url #f] #:title [title "Racket Downloads"] #:git-clone [git-clone #f] #:post-content [post-content null]) @@ -65,25 +66,37 @@ `(html (head (title ,title) (style ,(~a " .detail { font-size: small; }" - " .checksum, .path { font-family: monospace }"))) + " .checksum, .path { font-family: monospace; }" + " a { text-decoration: none; }"))) (body (h2 ,title) (table ,@(for/list ([key (in-list (sort (hash-keys table) string<?))]) (define inst (hash-ref table key)) - `(tr (td (a ((href ,(url->string + `(tr (td (a ((class "installer") + (href ,(url->string (combine-url/relative (string->url installers-url) inst)))) ,key)) (td nbsp) (td (span ([class "detail"]) + ,(~r (/ (file-size (build-path (path-only table-file) + inst)) + (* 1024 1024)) + #:precision 1) + " MB")) + (td nbsp) + (td (span ([class "detail"]) "SHA1: " (span ([class "checksum"]) ,(call-with-input-file* (build-path (path-only table-file) inst) sha1))))))) + ,@(if docs-url + `((p (a ((href ,docs-url)) "Documentation"))) + null) ,@(if git-clone (let ([git (find-executable-path "git")]) (define origin (let ([s (system*/string git "remote" "show" "origin")]) diff --git a/pkgs/distro-build/drive-clients.rkt b/pkgs/distro-build/drive-clients.rkt @@ -313,16 +313,20 @@ (define timeout (or (get-opt c '#:timeout) (* 30 60))) (define orig-thread (current-thread)) + (define timeout? #f) (parameterize ([current-custodian cust]) (thread (lambda () (sleep (* timeout-factor timeout)) ;; try nice interrupt, first: + (set! timeout? #t) (break-thread orig-thread) (sleep 1) ;; force quit: (custodian-shutdown-all cust))) (with-handlers ([exn? (lambda (exn) - (when (exn:break? exn) (set! stop? #t)) + (when (exn:break? exn) + (unless timeout? + (set! stop? #t))) (log-error "~a failed..." (client-name c)) (log-error (exn-message exn)))]) (thunk))) diff --git a/pkgs/distro-build/install-for-docs.rkt b/pkgs/distro-build/install-for-docs.rkt @@ -0,0 +1,55 @@ +#lang racket/base +(require racket/cmdline + racket/file + racket/string + racket/system + compiler/find-exe + (only-in "config.rkt" extract-options)) + +(define-values (dir config-file config-mode default-pkgs catalogs) + (command-line + #:args + (dir config-file config-mode default-pkgs . catalog) + (values dir config-file config-mode default-pkgs catalog))) + +(define pkgs + (or (hash-ref (extract-options config-file config-mode) + '#:pkgs + #f) + (string-split default-pkgs))) + +(define (build-path/s . a) + (path->string (path->complete-path (apply build-path dir a)))) +(define (build-path/f . a) + (string-append "file://" + (path->string (path->complete-path (apply build-path a))))) + +(define ht + (hash 'doc-dir (build-path/s "doc") + 'lib-dir (build-path/s "lib") + 'dll-dir (build-path/s "lib") + 'links-file (build-path/s "lib" "links.rktd") + 'pkgs-dir (build-path/s "lib" "pkgs") + 'bin-dir (build-path/s "bin") + 'include-dir (build-path/s "include") + 'catalogs (map build-path/f catalogs))) + +(make-directory* (build-path dir "etc")) + +(call-with-output-file* + (build-path dir "etc" "config.rktd") + #:exists 'truncate/replace + (lambda (o) + (write ht o) + (newline o))) + +(printf "Running `raco pkg install' for packages:\n") +(for ([pkg (in-list pkgs)]) + (printf " ~a\n" pkg)) +(unless (apply system* (find-exe) + "-G" "build/docs/etc" "-l-" + "raco" "pkg" "install" + "-i" "--deps" "search-auto" + pkgs) + (error "install failed")) +