This page records API changes that require existing code to be updated.
The config file must be passed with the
-f option (instead of being just
get_mode is deprecated. You should use keys instead. And in particular
add_to_opam_packages are deprecated. Both the
foreign and the
register functions now possess the
~packages arguments to specify libraries dependencies.
If you were using
tls without the conduit combinator, you will be
greeted during configuration by a message like this:
The "nocrypto" library is loaded but entropy is not enabled! Please enable the entropy by adding a dependency to the nocrypto device. You can do so by adding ~deps:[abstract nocrypto] to the arguments of Mirage.foreign.
Data dependencies (such as entropy initialization) are now explicit. In order to fix this, you need to declare the dependency like so:
open Mirage let my_functor = let deps = [abstract nocrypto] in foreign ~deps "My_Functor" (foo @-> bar)
My_functor.start will now take an extra argument for each
dependencies. In the case of nocrypto, this is
Before, you would specify your server's address in the
let server = http_server (`TCP (`Port 8080)) (conduit_direct (stack default_console))
and then use it in your
let start http = ... http (H.make ~callback ~conn_closed ())
With mirage > 2.5, the address argument is no longer present and you will get this error:
Error: This function has type Mirage.conduit Mirage.impl -> Mirage.http Mirage.impl It is applied to too many arguments; maybe you forgot a `;'.
To update, change
let server = http_server (conduit_direct (stack default_console))
and move the address to your
let start http = ... http (`TCP 8080) (H.make ~callback ~conn_closed ())
Note that the
Port tag has also been removed.
This change was needed to support TLS servers, since TLS configuration (keys and certificates) is more complex and cannot be declared in the