-
Notifications
You must be signed in to change notification settings - Fork 95
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
Not building for MirageOS due to unimplemented parts of stdlib #519
Comments
Thanks for the report. The intention is for |
@yallop Oh, ok. That sounds sensible. I have no idea how to proceed with that, but I hope that the information below can help you figure out what's going on. Installed version:
And this is when building Thomas' https://github.com/talex5/qubes-mirage-skeleton after adding
It appears to me like the combination of ocamlfind ocamlopt -linkpkg -package ctypes -dontlink str a.ml with open Ctypes
let () =
let x = Ctypes.sizeof Ctypes.bool in
Printf.printf "%d\n" x |
Looks like it's being linked here (when building
Removing that doesn't quite do the trick since some of the
|
By removing seemingly unneeded references to the
and in these auxiliary files:
I suspect that the offenders may be:
|
Fixes yallop#519 Note that I replaced some instances of `regexp` with `regexp_string` for correctness, including an instance in `discover.ml` where we relied on Str to treat a regex consisting of a single `\` to parse as a literal `\`: ```diff (** See the comment in commands.ml *) -let unixify = Str.(global_replace (regexp "\\") "/") +let unixify = Re_str.(global_replace (regexp_string "\\") "/") ```
Hm, I got sucked into this and ended up with this PR: #520 The build seems to work for me, but the tests are broken. Comments appreciated! |
That sounds great! :) |
Hmm, so the Do you know what the present status of these PRs are - are they released in 12.1 (the newest Ctypes version available in my |
The |
@yallop Thank you for the clarification, and for your work on this, I really appreciate it! |
@cfcs: I think this is fixed in opam pin add --dev ctypes Your package should then have a findlib/ocamlfind dependency on |
That seemed to work! I'm now left with a handful of new errors, but I suspect that may be my own fault... (I changed
|
Thanks for the update, @cfcs. I don't see |
No. I suspect it's depending on a bunch of stuff that the mirage-xen thingie doesn't have (floats?). Here's with "ctypes" added:
|
This is due to mirage-xen not having the ctypes stubs compiled into it. We're almost at the point of having proper stub cross compilation, but it's not quite there yet. In the meanwhile, we could add uint and the ctypes stubs directly into mirage-xen. |
Sorry for digging this up, but I have the same errors (with some solo5 extras) while building for virtio or ukvm. Is it even possible to use ctypes with solo5 ? |
Just cross-linking this to #574, which (along with some changes on the MirageOS side) make it significantly more automated to cross-compile C stubs for all the MirageOS backends. |
I currently cannot build Ctypes when targeting MirageOS. I do not have build logs at hand, but I wanted to log this for further discussion.
The errors I am receiving seem to refer to the usage of the
Str
module from the stdlib.A cursory search seems to hint that it is (mostly) used for regular expressions: https://github.com/ocamllabs/ocaml-ctypes/search?utf8=%E2%9C%93&q=Str&type=
Would it be possible to drop the reliance on
Str
and replace the affected code with something else without external dependencies - likeRe
? (see https://github.com/ocaml/ocaml-re )I will try to do this replacement and determine if there are other things in the way.
The text was updated successfully, but these errors were encountered: