-
Notifications
You must be signed in to change notification settings - Fork 15
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
Code updates and preliminary changes for Mirage compatibility #57
Conversation
Thanks for this! We'll take a look soon. The only piece I'm worried about is:
Unfortunately base64 broke compatibility with anything that (transitively) links to Core_extended so we can't use the latest version, see: https://discuss.ocaml.org/t/what-to-do-about-files-both-define-module-base64/3426/3 I'll see if I can do this upgrade now though. |
(Oh and for the record, I think we're fine with not using |
I'll wait for your to look at base64, we can postpone it if it still turns out to be tricky. Good we can drop the full |
Does I've been looking into the base64 update and I think we can do it relatively soon. |
Not out of the box, at least. If I add
|
Hmm ok. I think I'd be fine with moving the inline tests to normal tests. |
I cherry picked two of your changes in #58 and I'll merge those as soon as the build finishes. |
Thanks! |
3baf2af
to
a48e233
Compare
Hm I'm not sure how long this is going to take us to get the base64 thing working. Base64 v3 is incompatible with Core v0.11, we can't use Core v0.12 because it's missing Async.Udp, and we can't use Core v0.13 because Async_ssl v0.13 isn't released. So that's fun.. |
I see. Do you want to keep this open for when you can upgrade to the next core release, maybe change the title? |
About the tests, do you have a preference for unit testing framework apart from inline tests, or just plain asserts? I can send that in an new PR. |
For the tests, we would want them to use OUnit like we do with the existing tests. Or alternatively, convert everything to Alcotest and then write Alcotest tests (we will probably do this eventually but we don't have a lot of time to work on it). And yes, I think making this work on Mirage is a good goal, I just don't know how long we'll be stuck dealing with base64's problems :( Maybe we should just vendor our own base64 library so we don't have to deal with this.. |
Good, I'll look into the test conversion soon. I don't think the base64 upgrade is required for MirageOS compatibility, sorry if I made that impression. I was really putting too much into this PR, didn't think it would bite back. So, I'm okay with wait and see for now. Corretion: I missed the part about cohttp using base64 > 3. |
Ok, sounds great! |
FWIW, the inline tests will soon work with MirageOS according to ocaml/dune#897 (in the way that the dependency will be dropped by dune + ppx_inline_tests in release mode) :) |
Thanks for the PR! We merged this in #62 |
I am experimenting with running pgx under Mirage. I got it working, but with various patches to pgx. This PR covers the ones I think can be merged, but I can cherry pick and send them individually if you prefer:
Unix
from the API.(I am proposing this on its own, but for the reference:
While
Unix
no longer is a direct dependency, it is pulled in along with base throughppx_jane
.ppx_sexp_conv
is harmless as it only uses sexplib0, so the remaining change I needed to make it work under Mirage, apart from the IO adapter module, was:One thing was still not quite as it should be, my
Pgx_mirage
has the following signature:That is, I need to bring in a singleton of the network stack. From the Mirage point of view, I think this should have been an argument to the
open_connection
function, though that would seem odd from the "normal" point of view.)