From b9e4b5dbb1cb2aa34e6d5f3053a0396c03cedd3a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 3 Sep 2020 07:22:04 -0600 Subject: [PATCH] makefiles: enable ".boot" files in non-cross CS builds on Windows There's a trade-off between keeping the distribution sizes small and making ".boot" files available for convenient embedding, even though embedding is relatively rare. For Unix platforms, since you have to build from source to get a static library for embedding anyway, we'll leave out ".boot" files. For Mac OS, the distribution's "Racket" framework includes ".boot" files --- even though the framework is itself unused for a normal distribution build, since signing and notarization are handled by embedded the boot files in an executable, but the framework was kept for a kind of backward compatibility. For Windows, the Racket DLL can be used for embedding, so the ".boot" files would be the only missing piece; also, they were already included in a cross-built distribution. Update "Inside" to note that ".boot" files must be built on Unix and to clarify the location of ".boot" files on Mac OS. Closes #3377 --- .../scribblings/inside/cs-embedding.scrbl | 13 ++++++++----- racket/src/worksp/csbuild.rkt | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/racket-doc/scribblings/inside/cs-embedding.scrbl b/pkgs/racket-doc/scribblings/inside/cs-embedding.scrbl index 0ff8f82b3b..8a9f54c032 100644 --- a/pkgs/racket-doc/scribblings/inside/cs-embedding.scrbl +++ b/pkgs/racket-doc/scribblings/inside/cs-embedding.scrbl @@ -72,11 +72,14 @@ To embed Racket CS in a program, follow these steps: The @filepath{petite.boot}, @filepath{scheme.boot}, and @filepath{racket.boot} files are distributed with the Racket - software in the installation's @filepath{lib} directory. These files - can be combined into a single file---or even embedded into the - executable---as long as the @cpp{boot1_offset}, @cpp{boot2_offset}, - and @cpp{boot3_offset} fields of @cpp{racket_boot_arguments_t} are - set to identify the starting offset of each boot image in the file. + software in the installation's @filepath{lib} directory for Windows, + and they are distributed within the @filepath{Racket} framework on + Mac OS X; they must be @seclink["src-build"]{built} from source on Unix. + These files can be combined into a single file---or even + embedded into the executable---as long as the @cpp{boot1_offset}, + @cpp{boot2_offset}, and @cpp{boot3_offset} fields of + @cpp{racket_boot_arguments_t} are set to identify the starting + offset of each boot image in the file. See @secref["segment-ideas"] for advice on embedding files like @filepath{petite.boot} in an executable.} diff --git a/racket/src/worksp/csbuild.rkt b/racket/src/worksp/csbuild.rkt index f3de3fad38..a9c076c885 100644 --- a/racket/src/worksp/csbuild.rkt +++ b/racket/src/worksp/csbuild.rkt @@ -13,6 +13,7 @@ (define scheme-dir (build-path 'up "ChezScheme")) (define pull? #f) (define static-libs? #t) +(define install-boot? #t) ; currently always enabled (define machine (if (= 32 (system-type 'word)) "ti3nt" "ta6nt")) @@ -34,7 +35,7 @@ [("--extra-repos-base") url "Clone repos from ChezScheme/.git, etc." (unless (equal? url "") (set! extra-repos-base url))] - [("--disable-libs") "Disable installaton of non-embedded boot files" + [("--disable-libs") "Disable installaton of static libraries (currently ignored)" (set! static-libs? #f)] #:args clone-arg @@ -295,7 +296,7 @@ machine "machine") -(when static-libs? +(when install-boot? (bootstrap-racket! "../cs/c/add-terminator.rkt" "../build/petite-v.boot" "../../lib/petite.boot")