From c397dba1450d5955e2347bdfe43e19500701dfa8 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 17 Jul 2019 13:15:50 -0600 Subject: [PATCH] cs: better build-time error if `lz4` isn't available Mainly for cross-compilation with a Windows target, the Racket CS build process may need to run `lz4` as an external program. In that case, complain when `lz4` isn't found, instead of letting `system*` complain about getting `#f`. --- racket/src/cs/c/adjust-compress.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/racket/src/cs/c/adjust-compress.rkt b/racket/src/cs/c/adjust-compress.rkt index 12281c8e3d..901c48d395 100644 --- a/racket/src/cs/c/adjust-compress.rkt +++ b/racket/src/cs/c/adjust-compress.rkt @@ -40,7 +40,9 @@ (define o (open-output-bytes)) (unless (parameterize ([current-input-port (open-input-bytes bstr)] [current-output-port o]) - (system* (find-executable-path "lz4") flag)) + (define lz4 (or (find-executable-path "lz4") + (error 'adjust-compress "could not find `lz4` executable, which is needed to adjust bootfile compression"))) + (system* lz4 flag)) (error "lz4 failed")) (get-output-bytes o))