add configuration for a distribution name suffix

The suffix is intended for OS variants, such as "precise" for a Linux
variant that is build with Ubuntu 12.04 (Precise Pangolin).
This commit is contained in:
Matthew Flatt 2013-06-30 08:59:39 -06:00
parent dedd2f671a
commit c413c28e70
7 changed files with 62 additions and 23 deletions

View File

@ -186,6 +186,19 @@ in a configure file affects the clients, but it does not affect the
packages prepared by the server; only `PKGS' affects the server (and packages prepared by the server; only `PKGS' affects the server (and
the client's packages must be a subset of the server's packages). the client's packages must be a subset of the server's packages).
For each installer written to "build/installers", the installer's name
is
<dist-name>-<version>-<platform>-<dist-suffix>.<ext>
where <dist-name> defaults to "racket" (but can be set via
`DIST_NAME'), <platform> is from `(system-library-subpath #f)' but
normalizing the Windows results to "i386-win32" and "x86_63-win32",
-<dist-suffix> is omitted unless a `#:dist-suffix' string is specified
for the client in the farm configuration, and <ext> is
platform-specific: ".sh" for Unix, ".dmg" for Mac Os X, and ".exe" for
Windows.
Separate Server and Clients Separate Server and Clients
--------------------------- ---------------------------
@ -212,6 +225,10 @@ Roughly, the steps are
use a different directory name on installation, instead of use a different directory name on installation, instead of
"racket". "racket".
Add `DIST_SUFFIX="..."' to the `client' line to add a suffix
string for the installer's name, such as an identifier for a
particular variant of Linux.
In more detail: In more detail:
1a. Build "racket" on a server. 1a. Build "racket" on a server.
@ -274,6 +291,11 @@ In more detail:
the base name of the installer file for all platforms, provide the base name of the installer file for all platforms, provide
`DIST_DIR' to `make'. The default is "racket". `DIST_DIR' to `make'. The default is "racket".
To add an extra piece to the installer's name, such as an
identifier for a variant of Linux, provide `DIST_SUFFIX to
`make'. The default is "", which omits the prefix and its
preceding hyphen.
On each client, step 2b produces a "bundle/installer.txt" file that On each client, step 2b produces a "bundle/installer.txt" file that
contains the path to the generated installer, but the installer is contains the path to the generated installer, but the installer is
also uploaded to the server, which leaves the installer in a also uploaded to the server, which leaves the installer in a

View File

@ -85,6 +85,9 @@ RELEASE_MODE =
# generated installers: # generated installers:
DIST_NAME = Racket DIST_NAME = Racket
DIST_DIR = racket DIST_DIR = racket
# An extra suffix for the installer name, usually used to specify
# a variant of an OS
DIST_SUFFIX =
# Configuration of clients to run for a build farm: # Configuration of clients to run for a build farm:
FARM_CONFIG = build/farm-config.rktd FARM_CONFIG = build/farm-config.rktd
@ -235,7 +238,7 @@ client:
$(MAKE) bundle-from-server $(MAKE) bundle-from-server
$(MAKE) installer-from-bundle $(MAKE) installer-from-bundle
COPY_ARGS = SERVER=$(SERVER) PKGS="$(PKGS)" RELEASE_MODE=$(RELEASE_MODE) DIST_NAME="$(DIST_NAME)" DIST_DIR=$(DIST_DIR) COPY_ARGS = SERVER=$(SERVER) PKGS="$(PKGS)" RELEASE_MODE=$(RELEASE_MODE) DIST_NAME="$(DIST_NAME)" DIST_DIR=$(DIST_DIR) DIST_SUFFIX=$(DIST_SUFFIX)
win32-client: win32-client:
IF EXIST build\user cmd /c rmdir /S /Q build\user IF EXIST build\user cmd /c rmdir /S /Q build\user
@ -265,7 +268,7 @@ UPLOAD = --upload http://$(SERVER):9440/
# Create an installer from the build (with installed packages) that's # Create an installer from the build (with installed packages) that's
# in "bundle/racket": # in "bundle/racket":
installer-from-bundle: installer-from-bundle:
$(RACKET) -l- distro-build/installer $(UPLOAD) $(RELEASE_MODE) "$(DIST_NAME)" $(DIST_DIR) $(RACKET) -l- distro-build/installer $(UPLOAD) $(RELEASE_MODE) "$(DIST_NAME)" $(DIST_DIR) "$(DIST_SUFFIX)"
win32-distro-build-from-server: win32-distro-build-from-server:
$(WIN32_RACO) pkg install $(REMOTE_USER_AUTO) distro-build $(WIN32_RACO) pkg install $(REMOTE_USER_AUTO) distro-build
@ -284,7 +287,7 @@ win32-bundle-from-server:
bundle\racket\raco pkg install $(REMOTE_INST_AUTO) $(PKGS) bundle\racket\raco pkg install $(REMOTE_INST_AUTO) $(PKGS)
win32-installer-from-bundle: win32-installer-from-bundle:
$(WIN32_RACKET) -l- distro-build/installer $(UPLOAD) $(RELEASE_MODE) "$(DIST_NAME)" $(DIST_DIR) $(WIN32_RACKET) -l- distro-build/installer $(UPLOAD) $(RELEASE_MODE) "$(DIST_NAME)" $(DIST_DIR) "$(DIST_SUFFIX)"
# ------------------------------------------------------------ # ------------------------------------------------------------
# Drive installer build: # Drive installer build:

View File

@ -70,8 +70,10 @@
;; defaults to `server' command-line argument ;; defaults to `server' command-line argument
;; #:dist-name <string> --- the distribution name; defaults to the ;; #:dist-name <string> --- the distribution name; defaults to the
;; `dist-name' command-line argument ;; `dist-name' command-line argument
;; #:dist-dir <string> --- the distribution's installation directory; ;; #:dist-dir <string*> --- the distribution's installation directory;
;; defaults to `dist-dir' command-line argument ;; defaults to `dist-dir' command-line argument
;; #:dist-suffix <string*> --- a suffix for the installer's name, usually
;; used for an OS variant; defaults to ""
;; #:max-vm <real> --- max number of VMs allowed to run with this ;; #:max-vm <real> --- max number of VMs allowed to run with this
;; machine, counting the machine; defaults to 1 ;; machine, counting the machine; defaults to 1
;; #:port <integer> --- ssh port for the client; defaults to 22 ;; #:port <integer> --- ssh port for the client; defaults to 22
@ -135,6 +137,7 @@
[(#:pkgs) (and (list? val) (andmap simple-string? val))] [(#:pkgs) (and (list? val) (andmap simple-string? val))]
[(#:dist-name) (string? val)] [(#:dist-name) (string? val)]
[(#:dist-dir) (simple-string? val)] [(#:dist-dir) (simple-string? val)]
[(#:dist-suffix) (simple-string? val)]
[(#:max-vm) (real? val)] [(#:max-vm) (real? val)]
[(#:server) (simple-string? val)] [(#:server) (simple-string? val)]
[(#:host) (simple-string? val)] [(#:host) (simple-string? val)]
@ -353,15 +356,16 @@
(define (q s) (define (q s)
(~a "\"" s "\"")) (~a "\"" s "\""))
(define (client-args server pkgs dist-name dist-dir) (define (client-args server pkgs dist-name dist-dir dist-suffix)
(~a " SERVER=" server (~a " SERVER=" server
" PKGS=" (q pkgs) " PKGS=" (q pkgs)
" DIST_NAME=" (q dist-name) " DIST_NAME=" (q dist-name)
" DIST_DIR=" dist-dir " DIST_DIR=" dist-dir
" DIST_SUFFIX=" (q dist-suffix)
" RELEASE_MODE=" (if release? "--release" (q "")))) " RELEASE_MODE=" (if release? "--release" (q ""))))
(define (unix-build c host port user server repo clean? (define (unix-build c host port user server repo clean?
pkgs dist-name dist-dir) pkgs dist-name dist-dir dist-suffix)
(define dir (or (get-opt c '#:dir) (define dir (or (get-opt c '#:dir)
"build/plt")) "build/plt"))
(define (sh . args) (define (sh . args)
@ -378,12 +382,12 @@
"git pull") "git pull")
(sh "cd " (q dir) " ; " (sh "cd " (q dir) " ; "
"make -j " j " client" "make -j " j " client"
(client-args server pkgs dist-name dist-dir) (client-args server pkgs dist-name dist-dir dist-suffix)
" CORE_CONFIGURE_ARGS=" (q (apply ~a #:separator " " " CORE_CONFIGURE_ARGS=" (q (apply ~a #:separator " "
(get-opt c '#:configure null)))))) (get-opt c '#:configure null))))))
(define (windows-build c host port user server repo clean? (define (windows-build c host port user server repo clean?
pkgs dist-name dist-dir) pkgs dist-name dist-dir dist-suffix)
(define dir (or (get-opt c '#:dir) (define dir (or (get-opt c '#:dir)
"build\\plt")) "build\\plt"))
(define bits (or (get-opt c '#:bits) 64)) (define bits (or (get-opt c '#:bits) 64))
@ -403,7 +407,7 @@
(cmd "cd " (q dir) (cmd "cd " (q dir)
" && \"c:\\Program Files" (if (= bits 64) " (x86)" "") "\\Microsoft Visual Studio 9.0\\vc\\vcvarsall.bat\"" " && \"c:\\Program Files" (if (= bits 64) " (x86)" "") "\\Microsoft Visual Studio 9.0\\vc\\vcvarsall.bat\""
" " vc " " vc
" && nmake win32-client" (client-args server pkgs dist-name dist-dir)))) " && nmake win32-client" (client-args server pkgs dist-name dist-dir dist-suffix))))
(define (client-build c) (define (client-build c)
(define host (or (get-opt c '#:host) (define host (or (get-opt c '#:host)
@ -419,6 +423,7 @@
default-dist-name)) default-dist-name))
(define dist-dir (or (get-opt c '#:dist-dir) (define dist-dir (or (get-opt c '#:dist-dir)
default-dist-dir)) default-dist-dir))
(define dist-suffix (get-opt c '#:dist-suffix ""))
(define repo (or (get-opt c '#:repo) (define repo (or (get-opt c '#:repo)
(~a "http://" server ":9440/.git"))) (~a "http://" server ":9440/.git")))
(define clean? (let ([v (get-opt c '#:clean? 'none)]) (define clean? (let ([v (get-opt c '#:clean? 'none)])
@ -429,7 +434,7 @@
[(unix) unix-build] [(unix) unix-build]
[else windows-build]) [else windows-build])
c host port user server repo clean? c host port user server repo clean?
pkgs dist-name dist-dir)) pkgs dist-name dist-dir dist-suffix))
;; ---------------------------------------- ;; ----------------------------------------

View File

@ -108,7 +108,10 @@
(system*/show hdiutil "detach" mnt) (system*/show hdiutil "detach" mnt)
(delete-directory mnt)) (delete-directory mnt))
(define (installer-dmg human-name dir-name) (define (installer-dmg human-name dir-name dist-suffix)
(define dmg-name (format "bundle/~a-~a.dmg" dir-name (system-library-subpath #f))) (define dmg-name (format "bundle/~a-~a~a.dmg"
dir-name
(system-library-subpath #f)
dist-suffix))
(make-dmg human-name "bundle/racket" dmg-name bg-image) (make-dmg human-name "bundle/racket" dmg-name bg-image)
dmg-name) dmg-name)

View File

@ -397,14 +397,14 @@ SectionEnd
(parameterize ([current-directory "bundle"]) (parameterize ([current-directory "bundle"])
(system* makensis "/V3" "installer.nsi"))) (system* makensis "/V3" "installer.nsi")))
(define (installer-exe human-name dir-name release?) (define (installer-exe human-name dir-name release? dist-suffix)
(define makensis (or (find-executable-path "makensis.exe") (define makensis (or (find-executable-path "makensis.exe")
(try-exe "c:\\Program Files\\NSIS\\makensis.exe") (try-exe "c:\\Program Files\\NSIS\\makensis.exe")
(try-exe "c:\\Program Files (x86)\\NSIS\\makensis.exe") (try-exe "c:\\Program Files (x86)\\NSIS\\makensis.exe")
(error 'installer-exe "cannot find \"makensis.exe\""))) (error 'installer-exe "cannot find \"makensis.exe\"")))
(define platform (let-values ([(base name dir?) (split-path (system-library-subpath #f))]) (define platform (let-values ([(base name dir?) (split-path (system-library-subpath #f))])
(path->string name))) (path->string name)))
(define exe-path (format "bundle/~a-~a-win32.exe" dir-name platform)) (define exe-path (format "bundle/~a-~a-win32~a.exe" dir-name platform dist-suffix))
(nsis-generate exe-path (nsis-generate exe-path
human-name human-name
(version) (version)

View File

@ -69,8 +69,11 @@
(system/show "chmod" "+x" dest) (system/show "chmod" "+x" dest)
(delete-file tmp-tgz)) (delete-file tmp-tgz))
(define (installer-sh human-name dir-name release?) (define (installer-sh human-name dir-name release? dist-suffix)
(define sh-path (format "bundle/~a-~a.sh" dir-name (system-library-subpath #f))) (define sh-path (format "bundle/~a-~a~a.sh"
dir-name
(system-library-subpath #f)
dist-suffix))
(generate-installer-sh "bundle/racket" sh-path (generate-installer-sh "bundle/racket" sh-path
dir-name human-name dir-name human-name
release?) release?)

View File

@ -10,7 +10,7 @@
(define release? #f) (define release? #f)
(define upload-to #f) (define upload-to #f)
(define-values (short-human-name human-name dir-name) (define-values (short-human-name human-name dir-name dist-suffix)
(command-line (command-line
#:once-each #:once-each
[("--release") "Create a release installer" [("--release") "Create a release installer"
@ -18,18 +18,21 @@
[("--upload") url "Upload installer" [("--upload") url "Upload installer"
(set! upload-to url)] (set! upload-to url)]
#:args #:args
(human-name dir-name) (human-name dir-name dist-suffix)
(values human-name (values human-name
(format "~a v~a" human-name (version)) (format "~a v~a" human-name (version))
(if release? (if release?
dir-name dir-name
(format "~a-~a" dir-name (version)))))) (format "~a-~a" dir-name (version)))
(if (string=? dist-suffix "")
""
(string-append "-" dist-suffix)))))
(define installer-file (define installer-file
(case (system-type) (case (system-type)
[(unix) (installer-sh human-name dir-name release?)] [(unix) (installer-sh human-name dir-name release? dist-suffix)]
[(macosx) (installer-dmg human-name dir-name)] [(macosx) (installer-dmg human-name dir-name dist-suffix)]
[(windows) (installer-exe short-human-name dir-name release?)])) [(windows) (installer-exe short-human-name dir-name release? dist-suffix)]))
(call-with-output-file* (call-with-output-file*
(build-path "bundle" "installer.txt") (build-path "bundle" "installer.txt")