From 1218b82bce915e2cde8820b13768ed00d7e84b53 Mon Sep 17 00:00:00 2001 From: Tobias Bergkvist Date: Tue, 19 Oct 2021 14:37:05 +0200 Subject: [PATCH] Move assertExecutable from makeCWrapper to makeBinaryWrapper to ensure that makeCWrapper is a pure function --- pkgs/build-support/setup-hooks/make-binary-wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/make-binary-wrapper.sh b/pkgs/build-support/setup-hooks/make-binary-wrapper.sh index c8a8aef36097..bb9b5f453d19 100644 --- a/pkgs/build-support/setup-hooks/make-binary-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-binary-wrapper.sh @@ -27,6 +27,7 @@ assertExecutable() { # To troubleshoot a binary wrapper after you compiled it, # use the `strings` command or open the binary file in a text editor. makeBinaryWrapper() { + assertExecutable "$1" makeDocumentedCWrapper "$1" "${@:3}" | gcc -Os -x c -o "$2" - } @@ -65,7 +66,6 @@ makeCWrapper() { local argv0 n params cmd main flagsBefore flags executable params length local uses_prefix uses_suffix uses_concat3 executable=$(escapeStringLiteral "$1") - assertExecutable "$1" params=("$@") length=${#params[*]} for ((n = 1; n < length; n += 1)); do