Code Monkey home page Code Monkey logo

hopenssl's Introduction

hopenssl

hackage release stackage LTS package stackage Nightly package CI Status

hopenssl's People

Contributors

peti avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

alaendle

hopenssl's Issues

Cannot install on macOS

I'm building hopenssl as a dependency of stackage2nix, but it fails on macOS:

stack install hopenssl
hopenssl-2.2.1: configure

--  While building custom Setup.hs for package hopenssl-2.2.1 using:
      /private/var/folders/n2/6mwckcj147n_1mx9s7cxp3sc0000gn/T/stack2032/hopenssl-2.2.1/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-2.2.0.1 configure --with-ghc=/Users/fizruk/.stack/programs/x86_64-osx/ghc-8.4.3/bin/ghc --with-ghc-pkg=/Users/fizruk/.stack/programs/x86_64-osx/ghc-8.4.3/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/pkgdb --libdir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/lib --bindir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/bin --datadir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/share --libexecdir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/libexec --sysconfdir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/etc --docdir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/doc/hopenssl-2.2.1 --htmldir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/doc/hopenssl-2.2.1 --haddockdir=/Users/fizruk/.stack/snapshots/x86_64-osx/lts-12.4/8.4.3/doc/hopenssl-2.2.1 --dependency=Cabal=Cabal-2.2.0.1 --dependency=base=base-4.11.1.0 --dependency=bytestring=bytestring-0.10.8.2 --dependency=cabal-doctest=cabal-doctest-1.0.6-E57gwmEN5fa2uY0bq8bb44
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/fizruk/.stack/global-project/.stack-work/logs/hopenssl-2.2.1.log

    [1 of 2] Compiling Main             ( /private/var/folders/n2/6mwckcj147n_1mx9s7cxp3sc0000gn/T/stack2032/hopenssl-2.2.1/Setup.hs, /private/var/folders/n2/6mwckcj147n_1mx9s7cxp3sc0000gn/T/stack2032/hopenssl-2.2.1/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /Users/fizruk/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/n2/6mwckcj147n_1mx9s7cxp3sc0000gn/T/stack2032/hopenssl-2.2.1/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup/StackSetupShim.o )
    Linking /private/var/folders/n2/6mwckcj147n_1mx9s7cxp3sc0000gn/T/stack2032/hopenssl-2.2.1/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup/setup ...
    clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
    clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
    Configuring hopenssl-2.2.1...
    clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
    setup: Missing dependency on a foreign library:
    * Missing (or bad) header file: openssl/evp.h
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
    library file does exist, it may contain errors that are caught by the C
    compiler at the preprocessing stage. In this case you can re-run configure
    with the verbosity flag -v3 to see the error messages.
    If the header file does exist, it may contain errors that are caught by the C
    compiler at the preprocessing stage. In this case you can re-run configure
    with the verbosity flag -v3 to see the error messages.

I tried installing and reinstalling openssl:

brew install openssl

I tried exporting env vars as brew suggests:

# For compilers to find this software you may need to set:
export CPPFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib

# For pkg-config to find this software you may need to set:
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig

I tried to mention include and lib dirs via --ghc-options:

stack install hopenssl --ghc-options='--extra-include-dirs=/usr/local/opt/openssl/include --extra-lib-dirs=/usr/local/opt/openssl/lib'

But that does not work either. Perhaps I am doing something obvious wrong.
Would appreciate any help :)

Unable to build with OpenSSL 1.1.0e

System info:

`--[master]± openssl version 
OpenSSL 1.1.0e  16 Feb 2017
`--[master]± ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.1
`--[master]± cabal --version
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library 

Steps to reproduce:

`--[master]± cabal sandbox init
Writing a default package environment file to
/home/dbushev/projects/Aviora/hopenssl/cabal.sandbox.config
Creating a new sandbox at
/home/dbushev/projects/Aviora/hopenssl/.cabal-sandbox

`--[master]± cabal configure
Resolving dependencies...
Configuring hopenssl-2...

`--[master]± cabal --require-sandbox build
Building hopenssl-2...
Preprocessing library hopenssl-2...
In file included from dist/build/OpenSSL/EVP/Digest_hsc_make.c:1:0:
Digest.hsc: In function ‘main’:
Digest.hsc:99:15: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX {aka struct evp_md_ctx_st}’
/usr/lib/ghc-8.0.1/template-hsc.h:86:39: note: in definition of macro ‘hsc_size’
     hsc_printf("(%ld)", (long) sizeof(t));
                                       ^
In file included from /usr/include/sched.h:29:0,
                 from /usr/include/pthread.h:23,
                 from /usr/include/openssl/crypto.h:406,
                 from /usr/include/openssl/bio.h:20,
                 from /usr/include/openssl/evp.h:16,
                 from Digest.hsc:34:
/usr/lib/ghc-8.0.1/template-hsc.h:89:62: error: field ‘y__’ has incomplete type
     hsc_printf("(%ld)", (long) offsetof(struct {char x__; t (y__); }, y__));
                                                              ^
Digest.hsc:100:5: note: in expansion of macro ‘hsc_alignment’
compiling dist/build/OpenSSL/EVP/Digest_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/OpenSSL/EVP/Digest_hsc_make.c -o dist/build/OpenSSL/EVP/Digest_hsc_make.o -fno-stack-protector -fno-stack-protector -D__GLASGOW_HASKELL__=800 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/lib/ghc-8.0.1/bytestring-0.10.8.1/include -I/usr/lib/ghc-8.0.1/base-4.9.0.0/include -I/usr/lib/ghc-8.0.1/integer-gmp-1.0.0.1/include -I/usr/lib/ghc-8.0.1/include -I/usr/lib/libffi-3.2.1/include -I/usr/lib/ghc-8.0.1/include/

Test suite fails on Windows

@jneira pointed out the following issue in NixOS/cabal2nix#389 (comment):

Executing hopenssl tests within MINGW64 [...] they all fail like this one:

test\CheckHighLevelDigestAPI.hs:18
SHA256
expected: "41ef4bb0b23661e66301aac36066912dac037827b4ae63a7b1165a5aa93ed4eb"
 but got: "\"41ef4bb0b23661e66301aac36066912dac037827b4ae63a7b1165a5aa93ed4eb\""

Compile failure with GHC 7.4 / base-4.5

the .cabal file claims compatibility with

base >= 3 && < 5

but GHC 7.4 disagrees:

Configuring component lib from hopenssl-2...
Preprocessing library hopenssl-2...
[1 of 2] Compiling OpenSSL.EVP.Digest ( /tmp/matrix-worker/1494889293/dist-newstyle/build/x86_64-linux/ghc-7.4.2/hopenssl-2/build/OpenSSL/EVP/Digest.hs, /tmp/matrix-worker/1494889293/dist-newstyle/build/x86_64-linux/ghc-7.4.2/hopenssl-2/build/OpenSSL/EVP/Digest.o )
[2 of 2] Compiling OpenSSL.Digest   ( src/OpenSSL/Digest.hs, /tmp/matrix-worker/1494889293/dist-newstyle/build/x86_64-linux/ghc-7.4.2/hopenssl-2/build/OpenSSL/Digest.o )

src/OpenSSL/Digest.hs:142:39:
    No instance for (Functor ((,) (Ptr a)))
      arising from a use of `fmap'
    Possible fix:
      add an instance declaration for (Functor ((,) (Ptr a)))
    In the second argument of `(.)', namely
      `fmap (fromIntegral :: CUInt -> CSize)'
    In the expression:
      updateChunk ctx . fmap (fromIntegral :: CUInt -> CSize)
    In an equation for `updateChunk':
        updateChunk ctx
          = updateChunk ctx . fmap (fromIntegral :: CUInt -> CSize)

src/OpenSSL/Digest.hs:146:39:
    No instance for (Functor ((,) (Ptr a)))
      arising from a use of `fmap'
    Possible fix:
      add an instance declaration for (Functor ((,) (Ptr a)))
    In the second argument of `(.)', namely
      `fmap (fromIntegral :: CInt -> CSize)'
    In the expression:
      updateChunk ctx . fmap (fromIntegral :: CInt -> CSize)
    In an equation for `updateChunk':
        updateChunk ctx
          = updateChunk ctx . fmap (fromIntegral :: CInt -> CSize)

src/OpenSSL/Digest.hs:150:39:
    No instance for (Functor ((,) (Ptr a)))
      arising from a use of `fmap'
    Possible fix:
      add an instance declaration for (Functor ((,) (Ptr a)))
    In the second argument of `(.)', namely
      `fmap (fromIntegral :: Int -> CSize)'
    In the expression:
      updateChunk ctx . fmap (fromIntegral :: Int -> CSize)
    In an equation for `updateChunk':
        updateChunk ctx
          = updateChunk ctx . fmap (fromIntegral :: Int -> CSize)

IOW, the easiest fix is to set the lower bound to base >= 4.6 which I've already done at https://hackage.haskell.org/package/hopenssl-2/revisions/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.