Repository navigation
Description
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(Lwt_unix.bind should be in the monad #230, Cooperative Lwt_unix.bind (sockets) #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.bindcurrently evaluates to unit, and the newbindinternally 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 sequencingbind. However, you will start getting warnings like this after Lwt 3.0.0:Warning 10: this expression should have type unitThe semantics are not guaranteed for the future, so this is not recommended.
Lwt_unix.bindis used in packages:0installarakoonbencode_rpcconduitdatakitdatakit-clientdatakit-serverdatakit-githubdhtdns-forwardimaplet-lwtlwt-parallelmirage-conduitmirage-dnsmirage-netmirage-net-directmirage-net-socketmirage-tcpip-unixmirage-tcpip-xennbdobusocplib-concurocsigenserveroscprotocol-9preleasesocket-daemontcpiptlstyperex-lldbutpvhd-toolvpnkitxapi-idlxentropydskkserv-litetlstunnelreceive-mailiocaml
-
Lwt_io.establish_server(Safer alternative to Lwt_io.establish_server #258, Replace establish_server by establish_server_safe #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_serveris used in packages:distributedimaplet-lwtmqttusbmux
-
Lwt_io.shutdown_server(Lwt_io.shutdown_server should evaluate to a thread #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_serveris used in packages:distributedimaplet-lwtusbmux
-
Lwt_engine.libev(Add support for selecting the libev backend #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.libevis used indatakit.
-
Findlib packages
lwt.ssl,lwt.glib, andlwt.reactare being replaced by Findlib packageslwt_ssl,lwt_glib, andlwt_react, available now in new OPAM packages with those same names.lwt.ssl,lwt.glib, andlwt.reactwill be removed from OPAM packagelwtin 3.0.0. See Begin factoring out Lwt_ssl, Lwt_glib, Lwt_react #301.The old (current) package names are used in:
0installarakoonconduiteliomimapjoologlambda-termmirage-conduitobusocsigenserverusbxexen-api-client
Activity
aantron commentedon Jan 6, 2017
aantron commentedon Jan 6, 2017
cc @talex5 @domsj @toolslive @rgrinberg @c-cube @samoht @yomimono @avsm @djs55 @gregtatcam @ivg @diml @lefessan @vasilisp @johnelse @andrenth @zoggy @hannesm @pqwy @nojb @jonludlam @anyakichi @dominicjprice @essdotteedot @j0sh @fxfactorial @andrewray @vouillon @hhugo @smondet
talex5 commentedon 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).server: Update API to use more recent Lwt.
j0sh commentedon Feb 15, 2017
@aantron this was super helpful, thanks for the in-depth descriptions of the changes, and tagging all the relevant maintainers.
mqtt: Constrain lwt version to <= 2.7.0.
Update to new lwt.3.0.0 API
Update to lwt.3.0.0
Update to lwt.3.0.0
Update to lwt.3.0.0
Update to lwt.3.0.0
Update to lwt.3.0.0
Update to lwt.3.0.0
aantron commentedon 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.
Update to lwt.3.0.0 (#48)
Update to the Lwt_unix.Versioned.bind_2 API
Use the Lwt_unix.Versioned.bind_1 API
Use the Lwt_unix.Versioned.bind_1 API
Update to lwt.3.0.0
IOCaml 0.4.{6,7,8,9} is incompatible with Lwt >= 3.0.0.
Update to lwt.3.0.0