2 # Here we try to figure out which qemu to use based on the host platform.
3 # This guess can be overridden by passing qemuSuffix
4 qemuByHostPlatform = hostPlatform:
5 # I'd prefer this was a dictionary lookup, with a fall through into abort,
6 # that would make this more readable I guess. I think there is some similar
7 # mapping somewhere in haskell.nix
8 if hostPlatform.isAarch32
10 else if hostPlatform.isAarch64
12 else abort "Don't know which QEMU to use for hostPlatform ${hostPlatform.config}. Please provide qemuSuffix";
18, qemuSuffix ? (qemuByHostPlatform hostPlatform)
29 # we want this to hold only for arm (32 and 64bit) for now.
30 isLinuxCross = buildPlatform != hostPlatform && hostPlatform.isLinux && (hostPlatform.isAarch32 || hostPlatform.isAarch64);
31 qemuIservWrapper = writeScriptBin "iserv-wrapper" ''
34 # Unset configure flags as configure should have run already
36 PORT=$((5000 + $RANDOM % 5000))
37 (>&2 echo "---> Starting remote-iserv on port $PORT")
38 ${qemu}/bin/qemu-${qemuSuffix} ${remote-iserv}/bin/remote-iserv tmp $PORT &
39 (>&2 echo "---| remote-iserv should have started on $PORT")
41 ${iserv-proxy}/bin/iserv-proxy $@ 127.0.0.1 "$PORT"
42 (>&2 echo "---> killing remote-iserve...")
45 configureFlags = lib.optional hostPlatform.isAarch32 "--disable-split-sections";
46 setupBuildFlags = map (opt: "--ghc-option=" + opt) ((lib.optionals isLinuxCross
47 [ "-fexternal-interpreter"
48 "-pgmi" "${qemuIservWrapper}/bin/iserv-wrapper"
50 # Required to work-around https://gitlab.haskell.org/ghc/ghc/issues/15275
51 ] ++ lib.optionals hostPlatform.isAarch64 ["-fPIC"]))
52 ++ lib.optionals hostPlatform.isAarch32 (map (opt: "--gcc-option=" + opt) [ "-fno-pic" "-fno-plt" ])
54 ++ lib.optionals hostPlatform.isAarch64 ["--gcc-option=-fPIC"];
55 qemuTestWrapper = writeScriptBin "test-wrapper" ''
58 ${qemu}/bin/qemu-${qemuSuffix} $@*
60 testWrapper = lib.optional isLinuxCross "${qemuTestWrapper}/bin/test-wrapper";
62 preCheck = lib.optionalString isLinuxCross ''
63 echo "================================================================="
64 echo "RUNNING TESTS for $name via qemu-${qemuSuffix}"
65 echo "================================================================="
66 echo "Copying extra test libraries"
67 for p in ${lib.concatStringsSep " " extra-test-libs}; do
68 find "$p" -iname '*.so*' -exec cp {} . \;
71 postCheck = lib.optionalString isLinuxCross ''
72 echo "================================================================="
73 echo "END RUNNING TESTS"
74 echo "================================================================="
77 enableShared = lib.mkDefault (!isLinuxCross);
79in { inherit preCheck postCheck configureFlags setupBuildFlags testWrapper enableShared; }
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