diff options
author | Robin Gloster <mail@glob.in> | 2017-08-08 10:14:54 +0200 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2017-08-08 10:15:34 +0200 |
commit | 67a41eafe9c92269c9f6788f5f54a4b0d282cb96 (patch) | |
tree | 6c187ad831f2293c9ff835398ff598c2fde42771 | |
parent | 89af5d93e63a35851f2f980c72ab61b2fc6110f0 (diff) | |
download | nixlib-67a41eafe9c92269c9f6788f5f54a4b0d282cb96.tar nixlib-67a41eafe9c92269c9f6788f5f54a4b0d282cb96.tar.gz nixlib-67a41eafe9c92269c9f6788f5f54a4b0d282cb96.tar.bz2 nixlib-67a41eafe9c92269c9f6788f5f54a4b0d282cb96.tar.lz nixlib-67a41eafe9c92269c9f6788f5f54a4b0d282cb96.tar.xz nixlib-67a41eafe9c92269c9f6788f5f54a4b0d282cb96.tar.zst nixlib-67a41eafe9c92269c9f6788f5f54a4b0d282cb96.zip |
cc-wrapper: fix set -u errors
cc @Ericson2314
-rw-r--r-- | pkgs/build-support/cc-wrapper/add-flags.sh | 7 | ||||
-rw-r--r-- | pkgs/build-support/cc-wrapper/ld-wrapper.sh | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/build-support/cc-wrapper/add-flags.sh b/pkgs/build-support/cc-wrapper/add-flags.sh index 3d01dba64766..7af2ae58f3a6 100644 --- a/pkgs/build-support/cc-wrapper/add-flags.sh +++ b/pkgs/build-support/cc-wrapper/add-flags.sh @@ -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. diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh index e47a6bfec860..afa7798e49fb 100644 --- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh @@ -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 "$@" |