# Opam: ERROR while compiling ssl.0.5.8

**URL:** <https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076>\
**Category:** Learning\
**Tags:** opam\
**Created:** [July 10, 2019, 1:40pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076 "2019-07-10T13:40:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luc\_ML](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/luc_ml/32/1671_2.png) [@Luc\_ML](https://discuss.ocaml.org/u/Luc_ML)\
**Post date:** [July 10, 2019, 1:40pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/1 "2019-07-10T13:40:36Z")

</div>

I’m a normal Opam user.  
Many packages require ssl. And I’m facing the following situation: ssl dependecies are installed but ssl can’t be compiled.

```
$ opam depext ssl
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=debian, os-family=debian
# The following system packages are needed:
libssl-dev
pkg-config
# All required OS packages found.

```

I get the following build error message:  
(same error with ocaml compiler 4.06.1 or 4.07.1 or 4.08.0/ Debian)

How should I understand the following error message and fix this?  
Is Opam able to fix that?  
Is there any usefull Opam reset?

I also tried to remove and install `libssl-dev pkg-config` packages but it didn’t fix the problem.  
I’m suspecting a version conflict (libssl1.0.0)

> The following packages have unmet dependencies:  
> libssl-dev : Depends: libssl1.0.0 (= 1.0.1t-1+deb8u11) but 1.0.2l-1~bpo8+1 is to be installed

```
$ opam install ssl

#=== ERROR while compiling ssl.0.5.8 ==========================================#
# context 2.0.2 | linux/x86_64 | ocaml-base-compiler.4.05.0 | https://opam.ocaml.org#7907cb7b
# path ~/.opam/4.05.0_ocsigen/.opam-switch/build/ssl.0.5.8
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ssl -j 1
# exit-code 1
# env-file ~/.opam/log/ssl-26961-d2c37b.env
# output-file ~/.opam/log/ssl-26961-d2c37b.out
### output ###
# ssl_stubs.c:1266:18: error: ‘X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS’ undeclared (first use in this function)
# [...]
# ^
# ssl_stubs.c:1269:18: error: ‘X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS’ undeclared (first use in this function)
# flags |= X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS;
# ^
# ssl_stubs.c:1278:3: warning: implicit declaration of function ‘SSL_set_hostflags’ [-Wimplicit-function-declaration]
# SSL_set_hostflags(ssl, flags);
# ^
# ssl_stubs.c: In function ‘ocaml_ssl_set1_host’:
# ssl_stubs.c:1291:3: warning: implicit declaration of function ‘SSL_set1_host’ [-Wimplicit-function-declaration]
# SSL_set1_host (ssl, hostname);
# ^

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ssl 0.5.8
└─ 
╶─ No changes have been performed

```

---

<div class="post-metadata">

**Author:** ![Luc\_ML](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/luc_ml/32/1671_2.png) [@Luc\_ML](https://discuss.ocaml.org/u/Luc_ML)\
**Post date:** [July 10, 2019, 2:27pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/2 "2019-07-10T14:27:44Z")

</div>

I could install ssl 0.5.7 then lwt\_ssl 1.1.2 :

`$ opam pin ssl 0.5.7`

But it created other problems for dependent packages.  
Anyway I must understand why ssl 0.5.8 can’t be compiled.

---

<div class="post-metadata">

**Author:** ![echowuhao](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/echowuhao/32/83_2.png) [@echowuhao](https://discuss.ocaml.org/u/echowuhao)\
**Post date:** [July 10, 2019, 3:37pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/3 "2019-07-10T15:37:27Z")

</div>

[http://forums.debian.net/viewtopic.php?t=131727](http://forums.debian.net/viewtopic.php?t=131727)

I think I had similar problem and solved it with random googling. not sure if this post that help, but one of the google result works. sorry for the bad memory.

---

<div class="post-metadata">

**Author:** ![Luc\_ML](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/luc_ml/32/1671_2.png) [@Luc\_ML](https://discuss.ocaml.org/u/Luc_ML)\
**Post date:** [July 10, 2019, 8:17pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/4 "2019-07-10T20:17:56Z")

</div>

ssl Opam package is widely used: [http://opam.ocaml.org/packages/ssl/](http://opam.ocaml.org/packages/ssl/)  
Let’s see who had the same problem.

---

<div class="post-metadata">

**Author:** ![mseri](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/mseri/32/91_2.png) [@mseri](https://discuss.ocaml.org/u/mseri)\
**Post date:** [July 10, 2019, 8:42pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/5 "2019-07-10T20:42:18Z")

</div>

On my mac I had to pin the old version as well, however the flags in the error require the oopenssl’s 1.0.2 API, I am not sure it is supported by libressl. Is this only happening in debian and old ubuntus?

---

<div class="post-metadata">

**Author:** ![Luc\_ML](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/luc_ml/32/1671_2.png) [@Luc\_ML](https://discuss.ocaml.org/u/Luc_ML)\
**Post date:** [July 10, 2019, 8:47pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/6 "2019-07-10T20:47:15Z")

</div>

> [@mseri](#):
>
> Is this only happening in debian and old ubuntus?

It happens in Debian 8/Jessie (not yet updated to 9…)  
No problem in Debian 9/Stretch.

---

<div class="post-metadata">

**Author:** ![antron](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/antron/32/62_2.png) [@antron](https://discuss.ocaml.org/u/antron)\
**Post date:** [July 11, 2019, 4:36am UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/7 "2019-07-11T04:36:22Z")

</div>

See also this issue in the ocaml-ssl repo:

> <https://github.com/savonet/ocaml-ssl/issues/52>

---

<div class="post-metadata">

**Author:** ![Luc\_ML](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/luc_ml/32/1671_2.png) [@Luc\_ML](https://discuss.ocaml.org/u/Luc_ML)\
**Post date:** [July 11, 2019, 7:43am UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/8 "2019-07-11T07:43:08Z")

</div>

I have:

```auto
$ openssl version
OpenSSL 1.0.1t 3 May 2016

```

while you have ([https://github.com/savonet/ocaml-ssl/issues/52#issuecomment-510247169](https://github.com/savonet/ocaml-ssl/issues/52#issuecomment-510247169))

```auto
$ openssl version
OpenSSL 1.0.2g 1 Mar 2016

```

I’m now using another Debian 9/Stretch machine which has no problem with ssl 0.5.8.  
Anyway, it’s high time to upgrade the OS of the Debian 8/Jessie machine.

I’m still interested to know if there is some workaround.

---

<div class="post-metadata">

**Author:** ![Vincent\_Balat](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/vincent_balat/32/2191_2.png) [@Vincent\_Balat](https://discuss.ocaml.org/u/Vincent_Balat)\
**Post date:** [July 11, 2019, 10:49am UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/9 "2019-07-11T10:49:09Z")

</div>

libssl interface changed recently. Ocsigen Server has been updated accordingly and released. The new version should appear in opam soon. In the meantime, pin ssl 0.5.7.

---

<div class="post-metadata">

**Author:** ![Luc\_ML](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/luc_ml/32/1671_2.png) [@Luc\_ML](https://discuss.ocaml.org/u/Luc_ML)\
**Post date:** [July 11, 2019, 1:19pm UTC](https://discuss.ocaml.org/t/opam-error-while-compiling-ssl-0-5-8/4076/10 "2019-07-11T13:19:30Z")

</div>

Thanks.  
As a side note about Opam (also for the Opam team):

For the author of a package who knows exactly how to correctly compile it at a certain moment, how is it possible to specify the opam file with the set of packages that works?  
i.e. add the command `opam pin ssl 0.5.7` or the state `pinned: "ssl.0.5.7"`

At least, what about alerting people of that situation from within an “Opam alert board” or in [discuss.ocaml.org](http://discuss.ocaml.org)?

In Opam, is it possible to specify that a package must be pinned to a certain version for some reason?  
It should be possible because an export of a switch shows at the end of the file:  
`pinned: "ssl.0.5.7"`

**EDIT** : studying Opam documentation, the answer is obvious.  
It’s as easy as adding to the opam file the following in the _depends_ section  
`"ssl" {= "0.5.7"}`

Are there some fields to say that:  
-it’s a fallback opam file and the reason  
-the date of the delivery

Of course, the author of the package should be informed of such a change in the external dependencies (here : libssl interface)  
So, is there any available mechanisms for monitoring any change in external dependencies of an Ocaml package?

PS: How much time does it take to publish a package on Opam?
