peti / hopenssl Goto Github PK
View Code? Open in Web Editor NEWHaskell FFI bindings to the OpenSSL library
Home Page: http://hackage.haskell.org/package/hopenssl
License: Other
Haskell FFI bindings to the OpenSSL library
Home Page: http://hackage.haskell.org/package/hopenssl
License: Other
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 :)
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/
@jneira pointed out the following issue in NixOS/cabal2nix#389 (comment):
Executing
hopenssl
tests withinMINGW64
[...] they all fail like this one:test\CheckHighLevelDigestAPI.hs:18 SHA256 expected: "41ef4bb0b23661e66301aac36066912dac037827b4ae63a7b1165a5aa93ed4eb" but got: "\"41ef4bb0b23661e66301aac36066912dac037827b4ae63a7b1165a5aa93ed4eb\""
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/
I'm currently trying to bump the openssl
default in nixpkgs to openssl_3
in NixOS/nixpkgs#150093, but the build fails like this: https://hydra.nixos.org/log/vzhzha4gh111mr1pc1majcal7hmpqdf0-hopenssl-2.2.4.drv
This isn't really an issue right now, because openssl_1_1
will be supported for another year or so.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.