summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2021-12-19 01:32:35 +0100
committerRaphael Megzari <raphael@megzari.com>2021-12-27 20:30:01 -0500
commitf2065d81ad9d25bbe581aef5c4c80845d7bb3041 (patch)
tree029b352507dee029ccc802af4ef1ad6e70a1ab77 /pkgs/stdenv
parent4aaf4c256b94f8789e116473e7f86201002ecf2f (diff)
downloadnixpkgs-f2065d81ad9d25bbe581aef5c4c80845d7bb3041.tar
nixpkgs-f2065d81ad9d25bbe581aef5c4c80845d7bb3041.tar.gz
nixpkgs-f2065d81ad9d25bbe581aef5c4c80845d7bb3041.tar.bz2
nixpkgs-f2065d81ad9d25bbe581aef5c4c80845d7bb3041.tar.lz
nixpkgs-f2065d81ad9d25bbe581aef5c4c80845d7bb3041.tar.xz
nixpkgs-f2065d81ad9d25bbe581aef5c4c80845d7bb3041.tar.zst
nixpkgs-f2065d81ad9d25bbe581aef5c4c80845d7bb3041.zip
stdenv/generic: introduce shellDryRun
Add `shellDryRun` to the generic stdenv and substitute it for uses of
`${stdenv.shell} -n`. The point of this layer of abstraction is to add
the flag `-O extglob`, which resolves #126344 in a more direct way.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 49ebc67f854..4fb98e5e801 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -112,7 +112,7 @@ let
       # are absolute unless we go out of our way to make them relative (like with CF)
       # TODO: This really wants to be in stdenv/darwin but we don't have hostPlatform
       # there (yet?) so it goes here until then.
-      preHook = preHook+ lib.optionalString buildPlatform.isDarwin ''
+      preHook = preHook + lib.optionalString buildPlatform.isDarwin ''
         export NIX_DONT_SET_RPATH_FOR_BUILD=1
       '' + lib.optionalString (hostPlatform.isDarwin || (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho)) ''
         export NIX_DONT_SET_RPATH=1
@@ -168,6 +168,11 @@ let
       inherit overrides;
 
       inherit cc hasCC;
+
+      # Convenience for doing some very basic shell syntax checking by parsing a script
+      # without running any commands. Because this will also skip `shopt -s extglob`
+      # commands and extglob affects the Bash parser, we enable extglob always.
+      shellDryRun = "${stdenv.shell} -n -O extglob";
     }
 
     # Propagate any extra attributes.  For instance, we use this to