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`.
This commit is contained in:
Matthew Flatt 2019-07-17 13:15:50 -06:00
parent 0801478e75
commit c397dba145

View File

@ -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))