Hello!I was trying to compile OCaml static website on Windows,by cloning their repo but it was having some issues with Openssl .Can someone please help me with this ?
Hello, welcome to the forum!
In order to get help for the issue you are facing as efficiently as possible, it will help if you provide precise descriptions of the issue you are facing and how to reproduce it (and any other relevant context).
Vague descriptions such as âby cloning their repoâ or âhaving some issue with Opensslâ are, unfortunately, wholly insufficient for anyone wanting to assist you.
On this subject, Simon Tatham has written an excellent essay entitled How to Report Bugs Effectively. I cannot recommend it enough.
Cheers,
Nicolas
I donât have a windows computer anymore, but when I did I was using ocaml under cygwin.
Itâs true that ocaml is easier to use under Linux, but using it with Cygwin is not that bad, and even can have some advantages. (For example there is no good portability of linux binaries to other distros, and even other versions of the same distro. But if you create a binary from an ocaml program with Cygwin, you can easily run it on any linux distro with wine.)
Are you using Cygwin for the task youâre trying to achieve ?
A google search show me that there is an openssl package on cygwin, and i also got a link to this issue on stackoverflow. Do you get a similar problem ?
Also why are you trying to compile the ocaml static website ? is it to contribute to it ? is it to have a local copy that you can browse offline ? is it you want to learn how to make something equivalent ? or you want to learn how this one is built ?
- if you want to contribute to it, you can do it even if youâre not able to make the built.
- if you want a local copy, you can do it with âwgetâ.
- if you want to make another static website, there are plenty of static website generators ready and easy to use.
- if you want to learn how this one is built, then you are lucky, because it will push you to have a look inside to search what is the problem.
Dear Nicolas,
Thank you for your response. I am very new to this area, and I sincerely appreciate your guidance and the reference to Simon Tathamâs essayâI will go through it carefully to improve how I report issues.
Hello Florent,
Thank you for reaching out! I appreciate your insights on using OCaml with Cygwin.
Basically I am working on compiling ocaml.org
on Windows as part of issue Compile ocaml.org on Windows · Issue #2780 · ocaml/ocaml.org · GitHub. My goal is to contribute to this issue.
At the moment, I am facing challenges related to OpenSSL compilation.
After cloning the ocaml.org repo when I tried to install the dependencies then Iâm getting an error that cannot build openssl 0.7.0.
Iâm using powershell/cmd for writing the instructions.
Please provide insights!
Please post the text of the error you are encountering
Hello Shon,
here is the error message
[ERROR] The compilation of ssl.0.7.0 failed at âdune build -p ssl -j 7 @installâ.
=== ERROR while compiling ssl.0.7.0 ==========================================#
context 2.3.0 | win32/x86_64 | ocaml-base-compiler.5.0.0 | https://opam.ocaml.org#bc512a2d7545dee0dc96628bd52cddc17739991c
path ~\AppData\Local\opam\5.0.0.opam-switch\build\ssl.0.7.0
command ~\AppData\Local\opam\5.0.0\bin\dune.exe build -p ssl -j 7 @install
exit-code 1
env-file ~\AppData\Local\opam\log\ssl-22800-f56081.env
output-file ~\AppData\Local\opam\log\ssl-22800-f56081.out
output
ssl_stubs.c:1321:3: warning: implicit declaration of function âASN1_TIME_to_tmâ; did you mean âASN1_TIME_setâ? [-Wimplicit-function-declaration]
[âŠ]
| ^~~~~~~~~~~~~~~
| ASN1_TIME_set
ssl_stubs.c:1321:19: warning: implicit declaration of function âX509_get0_notBeforeâ; did you mean âX509_get_notBeforeâ? [-Wimplicit-function-declaration]
1321 | ASN1_TIME_to_tm(X509_get0_notBefore(cert), &t);
| ^~~~~~~~~~~~~~~~~~~
| X509_get_notBefore
ssl_stubs.c: In function âocaml_ssl_get_expiration_dateâ:
ssl_stubs.c:1333:19: warning: implicit declaration of function âX509_get0_notAfterâ; did you mean âX509_get_notAfterâ? [-Wimplicit-function-declaration]
1333 | ASN1_TIME_to_tm(X509_get0_notAfter(cert), &t);
| ^~~~~~~~~~~~~~~~~~
| X509_get_notAfter
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
ââ The following actions failed
â λ build ssl 0.7.0
ââ
â¶â No changes have been performed
To update the current shell environment, run: (& opam env) -split â\r?\nâ | ForEach-Object { Invoke-Expression $_ }
PS C:\ocaml.org>
Hello Labdhi,
The try you made with the windows installer to install openssl probably provides something not compatible, compiled with a different compiler.
Are you using WSL under powershell ? Did you installed openssl with the package manager provided by this environment, or did you finally got the git version compiled?
Itâs good to provide the error message, but itâs also better if you provide the command that produced the error message at the same time.
Iâm not a professional, but from this error message : ssl_stubs.c:1321:3: warning: implicit declaration of function âASN1_TIME_to_tmâ; did you mean âASN1_TIME_setâ
I guess that this is now the opam bindings for openssl that you are trying to compile (not openssl itself), and it seems that some functions are found but not all. Iâm not a professional, but my guess would be that the openssl headers (from the openssl lib) donât seem to match the ocaml bindings to openssl. If this guess is right you could check which version of the openssl lib you installed, and if itâs compatible with its ocaml bindings.
If youâre using opam, conf-libssl
has probably been already installed, which means you probably finally got your openssl intalled, but I donât see if this conf
virtual package checks for the version of this lib.
The page ssl.0.7.0 points to savonet/ocaml-ssl, where I can only see a release 0.6.0
. I donât know where is 0.7.0
in order to check what are the compatible versions of the openssl lib.
Hi Florent,
Iâm not using WSL under powershell.I downloaded the openssl from shining light production and also tried to use the one from git by setting the path in environmental variable.Iâll try using another version of openssl which is compatible with ocaml.
If youâre not using Cygwin, nor WSL, what are you using to get the required environment for the task youâre willing to achieve ? How did you install opam
?
If you want to contribute to this static website, you need some basic knowledge first, and a compatible environment for the project you want to contribute.
Are you using a package manager for C libs ?
Opam is a package manager for ocaml libs. If conf-ssl
passed, it means that it probably found something else than the shining light one.
If you compiled the git version of openssl, you probably used gcc. If you use gcc, how did you installed it ? If you installed gcc with a package manager, why donât you use it to install openssl too ?
Ok, I just found 0.7.0, it was in Tags, not in releases tab. And found this information :
Bump OpenSSL minimum requirement to 1.1.0
conf-openssl doesnât seem to have anything for your os indepexts
.