Skip to content

Commit 76c82ae

Browse files
committed
Disable failing tests
1 parent 48e7311 commit 76c82ae

File tree

3 files changed

+55
-13
lines changed

3 files changed

+55
-13
lines changed

test/th-dlls/default.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ let
77
project = externalInterpreter: project' {
88
inherit compiler-nix-name evalPackages;
99
src = testSrc "th-dlls";
10+
# TODO figure out why TH breaks with pkgsStatic for `libsodium` and `HsOpenSSL`
11+
# `libsodium` fails with the unhandled ELF relocation(RelA) type 23
12+
# `HsOpenSSL` segfaults in ghcizm9zi12zi2zminplace_GHCiziObjLink_resolveObjs1_info
13+
cabalProjectLocal = lib.optionalString stdenv.hostPlatform.isStatic ''
14+
package th-dlls
15+
flags: -libsodium -openssl
16+
'';
1017
modules = import ../modules.nix ++ [({pkgs, ...}: lib.optionalAttrs externalInterpreter {
1118
packages.th-dlls.components.library.ghcOptions = [ "-fexternal-interpreter" ];
1219
# Static openssl seems to fail to load in iserv for musl

test/th-dlls/src/Lib.hs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE TemplateHaskell #-}
23
module Lib where
34

45
import Control.Monad.IO.Class (liftIO)
6+
import Language.Haskell.TH.Syntax (Exp(..), Lit(..))
7+
import Data.Text as T
8+
9+
#ifdef MIN_VERSION_HsOpenSSL
510
import OpenSSL (withOpenSSL)
611
import OpenSSL.BN (withBN)
12+
#endif
13+
14+
#ifdef MIN_VERSION_libsodium
715
import Libsodium (sodium_init)
8-
import Language.Haskell.TH.Syntax (Exp(..), Lit(..))
9-
import Data.Text as T
16+
#endif
17+
18+
#ifdef MIN_VERSION_double_conversion
1019
import Data.Double.Conversion.Text (toShortest)
20+
#endif
1121

22+
#ifdef MIN_VERSION_HsOpenSSL
1223
x = $(liftIO (withOpenSSL (withBN 0 (\_ -> return (LitE (IntegerL 0))))))
24+
#endif
25+
#ifdef MIN_VERSION_libsodium
1326
y = $(liftIO (sodium_init >> return (LitE (IntegerL 0))))
27+
#endif
28+
#ifdef MIN_VERSION_double_conversion
1429
z = $(liftIO (return (LitE (IntegerL (fromIntegral (T.length (toShortest 1.0)))))))
30+
#endif

test/th-dlls/th-dlls.cabal

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,37 @@ author: Hamish Mackenzie
66
maintainer: [email protected]
77
build-type: Simple
88

9+
flag libsodium
10+
description: Enable libsodium support
11+
default: True
12+
manual: True
13+
14+
flag openssl
15+
description: Enable OpenSSL support
16+
default: True
17+
manual: True
18+
19+
flag double-conversion
20+
description: Enable double-conversion support
21+
default: True
22+
manual: True
23+
924
library
10-
build-depends: base
11-
, HsOpenSSL
12-
, libsodium
13-
, template-haskell
14-
, text
15-
, double-conversion
16-
, unix-time
17-
, th-orphans
18-
, ghc-prim
19-
, math-functions
20-
, erf
25+
build-depends:
26+
base
27+
, template-haskell
28+
, text
29+
, unix-time
30+
, th-orphans
31+
, ghc-prim
32+
, math-functions
33+
, erf
34+
if flag(openssl)
35+
build-depends: HsOpenSSL
36+
if flag(libsodium)
37+
build-depends: libsodium
38+
if flag(double-conversion)
39+
build-depends: double-conversion
2140
exposed-modules: Lib
2241
hs-source-dirs: src
2342
default-language: Haskell2010

0 commit comments

Comments
 (0)