From 727cd1ca9f90fd5e54cb23a49aa673debb225540 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 7 Mar 2021 07:48:50 -0700 Subject: [PATCH] raco demod: report that it works only on BC Closes #3706 --- pkgs/compiler-lib/compiler/demodularizer/batch.rkt | 5 ++++- pkgs/racket-doc/scribblings/raco/demod.scrbl | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/compiler-lib/compiler/demodularizer/batch.rkt b/pkgs/compiler-lib/compiler/demodularizer/batch.rkt index 9d869b5481..464ba093c1 100644 --- a/pkgs/compiler-lib/compiler/demodularizer/batch.rkt +++ b/pkgs/compiler-lib/compiler/demodularizer/batch.rkt @@ -16,7 +16,10 @@ (garbage-collect-toplevels-enabled #t)] [("-r" "--recompile") "Recompile final module to re-run optimizations" (recompile-enabled #t)] - #:args (filename) + #:args (filename) + (unless (eq? 'racket (system-type 'vm)) + (raise-user-error (format "~a: supported only on Racket BC" + (short-program+command-name)))) (demodularize filename (output-file)))) (module test racket/base) diff --git a/pkgs/racket-doc/scribblings/raco/demod.scrbl b/pkgs/racket-doc/scribblings/raco/demod.scrbl index 0f82657449..6f18861bc4 100644 --- a/pkgs/racket-doc/scribblings/raco/demod.scrbl +++ b/pkgs/racket-doc/scribblings/raco/demod.scrbl @@ -3,10 +3,11 @@ @title[#:tag "demod"]{@exec{raco demod}: Demodularizing Programs} -The @exec{raco demod} command takes a Racket module and flattens -all of its dependencies into a single compiled module. -A file @filepath{@nonterm{name}.rkt} is demodularized into +The @exec{raco demod} command, which works only for Racket @tech[#:doc +guide-doc]{BC}, takes a Racket module and flattens all of its +dependencies into a single compiled module. A file +@filepath{@nonterm{name}.rkt} is demodularized into @filepath{@nonterm{name}_rkt_merged.zo}. -The demodularized zo file can be run by passing it as an argument to -the @exec{racket} command-line program. +The demodularized @filepath{.zo} file can be run by passing it as an +argument to the @exec{racket} command-line program.