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

Bug: learn-ocaml-client 0.14.0 can't build on win10 wsl2 debian due to ssl 0.5.10 build fails #498

Closed
ghost opened this issue Sep 23, 2022 · 3 comments · Fixed by #499, #486 or ocaml/opam-repository#22877
Assignees

Comments

@ghost
Copy link

ghost commented Sep 23, 2022

Related project scope(s):
learn-ocaml-client.0.14.0, ssl.0.5.10

Bug description

ssl.0.5.10 won't build on wsl2 debian win10, thus cause learn-ocaml-client.0.14.0 fails to install.

ty@sf10up:~$ opam install utop learn-ocaml-client
[NOTE] Package utop is already installed (current version is 2.9.2).
The following actions will be performed:
  ↘ downgrade ssl                0.5.12 to 0.5.10 [required by learn-ocaml-client]
  ∗ install   lwt_ssl            1.1.3            [required by learn-ocaml-client]
  ∗ install   conduit-lwt-unix   1.3.0            [required by cohttp-lwt-unix]
  ∗ install   cohttp-lwt-unix    4.0.0            [required by learn-ocaml-client]
  ∗ install   learn-ocaml-client 0.14.0
===== ∗ 4   ↘ 1 =====
Do you want to continue? [Y/n] Y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved cohttp-lwt-unix.4.0.0  (cached)
⬇ retrieved conduit-lwt-unix.1.3.0  (cached)
⬇ retrieved lwt_ssl.1.1.3  (cached)
⬇ retrieved learn-ocaml-client.0.14.0  (cached)
⬇ retrieved ssl.0.5.10  (cached)
[ERROR] The compilation of ssl.0.5.10 failed at "dune build -p ssl -j 3".

#=== ERROR while compiling ssl.0.5.10 =========================================#
# context     2.1.3 | linux/x86_64 | ocaml-base-compiler.4.12.0 | https://opam.ocaml.org#94fb49a6
# path        ~/.opam/4.12.0/.opam-switch/build/ssl.0.5.10
# command     ~/.opam/4.12.0/bin/dune build -p ssl -j 3
# exit-code   1
# env-file    ~/.opam/log/ssl-28030-12f498.env
# output-file ~/.opam/log/ssl-28030-12f498.out
### output ###
# /home/ty/.opam/4.12.0/lib/ocaml/caml/mlvalues.h:282:23: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
# [...]
#                        ^
# ssl_stubs.c:1179:18: note: in expansion of macro ‘String_val’
#    char *CApath = String_val(ca_path);
#                   ^~~~~~~~~~
# ssl_stubs.c: In function ‘ocaml_ssl_set_client_SNI_hostname’:
# /home/ty/.opam/4.12.0/lib/ocaml/caml/mlvalues.h:282:23: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
#  #define String_val(x) ((const char *) Bp_val(x))
#                        ^
# ssl_stubs.c:1262:20: note: in expansion of macro ‘String_val’
#    char *hostname = String_val(vhostname);
#                     ^~~~~~~~~~



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

To reproduce

Steps to reproduce the behavior:

On win10 wsl2 debian:
opam install learn-ocaml-client or
opam install learn-ocaml-client.0.14.0 or
opam install ssl.0.5.10

Current configuration

  • OS name (and version): win10 21H2 19044.2006
  • Browser name (and version): N/A
  • learn-ocaml --version: 0.14.0
  • git describe --long --always --abbrev=40 --tags: N/A

Additional context

ssl 0.5.12 builds well, if in future can move dependency to this version, things would be great I think.

@ghost ghost added the kind: bug label Sep 23, 2022
@ghost
Copy link
Author

ghost commented Sep 23, 2022

ps: opam install learn-ocaml-client.0.13.1 works for now.

@erikmd
Copy link
Member

erikmd commented Sep 30, 2022

Thanks a lot @hxhxd for your very detailed bug report.

@yurug and I plan to release learn-ocaml 0.14.1 in ~7 days, so we'll definitely be able to include a fix for this issue.

I will open a PR and add it to the milestone.

@erikmd
Copy link
Member

erikmd commented Sep 30, 2022

BTW just FYI, if you want to use learn-ocaml-client from a released version of OCaml, you can also rely on the static binaries available in the GitHub release (easier and faster than building learn-ocaml-client using opam):

https://github.com/ocaml-sf/learn-ocaml/releases/tag/v0.14.0

Basically in a WSL2 terminal, you may want to try:

curl -fSOL https://github.com/ocaml-sf/learn-ocaml/releases/download/v0.14.0/learn-ocaml-client-linux-x86_64
mv learn-ocaml-client{-linux-x86_64,}
chmod a+x learn-ocaml-client
./learn-ocaml-client --help

But you probably were already aware of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment