2{ stdenv, util, haskell-nix, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
7 project = haskell-nix.cabalProject' {
8 inherit compiler-nix-name;
9 src = testSrc "exe-only";
12 packages = project.hsPkgs;
16 inherit (project) plan-nix;
18 run = stdenv.mkDerivation {
19 name = "exe-only-test";
22 exe="${packages.exe-only.components.exes.exe-only}/bin/exe-only${stdenv.hostPlatform.extensions.executable}"
24 size=$(command stat --format '%s' "$exe")
25 printf "size of executable $exe is $size. \n" >& 2
27 # fixme: run on target platform when cross-compiled
28 printf "checking whether executable ran... " >& 2
29 cat ${haskellLib.check packages.exe-only.components.exes.exe-only}/test-stdout
31 # Aarch are statically linked and does not have ldd for these tests.
32 optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) (
33 if stdenv.hostPlatform.isMusl then ''
34 printf "checking that executable is statically linked... " >& 2
35 (ldd $exe 2>&1 || true) | grep -i "not a"
37 printf "checking that executable is dynamically linked to system libraries... " >& 2
38 '' + optionalString stdenv.isLinux ''
39 ldd $exe | grep libpthread
40 '' + optionalString stdenv.isDarwin ''
41 otool -L $exe |grep .dylib
47 meta.platforms = platforms.all;
50 # Used for debugging with nix repl
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list