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
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
---------------------------
@ -212,6 +225,10 @@ Roughly, the steps are
use a different directory name on installation, instead of
"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:
1a. Build "racket" on a server.
@ -274,6 +291,11 @@ In more detail:
the base name of the installer file for all platforms, provide
`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
contains the path to the generated installer, but the installer is
also uploaded to the server, which leaves the installer in a

View File

@ -85,6 +85,9 @@ RELEASE_MODE =
# generated installers:
DIST_NAME = 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:
FARM_CONFIG = build/farm-config.rktd
@ -235,7 +238,7 @@ client:
$(MAKE) bundle-from-server
$(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:
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
# in "bundle/racket":
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_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)
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:

View File

@ -70,8 +70,10 @@
;; defaults to `server' command-line argument
;; #:dist-name <string> --- the distribution name; defaults to the
;; `dist-name' command-line argument
;; #:dist-dir <string> --- the distribution's installation directory;
;; defaults to `dist-dir' command-line argument
;; #:dist-dir <string*> --- the distribution's installation directory;
;; 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
;; machine, counting the machine; defaults to 1
;; #:port <integer> --- ssh port for the client; defaults to 22
@ -135,6 +137,7 @@
[(#:pkgs) (and (list? val) (andmap simple-string? val))]
[(#:dist-name) (string? val)]
[(#:dist-dir) (simple-string? val)]
[(#:dist-suffix) (simple-string? val)]
[(#:max-vm) (real? val)]
[(#:server) (simple-string? val)]
[(#:host) (simple-string? val)]
@ -353,15 +356,16 @@
(define (q 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
" PKGS=" (q pkgs)
" DIST_NAME=" (q dist-name)
" DIST_DIR=" dist-dir
" DIST_SUFFIX=" (q dist-suffix)
" RELEASE_MODE=" (if release? "--release" (q ""))))
(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)
"build/plt"))
(define (sh . args)
@ -378,12 +382,12 @@
"git pull")
(sh "cd " (q dir) " ; "
"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 " "
(get-opt c '#:configure null))))))
(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)
"build\\plt"))
(define bits (or (get-opt c '#:bits) 64))
@ -403,7 +407,7 @@
(cmd "cd " (q dir)
" && \"c:\\Program Files" (if (= bits 64) " (x86)" "") "\\Microsoft Visual Studio 9.0\\vc\\vcvarsall.bat\""
" " 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 host (or (get-opt c '#:host)
@ -419,6 +423,7 @@
default-dist-name))
(define dist-dir (or (get-opt c '#:dist-dir)
default-dist-dir))
(define dist-suffix (get-opt c '#:dist-suffix ""))
(define repo (or (get-opt c '#:repo)
(~a "http://" server ":9440/.git")))
(define clean? (let ([v (get-opt c '#:clean? 'none)])
@ -429,7 +434,7 @@
[(unix) unix-build]
[else windows-build])
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)
(delete-directory mnt))
(define (installer-dmg human-name dir-name)
(define dmg-name (format "bundle/~a-~a.dmg" dir-name (system-library-subpath #f)))
(define (installer-dmg human-name dir-name dist-suffix)
(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)
dmg-name)

View File

@ -397,14 +397,14 @@ SectionEnd
(parameterize ([current-directory "bundle"])
(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")
(try-exe "c:\\Program Files\\NSIS\\makensis.exe")
(try-exe "c:\\Program Files (x86)\\NSIS\\makensis.exe")
(error 'installer-exe "cannot find \"makensis.exe\"")))
(define platform (let-values ([(base name dir?) (split-path (system-library-subpath #f))])
(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
human-name
(version)

View File

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

View File

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