Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opam install ssl (0.5.5) error #34

Closed
bit-fu opened this issue Oct 18, 2017 · 9 comments
Closed

opam install ssl (0.5.5) error #34

bit-fu opened this issue Oct 18, 2017 · 9 comments
Assignees

Comments

@bit-fu
Copy link

bit-fu commented Oct 18, 2017

opam install ssl (0.5.5) returns an error on Darwin (macOS) that didn't happen with 0.5.4:

... CPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib
# configure: error: Cannot find libssl headers.

There is no “/usr/local/opt” in Darwin.

The same error occurs when I create “/usr/local/opt/openssl” and put symbolic links to existing openssl directories there.

Could it be that the “opam” file (new in 0.5.5) is faulty? The “opam” in the conf-openssl package looks different.

@toots
Copy link
Member

toots commented Oct 18, 2017

Ok, I see where this is coming from. Do you also have an error installing conf-openssl? You might need to opam reinstall conf-openssl. Thanks.

@bit-fu
Copy link
Author

bit-fu commented Oct 18, 2017 via email

@toots
Copy link
Member

toots commented Oct 18, 2017

My question was wether conf-openssl also installed with or without errors. The opam file there also reffers to /usr/local/opt:

build: [
  ["pkg-config" "openssl"] {os != "darwin" & os != "freebsd" & os != "openbsd" & os != "netbsd"}
  ["sh" "-exec" "PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig pkg-config openssl"] {os = "darwin"}
]

I wrote a detailed explanation of the situation in ocaml/opam-repository#10453

Let's start by the beginning then:

  • Which version of macOS are you using?
  • Did you install openssl through homebrew?
  • What do you get when you execute: brew info openssl

Thanks!

@bit-fu
Copy link
Author

bit-fu commented Oct 18, 2017 via email

@toots
Copy link
Member

toots commented Oct 18, 2017

The local opam file in ocaml-ssl is not being used. Your issues comes from the fact that openssl support in opam-packaged ssl is based on the homebrew version of openssl.

Previous versions were compiling/installing because of a bug in ocaml-ssl where it did not honor the given LDFLAGS config, resulting in improper linking against the wrong library.

pkg-config ssl is supposed to return nothing. It exits with error code 1 when ssl cannot be found. Here:

% pkg-config openssl
zsh: exit 1     pkg-config openssl
% PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig pkg-config openssl
(nothing)

I would like to properly address this but I'm gonna need a couple of input from you:

  • Are you sure that you are actually reinstalling the latest conf-openssl? This package was changed as recently as yesterday I think and I would hate to miss an issue there while fixing your issue. Try:
opam update
opam reinstall --verbose conf-openssl

Latest version should log:

[conf-openssl: sh] Command started
+ sh "-exec" "PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig pkg-config openssl" (CWD=/Volumes/Home/toots/.opam/4.04.0+32bit/build/conf-openssl.1)
- + PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
- + pkg-config openssl
∗  installed conf-openssl.1
  • Do you know the content of the MacPorts openssl package? Where does it ship openssl headers and shared objects?

Thanks!

@bit-fu
Copy link
Author

bit-fu commented Oct 18, 2017 via email

@toots
Copy link
Member

toots commented Oct 18, 2017

Excellent, thanks. I'll fix this ASAP.

@toots
Copy link
Member

toots commented Oct 19, 2017

Ok, I have pushed a fix. Could you try the following:

git clone --recursive https://github.com/savonet/ocaml-ssl.git
cd ocaml-ssl
opam pin add ssl .

You will need autoconf and automake. Looks like macport has ports for each of those.

If you can confirm with me that this works, I'll push the updates to the main opam repository.

@bit-fu
Copy link
Author

bit-fu commented Oct 19, 2017 via email

@toots toots closed this as completed Sep 14, 2018
erikmd added a commit to pfitaxel/learn-ocaml that referenced this issue Mar 6, 2022
erikmd added a commit to pfitaxel/learn-ocaml that referenced this issue Mar 6, 2022
erikmd added a commit to pfitaxel/learn-ocaml that referenced this issue Mar 6, 2022
erikmd added a commit to pfitaxel/learn-ocaml that referenced this issue Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants