From 7cdf9f1c0b63899e2f3d215668438603ddf9cc83 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 25 Nov 2018 10:31:09 -0700 Subject: [PATCH] raco setup: remove `-M`/`--compile-any` This commit mostly reverts 9441f7075f, because it looks like relying on `racket`-level configuration is the right idea after all. --- INSTALL.txt | 6 ++--- Makefile | 26 ++++++++++---------- pkgs/racket-doc/pkg/scribblings/pkg.scrbl | 5 ---- pkgs/racket-doc/scribblings/raco/setup.scrbl | 5 ---- racket/collects/pkg/main.rkt | 14 +++++------ racket/collects/setup/main.rkt | 4 --- racket/collects/setup/option.rkt | 4 --- racket/collects/setup/setup-cmdline.rkt | 5 ---- racket/collects/setup/setup-go.rkt | 2 -- racket/collects/setup/setup.rkt | 5 ---- racket/src/Makefile.in | 2 +- 11 files changed, 23 insertions(+), 55 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index 800ca8d1db..3b79e2786e 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -243,9 +243,9 @@ cross-compilation mode is used and that any foreign libraries needed for build time can be found, but many cross-compilation scenarios work without `-C`. -Specify `SETUP_MACHINE_FLAGS=...` to set flags for `raco setup` and -`raco pkg install` that control the target machine of compiled -bytecode. For example `SETUP_MACHINE_FLAGS=-M` causes the generated +Specify `SETUP_MACHINE_FLAGS=...` to set Racket flags that control the +target machine of compiled bytecode for `raco setup` and `raco pkg +install`. For example `SETUP_MACHINE_FLAGS=-M` causes the generated bytecode to be machine-independent, which is mainly useful when the generated installation will be used as a template for other platforms. diff --git a/Makefile b/Makefile index 2d711a2034..b21d8dd503 100644 --- a/Makefile +++ b/Makefile @@ -29,9 +29,12 @@ PKGS = main-distribution main-distribution-test PLAIN_RACKET = racket/bin/racket WIN32_PLAIN_RACKET = racket\racket +# For -M, etc., to pick the target machine for compilation: +SETUP_MACHINE_FLAGS = + # In case of cross-installation, point explicitly to local content: -RUN_RACKET = $(PLAIN_RACKET) -G racket/etc -X racket/collects -WIN32_RUN_RACKET = $(WIN32_PLAIN_RACKET) -G racket/etc -X racket/collects +RUN_RACKET = $(PLAIN_RACKET) $(SETUP_MACHINE_FLAGS) -G racket/etc -X racket/collects +WIN32_RUN_RACKET = $(WIN32_PLAIN_RACKET) $(SETUP_MACHINE_FLAGS) -G racket/etc -X racket/collects RUN_RACO = $(RUN_RACKET) -N raco -l- raco WIN32_RUN_RACO = $(WIN32_RUN_RACKET) -N raco -l- raco @@ -52,19 +55,16 @@ in-place: cpus-in-place: $(MAKE) -j $(CPUS) plain-in-place JOB_OPTIONS="-j $(CPUS)" PKGS="$(PKGS)" -# For -M, etc., to pick the target machine for compilation: -SETUP_MACHINE_FLAGS = - # Explicitly propagate variables for non-GNU `make's: LIBSETUP = -N raco -l- raco setup # Update before install to avoid needless work on the initial build, # and use `--no-setup` plus an explicit `raco setup` for the same reason. -UPDATE_PKGS_ARGS = --all --auto --no-setup --scope installation $(SETUP_MACHINE_FLAGS) -INSTALL_PKGS_ARGS = $(JOB_OPTIONS) $(SETUP_MACHINE_FLAGS) --no-setup --pkgs \ +UPDATE_PKGS_ARGS = --all --auto --no-setup --scope installation +INSTALL_PKGS_ARGS = $(JOB_OPTIONS) --no-setup --pkgs \ --skip-installed --scope installation --deps search-auto \ $(REQUIRED_PKGS) $(PKGS) -ALL_PLT_SETUP_OPTIONS = $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS) $(SETUP_MACHINE_FLAGS) +ALL_PLT_SETUP_OPTIONS = $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS) plain-in-place: $(MAKE) plain-minimal-in-place @@ -177,8 +177,8 @@ MORE_CONFIGURE_ARGS = SELF_UP = SELF_FLAGS_qq = SELF_RACKET_FLAGS="-G `cd $(SELF_UP)../../../build/config; pwd`" -PLT_SETUP_OPTIONS_qq = PLT_SETUP_OPTIONS="$(JOB_OPTIONS) $(PLT_SETUP_OPTIONS) $(SETUP_MACHINE_FLAGS)" -INSTALL_SETUP_ARGS = $(SELF_FLAGS_qq) $(PLT_SETUP_OPTIONS_qq) +PLT_SETUP_OPTIONS_qq = PLT_SETUP_OPTIONS="$(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)" +INSTALL_SETUP_ARGS = $(SELF_FLAGS_qq) $(PLT_SETUP_OPTIONS_qq) SETUP_MACHINE_FLAGS="$(SETUP_MACHINE_FLAGS)" BASE_INSTALL_TARGET = plain-base-install @@ -542,14 +542,14 @@ SVR_PRT = $(SERVER):$(SERVER_PORT) SVR_CAT = http://$(SVR_PRT)/$(SERVER_CATALOG_PATH) # Helper macros: -USER_CONFIG = -G build/user/config -X racket/collects -A build/user +USER_CONFIG = -G build/user/config -X racket/collects -A build/user $(SETUP_MACHINE_FLAGS) USER_RACKET = $(PLAIN_RACKET) $(USER_CONFIG) USER_RACO = $(PLAIN_RACKET) $(USER_CONFIG) -N raco -l- raco WIN32_RACKET = $(WIN32_PLAIN_RACKET) $(USER_CONFIG) WIN32_RACO = $(WIN32_PLAIN_RACKET) $(USER_CONFIG) -N raco -l- raco X_AUTO_OPTIONS = --skip-installed --deps search-auto --pkgs $(JOB_OPTIONS) USER_AUTO_OPTIONS = --scope user $(X_AUTO_OPTIONS) -SOURCE_USER_AUTO_q = --catalog build/catalog-copy $(USER_AUTO_OPTIONS) $(SETUP_MACHINE_FLAGS) +SOURCE_USER_AUTO_q = --catalog build/catalog-copy $(USER_AUTO_OPTIONS) REMOTE_USER_AUTO = --catalog $(SVR_CAT) $(USER_AUTO_OPTIONS) REMOTE_INST_AUTO = --catalog $(SVR_CAT) --scope installation $(X_AUTO_OPTIONS) CONFIG_MODE_q = "$(CONFIG)" "$(CONFIG_MODE)" @@ -626,7 +626,7 @@ build-from-catalog: $(MAKE) set-server-config $(USER_RACKET) -l- distro-build/pkg-info -o build/pkgs.rktd build/catalog-copy $(USER_RACKET) -l distro-build/install-pkgs $(CONFIG_MODE_q) "$(PKGS) $(TEST_PKGS)" $(SOURCE_USER_AUTO_q) --all-platforms - $(USER_RACO) setup $(SETUP_MACHINE_FLAGS) --avoid-main $(JOB_OPTIONS) + $(USER_RACO) setup --avoid-main $(JOB_OPTIONS) server-cache-config: $(USER_RACO) pkg config -i --set download-cache-dir build/cache diff --git a/pkgs/racket-doc/pkg/scribblings/pkg.scrbl b/pkgs/racket-doc/pkg/scribblings/pkg.scrbl index c597cb7189..01b85affd7 100644 --- a/pkgs/racket-doc/pkg/scribblings/pkg.scrbl +++ b/pkgs/racket-doc/pkg/scribblings/pkg.scrbl @@ -613,8 +613,6 @@ sub-commands. @item{@DFlag{dry-run} --- Prevents changes to the current installation. All installation and update work is staged and checked, but the final installation step is skipped.} - @item{@DFlag{compile-any} or @Flag{M} --- Compiles bytecode to a machine-independent form.} - @item{@DFlag{no-setup} --- Does not run @exec{raco setup} after installation. This behavior is also the case if the environment variable @envvar{PLT_PKG_NOSETUP} is set to any non-empty value.} @@ -747,7 +745,6 @@ the given @nonterm{pkg-source}s. @item{@DFlag{pull} @nonterm{mode} --- Same as for @command-ref{install}} @item{@DFlag{dry-run} --- Same as for @command-ref{install}.} - @item{@DFlag{compile-any} or @Flag{M} --- Same as for @command-ref{install}.} @item{@DFlag{no-setup} --- Same as for @command-ref{install}.} @item{@DFlag{jobs} @nonterm{n} or @Flag{j} @nonterm{n} --- Same as for @command-ref{install}.} @item{@DFlag{batch} --- Same as for @command-ref{install}.} @@ -789,7 +786,6 @@ the given @nonterm{pkg}s. @item{@Flag{u} or @DFlag{user} --- Shorthand for @exec{--scope user}.} @item{@DFlag{scope-dir} @nonterm{dir} --- Selects @nonterm{dir} as the @tech{package scope}, the same as for @command-ref{install}.} @item{@DFlag{dry-run} --- Same as for @command-ref{install}.} - @item{@DFlag{compile-any} or @Flag{M} --- Same as for @command-ref{install}.} @item{@DFlag{no-setup} --- Same as for @command-ref{install}.} @item{@DFlag{jobs} @nonterm{n} or @Flag{j} @nonterm{n} --- Same as for @command-ref{install}.} @item{@DFlag{batch} --- Same as for @command-ref{install}.} @@ -881,7 +877,6 @@ package is created. @item{@DFlag{strict-doc-conflicts} --- Same as for @command-ref{install}.} @item{@DFlag{no-cache} --- Same as for @command-ref{install}.} @item{@DFlag{dry-run} --- Same as for @command-ref{install}.} - @item{@DFlag{compile-any} or @Flag{M} --- Same as for @command-ref{install}.} @item{@DFlag{no-setup} --- Same as for @command-ref{install}.} @item{@DFlag{jobs} @nonterm{n} or @Flag{j} @nonterm{n} --- Same as for @command-ref{install}.} ] diff --git a/pkgs/racket-doc/scribblings/raco/setup.scrbl b/pkgs/racket-doc/scribblings/raco/setup.scrbl index 1fa47df6d5..6380d2e242 100644 --- a/pkgs/racket-doc/scribblings/raco/setup.scrbl +++ b/pkgs/racket-doc/scribblings/raco/setup.scrbl @@ -236,11 +236,6 @@ flags: content as the main installation.} ]} -@item{Selecting the target machine: -@itemize[ - @item{@DFlag{compile-any} or @Flag{M} --- compile bytecode to a - machine-independent form.} -]} @item{Selecting parallelism and other build modes: @itemize[ diff --git a/racket/collects/pkg/main.rkt b/racket/collects/pkg/main.rkt index a31e9eb045..965f9a46d8 100644 --- a/racket/collects/pkg/main.rkt +++ b/racket/collects/pkg/main.rkt @@ -14,7 +14,7 @@ (for-syntax racket/base syntax/strip-context)) -(define (setup what no-setup? compile-any? fail-fast? setup-collects jobs) +(define (setup what no-setup? fail-fast? setup-collects jobs) (unless (or (eq? setup-collects 'skip) no-setup? (not (member (getenv "PLT_PKG_NOSETUP") '(#f "")))) @@ -28,7 +28,6 @@ setup-collects)) #:tidy? #t #:make-doc-index? #t - #:compile-any? compile-any? #:jobs jobs #:fail-fast? fail-fast?) ((current-pkg-error) @@ -254,7 +253,7 @@ (pkg-desc p a-type* name checksum #f #:path (and (eq? a-type* 'clone) (path->complete-path clone)))))))) - (setup "installed" no-setup compile-any fail-fast setup-collects jobs))))] + (setup "installed" no-setup fail-fast setup-collects jobs))))] ;; ---------------------------------------- [update "Update packages" @@ -358,7 +357,7 @@ #:infer-clone-from-dir? (not (or link static-link copy)) #:dry-run? dry-run #:use-trash? (not no-trash))))) - (setup "updated" no-setup compile-any #f setup-collects jobs))))] + (setup "updated" no-setup #f setup-collects jobs))))] ;; ---------------------------------------- [remove "Remove packages" @@ -386,7 +385,7 @@ #:force? force #:dry-run? dry-run #:use-trash? (not no-trash)))) - (setup "removed" no-setup compile-any #f setup-collects jobs)))] + (setup "removed" no-setup #f setup-collects jobs)))] ;; ---------------------------------------- [new "Populate a new directory with the stubs of a package" @@ -485,7 +484,7 @@ (and binary-lib 'binary-lib)) #:force-strip? force #:dry-run? dry-run)))) - (setup "migrated" no-setup compile-any #f setup-collects jobs)))] + (setup "migrated" no-setup #f setup-collects jobs)))] ;; ---------------------------------------- [create "Bundle package from a directory or installed package" @@ -675,8 +674,7 @@ #:dry-run-flags ([#:bool dry-run () ("Don't actually change package installation")]) #:job-flags - ([#:bool compile-any ("-M") ("Compile to machine-independent form")] - [#:bool no-setup () ("Don't `raco setup' after changing packages (usually a bad idea)")] + ([#:bool no-setup () ("Don't `raco setup' after changing packages (usually a bad idea)")] [(#:num n #f) jobs ("-j") "Setup with parallel jobs"] [#:bool batch () ("Disable interactive mode and all prompts")]) #:trash-flags diff --git a/racket/collects/setup/main.rkt b/racket/collects/setup/main.rkt index 7bf9543f7a..45bd98e031 100644 --- a/racket/collects/setup/main.rkt +++ b/racket/collects/setup/main.rkt @@ -310,10 +310,6 @@ (if (on? "--trust-zos") (trust-zos #t) (void)) - (if (or (on? "-M") - (on? "--compile-any")) - (current-compile-target-machine #f) - (void)) (current-load/use-compiled (mk)))) ;; This has to be dynamic, so we get a chance to turn off diff --git a/racket/collects/setup/option.rkt b/racket/collects/setup/option.rkt index 32a3150389..0d93dba90a 100644 --- a/racket/collects/setup/option.rkt +++ b/racket/collects/setup/option.rkt @@ -89,10 +89,6 @@ (define-flag-param doc-pdf-dest #f) (define-flag-param fail-fast #f) -(defined-flag-params (cons (cons 'current-compile-target-machine - current-compile-target-machine) - (defined-flag-params))) - (define specific-collections (make-parameter null)) (define specific-packages (make-parameter null)) (define specific-planet-dirs (make-parameter null)) diff --git a/racket/collects/setup/setup-cmdline.rkt b/racket/collects/setup/setup-cmdline.rkt index 20bce15955..f66ad6b559 100644 --- a/racket/collects/setup/setup-cmdline.rkt +++ b/racket/collects/setup/setup-cmdline.rkt @@ -126,11 +126,6 @@ [("--force-user-docs") "User-specific documentation even if matching installation" (add-flags '((force-user-docs #t)))] #:help-labels - " -------------------------- target machine ------------------------- " - #:once-each - [("-M" "--compile-any") "Compile to machine-independent form" - (add-flags `((current-compile-target-machine #f)))] - #:help-labels " ------------------------------ modes ------------------------------ " #:once-each [("-j" "--jobs" "--workers") n "Use parallel jobs" diff --git a/racket/collects/setup/setup-go.rkt b/racket/collects/setup/setup-go.rkt index b690e219fa..580057dfa6 100644 --- a/racket/collects/setup/setup-go.rkt +++ b/racket/collects/setup/setup-go.rkt @@ -31,8 +31,6 @@ (current-target-plt-directory-getter))] [trust-existing-zos (or (has-x-flag? 'trust-existing-zos) (trust-existing-zos))] - [current-compile-target-machine (get-x-flag 'current-compile-target-machine - (current-compile-target-machine))] [specific-collections x-specific-collections] [specific-packages x-specific-packages] [archives x-archives] diff --git a/racket/collects/setup/setup.rkt b/racket/collects/setup/setup.rkt index 84d3f6ab7c..3aa4df8aa3 100644 --- a/racket/collects/setup/setup.rkt +++ b/racket/collects/setup/setup.rkt @@ -18,7 +18,6 @@ #:tidy? [tidy? #f] #:avoid-main? [avoid-main? #f] #:force-user-docs? [force-user-docs? #f] - #:compile-any? [compile-any? #f] #:jobs [parallel #f] #:fail-fast? [fail-fast? #f]) (parameterize @@ -51,10 +50,6 @@ [force-user-docs (if force-user-docs? #t (force-user-docs))] - [current-compile-target-machine (if compile-any? - #f - (current-compile-target-machine))] - [fail-fast fail-fast?] [clean (if clean? #t (clean))] diff --git a/racket/src/Makefile.in b/racket/src/Makefile.in index d3f63e8f9e..a4a50bf6d2 100644 --- a/racket/src/Makefile.in +++ b/racket/src/Makefile.in @@ -106,7 +106,7 @@ local/Makefile: # Install (common) ---------------------------------------- INST_CONFIG = -X @DIRCVTPRE@"$(DESTDIR)$(collectsdir)"@DIRCVTPOST@ -G @DIRCVTPRE@"$(DESTDIR)$(configdir)"@DIRCVTPOST@ -SETUP_RACKET_FLAGS = $(INST_CONFIG) $(COMPILE_MACHINE_FLAGS) $(SELF_RACKET_FLAGS) @INSTALL_SETUP_RACKET_FLAGS@ +SETUP_RACKET_FLAGS = $(INST_CONFIG) $(SETUP_MACHINE_FLAGS) $(SELF_RACKET_FLAGS) @INSTALL_SETUP_RACKET_FLAGS@ SETUP_SETUP_FLAGS = @INSTALL_SETUP_FLAGS@ $(PLT_SETUP_OPTIONS) $(PLT_ISO) SETUP_ARGS = $(SETUP_RACKET_FLAGS) -N "raco" -l- setup $(SETUP_SETUP_FLAGS)