-
Notifications
You must be signed in to change notification settings - Fork 410
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
Cross Compilation & C Stubs #715
Comments
No, this should be fine. No OCaml libraries I know of build C-only binaries, and partial linking via
Avoid prefixed binaries, those are a useless and unnecessary relic of GNU dark ages. pkg-config respects the |
While I'm certainly a supporter of questioning the status-quo and avoiding the cathedral syndrome, I have to say the triplet-prefixed binaries seems a little more mainstream to me than a relic of GNU dark ages :-) They make sense from a system setup point of view (allows them to cohabit in the |
@toots While supporting the compiler triple-prefixed binaries makes sense (after all you probably don't want to drop support for gcc), requiring all tools to use triple-prefixed binaries or expecting that by default doesn't. Pretty much every tool except GNU gcc and binutils can target multiple architectures behind a switch, and requiring the user to have several copies of these binaries (which bloat installations, get out of sync, etc) is not something dune should do. |
I think we should pass whatever information from Context.t that configurator needs to understand the configuration. Now that configurator is part of Dune it's easier to do. |
Okay, so it definitely seems simpler not to assume the user has multiple binaries installed unless it's necessary. The question still remains though, where does dune get the information for which pkg-config binary or which pkg-config environment variables to set. We could just add more variables to findlib.conf? |
More |
I see that some dune based packages already work in opam-cross-windows btw. For example, pcre:
@whitequark @toots remind me again what is Also curious, why |
|
Mainstream |
Maybe now :-) |
I believe there are still some bugs in upstream jbuilder that prevents it from being used for cross-compilation, since ocaml-cross/opam-cross-windows#56 fails. |
You're right of course, it should be |
Fairly certain that bug has been fixed. Also, where do variables like this come from: |
@rgrinberg Looks like mainstream |
@toots there's no longer a need for it. it's inferred from the toolchain. So |
Okay, so far we just need agree on a scheme to pass |
I would say go for arbitrary environment variables. |
In my experience, being able to set arbitrary env variables would prove quite useful. Sometimes, libraries are located in weird locations or need other special env configuration just like |
The issues in this ticket have been addressed. And I've made a dune port of ocaml-ssl (cc @toots) |
Want to merge it to https://github.com/savonet/ocaml-ssl @rgrinberg ? Would need @smimram's approval, tho. |
@toots I made the PR against savonet: savonet/ocaml-ssl#39 Yeah, absolutely. I think it might be interesting to consider porting liquidsoap to dune as well. But I know hard can it be to chuck out so many carefully hand written makefiles :) |
Hehe. I wouldn't be against it necessarily but my main concern is that we've had a centralized build system that allows us to configure and build liquidsoap and all of its modules at once and it's been really helpful for a lot of tasks, including CI testing. I'll think about it, tho. I could start with packing away modules that haven't been updated in a while. |
I'm investigating porting ocaml-ssl to dune and the new configurator and @toots has brought up some good points about supporting cross compilation in savonet/ocaml-ssl#35
In particular, how the current cross compilation scheme works:
Which points that our cross compilation scheme is ignores pkg-config entirely.
and that our current assumptions about using ocaml's
CC
may be naive in the context of windows.Points worth considering:
Should we support autoconf's scheme for binary selection when x compiling?
What's a good way to make configurator aware of x compilation? Should we pass the correct
pkg-config
binary to it? or should it somehow find it if it's in a cross compilation context?The assertions about windows &
$(CC)
need to be verified.A successful port of ocaml-ssl to dune should be quite valuable. It's a widely used package, a key part of the lwt ecosystem, and a stepping stone to get any kind of uable http client running on windoze. Lastly, it will be a good test for our C stubs stack touching on cross compilation, configurator, macports, win32, etc.
cc'ing:
@diml for the first 2 points
@dra27 as our windows oracle
@avsm regarding pkg-config
@whitequark as the general x compilation expert.
The text was updated successfully, but these errors were encountered: