Skip to content

Releases: mirage/capnp-rpc

2.0

30 Nov 13:42
252fd9b
Compare
Choose a tag to compare

CHANGES:

capnp-rpc 2.0 switches from using Lwt to Eio.
The capnp-rpc-lwt package is now just Lwt wrappers around the Eio functions in capnp-rpc.
This allows libraries using the old Lwt API to be used with applications and libraries using the new Eio one,
in the same binary.
Because Lwt libraries (using capnp-rpc-lwt) can be used with Eio applications (using capnp-rpc-unix),
you should first upgrade your application and then upgrade the libraries afterwards.

It is recommended to upgrade in stages, checking your application still works after each step:

  1. Upgrade to the latest Lwt version (opam install capnp-rpc-unix.1.2.4).
    This uses the new version of mirage-crypto, tls, etc,
    which may be incompatible with other libraries you are using.
    Get that sorted out before switching to capnp-rpc 2.0.

  2. Use lwt_eio to allow using Eio and Lwt together in your application.
    This means replacing your call to Lwt_main.run with code to run Eio and Lwt together,
    as explained at the start of the lwt_eio README.

  3. Upgrade your main application to capnp-rpc-unix 2.0.
    Calls to functions in the Capnp_rpc_unix and Capnp_rpc_net modules will need minor updates.
    They were previously called from Lwt context, so you'll need to wrap them with Lwt_eio.run_eio
    (or remove a Lwt_eio.run_lwt if you already updated the surrounding code).
    You should also use mirage-crypto-rng-eio to ensure randomness is available
    (capnp-rpc-unix no longer does this, although some other library might).

  4. Upgrade code and libraries using Capnp_rpc_lwt:

    1. Replace open Capnp_rpc_lwt with open Capnp_rpc.Std.
    2. Replace all other uses of Capnp_rpc_lwt with just Capnp_rpc.
    3. In dune and opam files, replace capnp-rpc-lwt with capnp-rpc.
    4. Some modules are in Capnp_rpc but not the Capnp_rpc.Std subset.
      Those should now be fully qualified (e.g. replace Persistence with
      Capnp_rpc.Persistence).
    5. Replace Service.return_lwt with Lwt_eio.run_lwt.
      Replace Lwt.return (Ok x) with Service.return x.

Once all Lwt code is gone, you can remove the dependencies on lwt and lwt_eio.

New features:

API changes:

  • Eio port (@talex5 #280 #284 #298 #292 #297 #300 #304).

    This switches capnp-rpc from Lwt to Eio.
    One particularly nice side effect of this is that Service.return_lwt has gone,
    as there is no distinction now between concurrent and non-concurrent service methods.

    Uses of Capnp_rpc_lwt should be replaced by uses of Capnp_rpc
    (and the old Capnp_rpc is now an internal module, Capnp_rpc_proto).
    The new Capnp_rpc now provides Error, Exception and Debug aliases to the same modules in Capnp_rpc_proto,
    so that Capnp_rpc_proto doesn't need to be used directly.

    Capnp_rpc_lwt now provides (deprecated) compatibility wrappers, using lwt_eio.

    This also adds Capnp_rpc.Std with some common module aliases,
    to reduce the need to open Capnp_rpc (which is rather large).

  • Deprecate Debug.failf (@talex5 #291).

Performance and bug fixes:

Build:

1.2.4

28 Nov 12:50
ec9899a
Compare
Choose a tag to compare

CHANGES:

  • Update dependencies and remove capnp-rpc-mirage (@talex5 #276).

    • Update for breaking changes in tls, mirage-crypto and mirage-flow.
    • capnp-rpc-mirage isn't used much, and won't be needed after switching to Eio.
  • Update tests to Cap'n Proto 1.0.1 (@MisterDA #274).

  • Update links to ocaml-ci and capnp-ocaml (@tmcgilchrist #271).

  • Opam doesn't allow with-test in conflicts (@talex5 #269).

  • Disable opam tests on macos (@talex5 #268).

  • Update CI (@MisterDA #272, @talex5 #277).

1.2.3

23 Feb 14:03
86427f6
Compare
Choose a tag to compare

CHANGES:

1.2.2

24 Jan 09:41
8bca1b5
Compare
Choose a tag to compare

CHANGES:

1.2.1

05 Nov 10:41
fddf3fa
Compare
Choose a tag to compare

CHANGES:

v1.2

10 Jun 10:03
a2f1b2f
Compare
Choose a tag to compare

CHANGES:

  • Don't crash if the peer disconnects before the bootstrap reply is ready (@talex5 #234).
    When replying to a normal question we checked that the answer was still needed before trying to reply, but didn't for bootstrap requests.

  • Replace wait_until_settled with safer await_settled (@talex5 #233).
    wait_until_settled makes it too easy to ignore errors.

  • Require fmt >= 0.8.7 for kstr and set OCaml 4.08 as the minimum version everywhere (@talex5 #232).
    Older versions aren't tested in CI because the unix and mirage packages require at least OCaml 4.08.

v1.1

27 Apr 09:46
4c92232
Compare
Choose a tag to compare

CHANGES:

  • Update to latest X509, TCP and TLS APIs (@talex5 @hannesm #228).

  • Add Service.fail_lwt convenience function (@talex5 #229).

  • Remove confusing debug details from call_for_value_exn errors (@talex5 #230).
    The hidden information is now logged (at debug level) instead.

  • Configure TCP keep-alives for incoming connections, not just outgoing ones (@talex5 #227).
    This is needed when the client machine crashes without resetting the connection.

  • Include version number in opam license field (@talex5 #226).

v1.0

06 Apr 13:42
c565f59
Compare
Choose a tag to compare

CHANGES:

  • Skip the setting of object_id if it is empty (@LasseBlaauwbroek #224).
    This improves interoperability with the C++ implementation.

  • Use open_in_bin instead of open_in for Windows compatibility (@MisterDA #222).

v0.9.0

28 Dec 12:06
48ab696
Compare
Choose a tag to compare

CHANGES:

  • Add connection progress indicator (@talex5 #220).
    Clients can now use Capnp_rpc_unix.with_cap_exn to show a progress indicator while waiting to connect.
    It will use the log if enabled.
    If not, but stderr is a tty, it shows a message while connecting and then erases it (if connecting takes longer than 0.5s).
    If stderr is not a tty, it just prints a message there.

  • Use Mirage_crypto_rng_lwt.initialize instead of Mirage_crypto_rng_unix.initialize (@hannesm #217).
    The former periodically feeds entropy to the RNG, while the latter seeds the RNG only once.

  • Set TCP_KEEPIDLE=60 if possible (@talex5 #214).
    Cap'n Proto connections tend to be long lived and we therefore turn on the SO_KEEPALIVE option.
    However, the default keepalive timeout of 2 hours is much too long for some networks.
    In particular, Docker's libnetwork silently drops idle connections after about 10 minutes.

Windows support:

  • Prevent crash if ExtUnix wasn't built with sockopt (@MisterDA #218).
    If ExtUnix isn't built with sockopt then the symbol have_sockopt_int isn't available and an exception is raised.
    This may be the case on some environments (e.g., ExtUnix built with mingw-w64).
    It is a workaround until support for TCP_KEEPIDLE is added for these environments (e.g., using Winsock instead).

  • There is no SIGPIPE on Windows (@dra27 #212).

  • Switch from "capnpc" to "capnp compile" (@talex5 #213).
    capnpc seems to be the old name, and isn't present on Windows.

Build changes:

v0.8.0

17 Jul 15:51
1812e36
Compare
Choose a tag to compare

CHANGES:

Bug fixes and diagnostics:

  • Don't GC imports with callbacks (@talex5, #210).

  • Improve "Already resolved!" error message (@talex5, #209).
    Show the state of the promise we were trying to set, and what we tried to set it to.

  • Reject attempts to send after disconnecting (@talex5, #208).

  • Unix: don't leak FDs if Network.connect fails (@talex5, #206).
    Also, use Lwt to open connections so we don't block the whole process.

New functions:

  • Add Sturdy_ref.with_cap and with_cap_exn convenience functions (@talex5, #207).
    Using the plain connect functions, it's easy to forget to release the live-ref at the end.

Build changes:

  • capnp-rpc-mirage: adapt test to tcpip 5.0.0 API (@hannesm, #205).

  • Upgrade to dune 2 (@talex5, #204).

  • Switch tests to build in native code and use the test stanza (@avsm, #203).

Documentation:

  • Show how to make a connection directly (@talex5, #202).
    The new test-bin/calc_direct.ml example shows how a parent process can
    spawn a child and communicate with it directly over a socketpair.