Failing to install HsOpenSSL

Hi!

I’m trying to install the HsOpenSSL package on hackage and ran into the error when executing cabal run

Error: setup: Can't find OpenSSL library.
Install it via 'brew install openssl' or 'port install openssl'.

If you already have OpenSSL installed, specify the location
of the installed library in cabal.project:

package HsOpenSSL
extra-include-dirs: ...
extra-lib-dirs: ...

or use

cabal configure --extra-include-dirs=... --extra-lib-dirs=...
Error: cabal: Failed to build HsOpenSSL-0.11.7.5 (which is required by
...

Failing that, I attempted to see where it’s located

𝝺 whereis openssl
openssl: /usr/bin/openssl /usr/share/man/man1/openssl.1

and then set the config

𝝺 cabal configure --extra-include-dirs="/usr/bin/openssl" --extra-lib-dirs="/usr/bin/openssl"

However, I am running into the same issue and out of ideas on how to resolve it. Any helpers here?

Try installing it via brew and pass -fhomebrew-openssl to cabal build.

Sadly that didn’t work either :frowning:. I get the same error. I’ve also tried adding


package HsOpenSSL
extra-lib-dirs: 
  - /opt/homebrew/Cellar/openssl@3/3.1.1/lib
extra-include-dirs:
  - /opt/homebrew/Cellar/openssl@3/3.1.1/lib

to cabal.project.local but that didn’t do anything.

This issue has been raised to Unable to build on Mac OS X with Brew · Issue #83 · haskell-cryptography/HsOpenSSL · GitHub and I suggest discussion continues there.

1 Like

Thanks, I raised it here too as I wasn’t certain if it’d gain any visibility there.

I have this fragment in my cabal.project.local when building my project that uses HsOpenSSL on my M1 mac

package HsOpenSSL
  flags: +homebrew-openssl
  extra-lib-dirs: /opt/homebrew/opt/openssl@3/lib
  extra-include-dirs: /opt/homebrew/opt/openssl@3/include
1 Like