summary refs log tree commit diff
path: root/pkgs/build-support/cc-wrapper/cc-wrapper.sh
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2017-09-26 14:05:00 -0400
committerGitHub <noreply@github.com>2017-09-26 14:05:00 -0400
commit87067dc471a1592f4933f283648eb52a99f096b5 (patch)
tree22d4cd75fa7ff727968edace375d876e5b703d8a /pkgs/build-support/cc-wrapper/cc-wrapper.sh
parent332dc7c719f805812eb5f33ab3e4670bb5b10d69 (diff)
parent0d3d2a01d20d88dde3696ead43c557c1f3043ee7 (diff)
downloadnixlib-87067dc471a1592f4933f283648eb52a99f096b5.tar
nixlib-87067dc471a1592f4933f283648eb52a99f096b5.tar.gz
nixlib-87067dc471a1592f4933f283648eb52a99f096b5.tar.bz2
nixlib-87067dc471a1592f4933f283648eb52a99f096b5.tar.lz
nixlib-87067dc471a1592f4933f283648eb52a99f096b5.tar.xz
nixlib-87067dc471a1592f4933f283648eb52a99f096b5.tar.zst
nixlib-87067dc471a1592f4933f283648eb52a99f096b5.zip
Merge pull request #29580 from obsidiansystems/stdenv-super-debug
stdenv: Provide a way for full `set -x` debugging
Diffstat (limited to 'pkgs/build-support/cc-wrapper/cc-wrapper.sh')
-rw-r--r--pkgs/build-support/cc-wrapper/cc-wrapper.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
index aacaf196f313..e6f5a5a9f7d8 100644
--- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
@@ -2,6 +2,10 @@
 set -eu -o pipefail
 shopt -s nullglob
 
+if (( "${NIX_DEBUG:-0}" >= 7 )); then
+    set -x
+fi
+
 path_backup="$PATH"
 
 # That @-vars are substituted separately from bash evaluation makes
@@ -161,7 +165,7 @@ if [ "$*" = -v ]; then
 fi
 
 # Optionally print debug info.
-if [ -n "${NIX_DEBUG:-}" ]; then
+if (( "${NIX_DEBUG:-0}" >= 1 )); then
     # Old bash workaround, see ld-wrapper for explanation.
     echo "extra flags before to @prog@:" >&2
     printf "  %q\n" ${extraBefore+"${extraBefore[@]}"}  >&2