From 68722340c96713a19dae1e10972c3c302d3c6a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 6 Aug 2020 14:08:36 +0200 Subject: [PATCH] nix: add missing args to gcroots.sh script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should fix the following error showing up on MacOS: ``` error: assertion ((__lessThan 0) ((builtins).stringLength watchmanSockPath)) failed at /Users/jenkins/repos/status-react/nix/mobile/android/watchman.nix:8:9 ``` Which was caused by flags like `--argstr` not being passed. Signed-off-by: Jakub SokoĊ‚owski --- nix/scripts/build.sh | 2 +- nix/scripts/gcroots.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nix/scripts/build.sh b/nix/scripts/build.sh index 3e69861216..a3fe8d7bab 100755 --- a/nix/scripts/build.sh +++ b/nix/scripts/build.sh @@ -55,7 +55,7 @@ nixOpts=( ) # Save derivation from being garbage collected -${GIT_ROOT}/nix/scripts/gcroots.sh "${TARGET}" +${GIT_ROOT}/nix/scripts/gcroots.sh "${TARGET}" "${@}" # Run the actual build echo "Running: nix-build "${nixOpts[@]}" "${@}" default.nix" diff --git a/nix/scripts/gcroots.sh b/nix/scripts/gcroots.sh index 4f3bf5d63f..7470423cb2 100755 --- a/nix/scripts/gcroots.sh +++ b/nix/scripts/gcroots.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -Eeu +set -Ee _NIX_GCROOTS="${_NIX_GCROOTS:-/nix/var/nix/gcroots/per-user/${USER}/status-react}" @@ -9,6 +9,7 @@ source "${GIT_ROOT}/nix/scripts/source.sh" source "${GIT_ROOT}/scripts/colors.sh" TARGET="${1}" +shift if [[ -z "${TARGET}" ]]; then echo -e "${RED}No target specified for gcroots.sh!${RST}" >&2 exit 1 @@ -18,4 +19,4 @@ fi # This prevents it from being removed by 'gc-collect-garbage'. nix-instantiate --attr "${TARGET}" \ --add-root "${_NIX_GCROOTS}/${TARGET}" \ - "${GIT_ROOT}/default.nix" >/dev/null + "${@}" "${GIT_ROOT}/default.nix" >/dev/null