summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/stdenv/stdenv.xml3
-rw-r--r--pkgs/build-support/setup-hooks/auto-patchelf.sh2
2 files changed, 4 insertions, 1 deletions
diff --git a/doc/stdenv/stdenv.xml b/doc/stdenv/stdenv.xml
index ee93f39318b82..818e6c5da00c2 100644
--- a/doc/stdenv/stdenv.xml
+++ b/doc/stdenv/stdenv.xml
@@ -2019,6 +2019,9 @@ addEnvHooks "$hostOffset" myBashFunction
        In certain situations you may want to run the main command (<command>autoPatchelf</command>) of the setup hook on a file or a set of directories instead of unconditionally patching all outputs. This can be done by setting the <varname>dontAutoPatchelf</varname> environment variable to a non-empty value.
       </para>
       <para>
+       By default <command>autoPatchelf</command> will fail as soon as any ELF file requires a dependency which cannot be resolved via the given build inputs. In some situations you might prefer to just leave missing dependencies unpatched and continue to patch the rest. This can be achieved by setting the <envar>autoPatchelfIgnoreMissingDeps</envar> environment variable to a non-empty value.
+      </para>
+      <para>
        The <command>autoPatchelf</command> command also recognizes a <parameter class="command">--no-recurse</parameter> command line flag, which prevents it from recursing into subdirectories.
       </para>
      </listitem>
diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh
index 72970623ed796..4f7c0c14304c9 100644
--- a/pkgs/build-support/setup-hooks/auto-patchelf.sh
+++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh
@@ -141,7 +141,7 @@ autoPatchelfFile() {
     # This makes sure the builder fails if we didn't find a dependency, because
     # the stdenv setup script is run with set -e. The actual error is emitted
     # earlier in the previous loop.
-    [ $depNotFound -eq 0 ]
+    [ $depNotFound -eq 0 -o -n "$autoPatchelfIgnoreMissingDeps" ]
 
     if [ -n "$rpath" ]; then
         echo "setting RPATH to: $rpath" >&2