Closed dinosaure closed 5 years ago
This PR doesn't actually add the :standard
token to the c_flags
stanza. Isn't that necessary to make the xen and freestanding packages unnecessary?
Ah yes, I missed it. It's done.
The :standard
flags should be included for sure, so I put that change into a separate PR and will merge/release shortly.
I don't understand the purpose of the bigarray compatibility library. Presumably mirage will still work with OCaml versions before 4.07
that link in the Bigarray
module, so what would stop Ocaml version after 4.07
that link in the Bigarray
module from working as well?
We're currently switching the build system of mirage, from ocamlbuild to dune.
The problem with the bigarray
library is that it has a dependency on unix
. This is problematic because we don't want to implement unix in the mirage case. ocamlbuild solved that problem by having a -dontlink unix
option which just ignores the package dependency at link time. Dune don't allow that so we're currently chasing down unwanted unix dependencies.
After 4.07, using Stdlib.Bigarray
instead of Bigarray
allows to get rid of the unix dependency. That's why I created bigarray-compat: which is Stdlib.Bigarray
when possible with a fallback to Bigarray
. It allows:
Sorry, I forgot about this. I'll do a release shortly.
-Spiros E.
/cc @TheLortex
A long time ago, we asked to put two sub-packages:
bigstringaf.freestanding
bigstringaf.xen
See #12, #13, #21 and #22.
It's an old trick to give to C stubs right flags to be linked then with the final unikernel with
ocamlbuild
andocamlfind
. @TheLortex did a huge work on Mirage to be able to compile an unikernel withdune
. You can see a precise report here.The goal of this PR is to move furthermore about compatibility of some packages and what
mirage
will be.By the
:standard
expansion in thedune
file,mirage
is able to give tobigstringaf
right flags to compile C stubs (in this casebigstringaf_stubs
). By this way,bigstringaf.freestanding
andbigstringaf.xen
is not needed anymore - this PR does not delete them to keep a compatibility.Another point, and it's the real purpose of this PR, is to replace
Bigarray
module byStdlib.Bigarray
(only available onocaml.4.7.0
and upper) orBigarray_compat
(a package available here where theBigarray
module at top differs.Bigarray_compat
wants to provide only what is needed bybigstringaf
withoutmap_file
function for any version of OCaml.To prepare then, the big move of Mirage to the
dune
build-system, this PR is required - currently compilation was tested locally. If you are interested by the process, I can explain it.EDIT: GitHub was not happy about my last PR and did not integrate my last commit.