cc-wrapper: fix set -u errors

cc @Ericson2314
This commit is contained in:
Robin Gloster 2017-08-08 10:14:54 +02:00
parent 89af5d93e6
commit 67a41eafe9
No known key found for this signature in database
GPG key ID: 5E4C836C632C2882
2 changed files with 9 additions and 3 deletions

View file

@ -10,12 +10,13 @@ declare -a role_prefixes=()
if [[ -n "${NIX_CC_WRAPPER_@infixSalt@_TARGET_BUILD:-}" ]]; then
role_prefixes+=(_BUILD)
fi
if [[ -n "${NIX_CC_WRAPPER_@infixSalt@_TARGET_HOST:-}" ]]; then
role_prefixes+=('')
fi
if [[ -n "${NIX_CC_WRAPPER_@infixSalt@_TARGET_TARGET:-}" ]]; then
role_prefixes+=(_TARGET)
fi
# use this as default if no role is inferred
if [[ -n "${NIX_CC_WRAPPER_@infixSalt@_TARGET_HOST:-}" || ${#role_prefixes[@]} -eq 0 ]]; then
role_prefixes+=('')
fi
# For each role we serve, we accumulate the input parameters into our own
# cc-wrapper-derivation-specific environment variables.

View file

@ -20,6 +20,11 @@ fi
source @out@/nix-support/utils.sh
# make set -u happy if the outside environment is unset
# this should never happen, but does in an LLVM test
if [ -z "${NIX_STORE:-}" ]; then
NIX_STORE=/nix/store
fi
# Optionally filter out paths not refering to the store.
expandResponseParams "$@"