-
Notifications
You must be signed in to change notification settings - Fork 33
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
cohttp support ? #326
Comments
Hi! Generally, if a project is packaged using Most likely, it shouldn't be a problem to add |
Thank you, I've tried packaging a bunch of packages to make it work but couldn't test in real condition because I couldn't build ssl-windows yet to test my cross compiled app with https websites (see #327 ). I have some questions about ppx_ packages, I don't exactly understand if they need to be packaged for windows or if I can use normal ppx_ package from opam official repo ? For example, ppx_lwt for me (if I understand well) is a sort of preprocessing tool, so I don't know if I need to package it or not ? Another question: Is there a sort of automatic process to build dune project without having to package manually all dependencies ? |
Generally speaking, when asked to build for a cross-compiled target, For ppx, I believe that most of them operate using a locally run binary so you will need to have the dependencies for the host added to the In general, you could do a trial and error process until you figure out the minimal set of dependencies. These days, I will admit that I have simply added both set of dependencies to new packages to make the process easier. You could automatize this and systematically add both native and cross-compiled dependencies and be able to automatically create cross-compiled packages. I still believe that it's important to do some of this manually to at least think about what you're doing. There are packages that will need a little more attention like bindings using On the other hand, if your package is pure OCaml code, aside from overeaching, adding both set of dependencies is pretty much guaranteed to work. |
Now I have a new issue, I need to cross-compile ca-certs for windows (to make https working in cohttp) and it has "ptime" as a dependency. To be honest, I don't understand at all the difference between ptime and mtime… But I couldn't succeed to build ptime. I've also discovered that mtime does not build. mtime-windows (from this repo) fail with this error:
For ptime-windows (packaged by myself), I have this error:
I'm still investigating for finding how to solve the issue. |
The errors don't seem to say much, could you get some logs with the |
I've been hit by this problem. I thought I worked a workaround but I cannot find it, sorry. So you don't redo the part of the investigation I remember, here it is: It is a """bug"" of Long story: (linux) topkg tries to be too smart and because it detects that the target is "windows", it asks (linux) ocamlbuild to build (among other files) Actually, I might be wrong but accordingly to my experiments, you don't need to explicitly ask for the generation of |
Thank you for your explanation ! I understand better know the problem… But I don't know anything about topkg and ocamlbuild so I don't know how to prevent it to build the .dll… But what I don't understand too is that I probably need to build the .dll one time ? So I cannot just disable it's build, isn't it ? In my experiments, I've also found this repository for ptime: https://github.com/routineco/ptime . It's a try of packaging ptime with dune but even if I succeed to build it using usual dune tricks, the result was not detected by ca-certs-windows… I think the c code has not been build correctly. And I don't know how dune build c code. |
You might want to consider converting the repo build system to |
Ok I think the problem with the ptime packaged with dune I found was the missing "public_name" stanza in the dune file… Now it looks it has succeed (but can't really test it for now). Now I have another issue with "mirage_crypto_rng" and it's "foreign_stubs":
I don't know how to deal with foreign_stubs… I'm browsing the web to try to find an answer. EDIT: finally the problem seems to be "Windows.h" does not exist in linux, I have to modify to "windows.h" (it's not a problem on actual windows machine because it's not case sensitive) |
You can find ports of the build system of ptime and mtime (among others) at https://github.com/dune-universe/ptime and https://github.com/dune-universe/mtime . |
I've seen in the past people tried to port cohttp package into this repository. I want to know what is the state of cross compiling projects using cohttp-lwt-unix to windows ? I want to know if it's possible and if yes, how to do ?
Thank you
The text was updated successfully, but these errors were encountered: