From 61a1b20d23132639f556346d1a27436db506cc04 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 30 Jul 2018 23:25:33 +0200 Subject: [PATCH] doc: add darwin installCheckTarget example --- doc/platform-notes.xml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/platform-notes.xml b/doc/platform-notes.xml index b2c20c2d35c0..ea581421547d 100644 --- a/doc/platform-notes.xml +++ b/doc/platform-notes.xml @@ -29,6 +29,7 @@ } + On darwin libraries are linked using absolute paths, libraries are @@ -46,6 +47,37 @@ } + + + + Even if the libraries are linked using absolute paths and resolved via + their install_name correctly, tests can sometimes fail + to run binaries. This happens because the checkPhase + runs before the libraries are installed. + + + This can usually be solved by running the tests after the + installPhase or alternatively by using + DYLD_LIBRARY_PATH. More information about this variable + can be found in the dyld + 1 manpage. + + + dyld: Library not loaded: /nix/store/7hnmbscpayxzxrixrgxvvlifzlxdsdir-jq-1.5-lib/lib/libjq.1.dylib + Referenced from: /private/tmp/nix-build-jq-1.5.drv-0/jq-1.5/tests/../jq + Reason: image not found + ./tests/jqtest: line 5: 75779 Abort trap: 6 + + + stdenv.mkDerivation { + name = "libfoo-1.2.3"; + # ... + doInstallCheck = true; + installCheckTarget = "check"; + } + + + Some packages assume xcode is available and use xcrun