Lwt 3.0.0 breaking changes notice #308

Closed
aantron opened this Issue Jan 3, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@aantron
Collaborator

aantron commented Jan 3, 2017

Lwt 3.0.0 will be released near 1 April with minor breaking changes to several APIs. This issue is for informing maintainers of OPAM packages that use those APIs.

Each API that is breaking has been given a deprecation warning in the recent 2.7.0 release. Versioned APIs are provided so you can optionally make a smooth transition. If you switch to one of the versioned APIs, you should add constraint lwt {>= "2.7.0"}. Otherwise, you should add lwt {< "3.0.0"} to your current code.

If you need to temporarily suppress a deprecation warning on an expression e, use

(e [@ocaml.warning "-3"])

I will cc the package maintainers once Lwt 2.7.0 and the factored-out packages are installable from OPAM.


  • Lwt_unix.bind (#230, #296):

    Warning 3: deprecated: Lwt_unix.bind
     This function will soon evaluate to a promise (-> unit Lwt.t), because the
     bind system call can block for Unix domain sockets. See
       https://github.com/ocsigen/lwt/issues/230
     This will be a breaking change in Lwt 3.0.0.
     If you don't use Unix domain sockets and use Lwt_unix.bind ... ; rather than
     let () = Lwt_unix.bind ... in, you can ignore this warning.
     To retain the current signature, use Lwt_unix.Versioned.bind_1
     To use the new non-blocking version immediately, use Lwt_unix.Versioned.bind_2
     Both alternatives require Lwt >= 2.7.0.
    

    Since Lwt_unix.bind currently evaluates to unit, and the new bind internally has the same synchronous semantics except for Unix domain sockets, it is possible to do nothing if you are not using Unix domain sockets and use ; for sequencing bind. However, you will start getting warnings like this after Lwt 3.0.0:

    Warning 10: this expression should have type unit
    

    The semantics are not guaranteed for the future, so this is not recommended.

    Lwt_unix.bind is used in packages:

    0install arakoon bencode_rpc conduit datakit datakit-client datakit-server datakit-github dht dns-forward imaplet-lwt lwt-parallel mirage-conduit mirage-dns mirage-net mirage-net-direct mirage-net-socket mirage-tcpip-unix mirage-tcpip-xen nbd obus ocplib-concur ocsigenserver osc protocol-9p release socket-daemon tcpip tls typerex-lldb utp vhd-tool vpnkit xapi-idl xentropyd skkserv-lite tlstunnel receive-mail iocaml


  • Lwt_io.establish_server (#258, #260):

    Warning 3: deprecated: Lwt_io.establish_server
     The signature and semantics of this function will soon change:
     - the callback parameter f will evaluate to a promise (-> unit Lwt.t),
     - channels will be closed automatically when that promise resolves, to avoid
       leaking file descriptors, and
     - the result will be a promise (-> server Lwt.t).
     This will be breaking change in Lwt 3.0.0. See
       https://github.com/ocsigen/lwt/pull/258
     To keep the current functionality, use Lwt_io.Versioned.establish_server_1
     To use the safer version immediately, use Lwt_io.Versioned.establish_server_2
     Both alternatives require Lwt >= 2.7.0.
    

    Lwt_io.establish_server is used in packages:

    distributed imaplet-lwt mqtt usbmux


  • Lwt_io.shutdown_server (#259):

    Warning 3: deprecated: Lwt_io.shutdown_server
     This function will soon evaluate to a promise that resolves when the close
     system call completes. This will be a breaking change in Lwt 3.0.0. See
       https://github.com/ocsigen/lwt/issues/259
     To keep the current signature, use Lwt_io.Versioned.shutdown_server_1
     To use the new version immediately, use Lwt_io.Versioned.shutdown_server_2
     Both alternatives require Lwt >= 2.7.0.
    

    Lwt_io.shutdown_server is used in packages:

    distributed imaplet-lwt usbmux


  • Lwt_engine.libev (#269):

    Warning 3: deprecated: Lwt_engine.libev
     This class will soon have parameters for selecting a libev backend. This will
     be a breaking change in Lwt 3.0.0. See
       https://github.com/ocsigen/lwt/pull/269
     To preserve the current signature, use Lwt_engine.Versioned.libev_1
     To use the replacement immediately, use Lwt_engine.Versioned.libev_2 ()
     Both alternatives require Lwt >= 2.7.0.
    

    Lwt_engine.libev is used in datakit.


  • Findlib packages lwt.ssl, lwt.glib, and lwt.react are being replaced by Findlib packages lwt_ssl, lwt_glib, and lwt_react, available now in new OPAM packages with those same names. lwt.ssl, lwt.glib, and lwt.react will be removed from OPAM package lwt in 3.0.0. See #301.

    The old (current) package names are used in:

    0install arakoon conduit eliom imap joolog lambda-term mirage-conduit obus ocsigenserver usb xe xen-api-client


@aantron aantron referenced this issue in ocaml/opam-repository Jan 3, 2017

Closed

+lwt.2.7.0 - concurrency library #8195

@aantron

This comment has been minimized.

Show comment
Hide comment

@ivg ivg referenced this issue in ivg/parallel Jan 6, 2017

Closed

update to conform with lwt.3.0 #6

1 of 3 tasks complete
@talex5

This comment has been minimized.

Show comment
Hide comment
@talex5

talex5 Jan 10, 2017

Contributor

Thanks @aantron - these are very clear and helpful deprecation messages :-)
I used Unix.bind (Lwt_unix.unix_file_descr socket) to avoid breaking on older versions (0install needs to build on various Linux distros against native packages, and they're often slow to upgrade).

Contributor

talex5 commented Jan 10, 2017

Thanks @aantron - these are very clear and helpful deprecation messages :-)
I used Unix.bind (Lwt_unix.unix_file_descr socket) to avoid breaking on older versions (0install needs to build on various Linux distros against native packages, and they're often slow to upgrade).

@talex5 talex5 referenced this issue in moby/datakit Jan 11, 2017

Merged

Updates for Lwt 3 API changes #437

j0sh added a commit to j0sh/ocaml-mqtt that referenced this issue Feb 15, 2017

server: Update API to use more recent Lwt.
Avoids the upcoming breaking changes described here:
ocsigen/lwt#308

@j0sh j0sh referenced this issue in ocaml/opam-repository Feb 15, 2017

Merged

Mqtt updates #8485

@j0sh

This comment has been minimized.

Show comment
Hide comment
@j0sh

j0sh Feb 15, 2017

@aantron this was super helpful, thanks for the in-depth descriptions of the changes, and tagging all the relevant maintainers.

j0sh commented Feb 15, 2017

@aantron this was super helpful, thanks for the in-depth descriptions of the changes, and tagging all the relevant maintainers.

avsm pushed a commit to ocaml/opam-repository that referenced this issue Feb 16, 2017

mqtt: Constrain lwt version to <= 2.7.0.
Done in preparation for the breaking changes coming in 3.0.

More info: ocsigen/lwt#308

djs55 added a commit to djs55/ocaml-9p that referenced this issue Apr 19, 2017

Update to new lwt.3.0.0 API
Lwt_unix.bind now returns a promise.

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/lambda-term that referenced this issue Apr 19, 2017

Update to lwt.3.0.0
Note that lwt.react has been renamed to lwt_react, see:

  ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/lambda-term that referenced this issue Apr 19, 2017

Update to lwt.3.0.0
Note that lwt.react has been renamed to lwt_react in both opam
and findlib:

  ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/ocaml-dns that referenced this issue Apr 19, 2017

Update to lwt.3.0.0
Lwt_unix.bind now returns a promise.

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

@djs55 djs55 referenced this issue in mirage/ocaml-dns Apr 19, 2017

Merged

Update to lwt.3.0.0 #136

djs55 added a commit to djs55/mirage-tcpip that referenced this issue Apr 19, 2017

Update to lwt.3.0.0
Lwt_unix.bind now returns a promise.

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

@djs55 djs55 referenced this issue in mirage/mirage-tcpip Apr 19, 2017

Merged

Compatibility with lwt >= 2.7.0 #308

djs55 added a commit to djs55/ocaml-conduit that referenced this issue Apr 19, 2017

Update to lwt.3.0.0
Lwt_unix.bind now returns a promise.

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/ocaml-conduit that referenced this issue Apr 19, 2017

Update to lwt.3.0.0
Lwt_unix.bind now returns a promise.

Note the signature of `Conduit_lwt_server.listen` has had to change,
to also return a promise.

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

@djs55 djs55 referenced this issue in mirage/ocaml-conduit Apr 19, 2017

Merged

Update to lwt.3.0.0 #214

@aantron

This comment has been minimized.

Show comment
Hide comment
@aantron

aantron Apr 19, 2017

Collaborator

These changes were committed by 3.0.0. Thanks to all downstream maintainers.

Note that it is still possible to use the pre-3.0.0 APIs, by using the old versioned names (see issue main comment). However, users are encouraged to gradually switch to the 3.0.0 APIs.

Collaborator

aantron commented Apr 19, 2017

These changes were committed by 3.0.0. Thanks to all downstream maintainers.

Note that it is still possible to use the pre-3.0.0 APIs, by using the old versioned names (see issue main comment). However, users are encouraged to gradually switch to the 3.0.0 APIs.

@aantron aantron closed this Apr 19, 2017

diml added a commit to diml/lambda-term that referenced this issue Apr 20, 2017

Update to lwt.3.0.0 (#48)
Note that lwt.react has been renamed to lwt_react in both opam
and findlib:

  ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/ocaml-conduit that referenced this issue Apr 20, 2017

Update to the Lwt_unix.Versioned.bind_2 API
The latest version of "bind" returns a promise. This new API version
is available in version >= 2.7.0.

Note the signature of `Conduit_lwt_server.listen` has had to change,
to also return a promise.

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/ocaml-conduit that referenced this issue Apr 20, 2017

Use the Lwt_unix.Versioned.bind_1 API
The latest version of "bind" returns a promise. This patch continues to use
the old version for now.

Related to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/ocaml-conduit that referenced this issue Apr 20, 2017

Use the Lwt_unix.Versioned.bind_1 API
The latest version of "bind" returns a promise. This patch continues to use
the old version for now.

Related to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

djs55 added a commit to djs55/mirage-tcpip that referenced this issue May 13, 2017

Update to lwt.3.0.0
Lwt_unix.bind now returns a promise. This patch uses the versioned
interface to retain compatability with lwt.2.7.0 (and greater)

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>

yallop added a commit to yallop/opam-repository that referenced this issue May 23, 2017

IOCaml 0.4.{6,7,8,9} is incompatible with Lwt >= 3.0.0.
IOCaml uses -strict-sequence, and the type of Lwt.bind has changed
so that it no longer returns unit (ocsigen/lwt#308).

samoht pushed a commit to samoht/mirage-tcpip that referenced this issue May 30, 2017

Update to lwt.3.0.0
Lwt_unix.bind now returns a promise. This patch uses the versioned
interface to retain compatability with lwt.2.7.0 (and greater)

Rleated to ocsigen/lwt#308

Signed-off-by: David Scott <dave@recoil.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment