Skip to content

Commit ab68554

Browse files
committed
Use static linking for android tests
1 parent 4ac5dfe commit ab68554

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

lib/check.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{ stdenv, lib, haskellLib, buildPackages }:
2-
let self = drv:
2+
let self = drvOrig:
33

44
let
5+
# Work around problem running dynamicially linked Android executables with qemu.
6+
drv = drvOrig.override (lib.optionalAttrs stdenv.hostPlatform.isAndroid { setupBuildFlags = ["--ghc-option=-optl-static" ]; });
7+
58
component = drv.config;
69

710
# This derivation can be used to execute test component.
@@ -65,4 +68,4 @@ in stdenv.mkDerivation ((
6568
}
6669
// lib.optionalAttrs (drv ? LOCALE_ARCHIVE) { inherit (drv) LOCALE_ARCHIVE; }
6770
);
68-
in self
71+
in self

overlays/linux-cross.nix

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,14 @@ let
6868
# Also for GHC #15275
6969
++ lib.optionals hostPlatform.isAarch64 ["--gcc-option=-fPIC"];
7070

71-
# Wrapper to output a warning for Android
72-
qemuNotSupportedWarning = writeShellScriptBin "warning-wrapper" ''
73-
echo "Warning: Running Android apps on Linux using qemu is not supported." >&2
74-
'';
75-
7671
# Wrapper for qemu testing
7772
qemuTestWrapper = writeShellScriptBin "test-wrapper" ''
7873
set -euo pipefail
7974
${qemu}/bin/qemu-${qemuSuffix} $@*
8075
'';
8176

8277
# Choose the appropriate test wrapper
83-
testWrapper = lib.optional isLinuxCross
84-
(if hostPlatform.isAndroid
85-
then "${qemuNotSupportedWarning}/bin/warning-wrapper"
86-
else "${qemuTestWrapper}/bin/test-wrapper");
78+
testWrapper = lib.optional isLinuxCross "${qemuTestWrapper}/bin/test-wrapper";
8779

8880
enableShared = lib.mkDefault (!isLinuxCross);
8981

0 commit comments

Comments
 (0)