Skip to content

Commit

Permalink
nix: add missing args to gcroots.sh script
Browse files Browse the repository at this point in the history
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 <jakub@status.im>
  • Loading branch information
jakubgs committed Aug 6, 2020
1 parent f904d7b commit 6872234
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nix/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions nix/scripts/gcroots.sh
Original file line number Diff line number Diff line change
@@ -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}"

Expand All @@ -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
Expand All @@ -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

0 comments on commit 6872234

Please sign in to comment.