-
Notifications
You must be signed in to change notification settings - Fork 87
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
[WIP] Dunify with variants #384
Conversation
Nothing open-source at the moment (and not really embeddable either), sorry. |
the solo5 checksum stubs are part of mirage-solo5 https://github.com/mirage/mirage-solo5/blob/master/lib/bindings/checksum_stubs.c I agree with @samoht #378 (comment) and would appreciate to move the checksum code to checkseum and depend on checkseum. this would remove all c stubs from this library :D
|
I will be happy to improve One, and the biggest, issue will be to test |
That'd be a good occasion to fix checkseum :-) |
I don't think we should switch to checkseum just yet -- the two checksumming methods seem entirely orthogonal to each other, and TCP 1s-complement checksumming isn't used very often elsewhere. This PR maintains compat and introduces a new tcp-checksum package using Dune variants, so I'd prefer to release this first (once Dune 1.7 is out) and then consider moving the stubs out. |
This depends on dune 1.7 being released, so deferring it for now in favour of #391. Will rebase later |
This changes the external ocamlfind interface to break out the virtual checksum stubs library into a separate `tcpip-checksum` library. This library is then depended on by the rest of the tcpip stack.
39976f9
to
11490b7
Compare
Now that dune 1.7 is out I've pushed a rebase of this PR that shifts to virtual_modules. See also mirage/mirage#969 |
Any chance for another rebase? |
now that dune 1.9.0 is out, can we get a rebased PR? :) /cc @TheLortex |
Holding off on rebasing this until ocaml/dune#2322 is fixed |
thanks for your effort -- closing now that we have a slightly revised (xen) stack, where the checksum stubs are provided by mirage-xen themselves. |
Prompted by @copy's pure OCaml checksum stubs, I've begun the port of tcpip to use the new Dune variants feature. This feature in Dune promotes the so-called "linking hack" (where a cmi is shared among multiple implementations) to a first-class supported entity.
We use virtual libraries to break out the checksum handling into a separate
tcpip-checksum
library that has unix, xen and ocaml variants that can be selected at executable link time. Since each of the implementations is compiled separately, we also have good CFLAGS discipline.freestanding
version of the checksum stubs at present? Needs to be added here.tcpip
ocamlfind library totcpip-checksum
and the use of virtual libraries.ppx_cstruct
to the ones that really need it (usually just thewire
libraries).