Closed anuragsoni closed 4 years ago
Hmm. This isn't something I understand especially. Base is meant to be highly portable. The missing symbols are just C functions, right? Why aren't such things compatible with Mirage? It's not like JavaScript compilation, where you need to stub C-functions out, right?
Anyway, being compatible with Mirage seems desirable. Is there a guide somewhere as to what one needs to do to be compatible?
From @avsm, I learn that this will be broken until Mirage merges this:
https://github.com/mirage/mirage/pull/1153
It's being actively worked on now. Closing this issue, since there's nothing to do in Base, it seems.
Nothing needs to happen on the Base side. This is unsupported in Mirage3 until https://github.com/mirage/mirage/pull/1153 is merged (due for Mirage4), and #88 is fixed in Base (which was done in a point release recently).
The background is that Mirage4 will support transparently building C stubs in an isolated dune workspace, thus ensuring that all external dependencies are systematically compiled for the same execution environment. This will not only let Base stubs work, but unlock any library that builds with dune and includes reasonably portable C stubs (or indeed, WASI or other interesting targets).
Thanks for the reference to the work in progress. I had initially thought there were some changes needed in base because of something i saw in the bigstringaf project about linking against ocaml-freestanding.
The proposed mirage 4 updates look really nice and I'll look forward to using it.
I noticed this while working on a project which is using ppx_compare. I wanted to use Base to provide the comparison functions that can be used by ppx_compare. The library needs to be usable under mirage, but when using the comparison functions from base, i get a build error when targetting any mirage backend that is not unix. (hvt, spt etc)
Is mirage support something that is desirable for base? Its not a blocker since I can define my own comparison functions and/or alternatives like Containers. But it'd be great if I could use Base as i use it everywhere else and it simplifies using other ppxes like ppx_sexp_conv.