-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Lwt 3.2.0 #11071
Lwt 3.2.0 #11071
Conversation
❗ opam-lint warnings 1f29c5e
✅ Installability check (8007 → 8012)
|
Disappointingly, the CI setup that rebuilds Lwt's online manual is down, and has been for months. As a result, the new reference docs for module |
Okay, don't merge this. It seems the change to |
Alright, the problem is as follows:
There are several ways to solve this problem. I'd like to gather opinions on it.
cc @rgrinberg @diml |
FYI removing these lines from
changes the error message, when compiling a project that does use threads (transitively), but fails to pass the
to
But it also allows a project that does not use threads at all (does not pull in a module that uses them), but does depend on a library that depends on
I'd say these lines are too restrictive, and we should remove them. |
To summarize more clearly, I have a toy library that unconditionally depends on I have two toy ocamlfind projects, one which uses only the part of the library that does not use These two projects are tested in two cases each, with the Here is the output in all four cases:
And I claim we want to go from the behavior in 1, 2 to the one in 3, 4. |
I looked through all the logs. All the builds failing due to Lwt are failing due to the above problem. I tried installing some of the packages locally, and all would be fixed by deleting those |
Opened https://gitlab.camlcity.org/gerd/lib-findlib/merge_requests/9 against Findlib. Not sure if it's reasonable to block Lwt 3.2.0 on a release of Findlib, though. |
We can probably stop putting the transitive closure in META files generated by jbuilder. It's likely we'll need to do it for ocaml/dune#136 anyway |
Removing the transitive closure would allow us to work around the problem by having a custom I guess releasing either Jbuilder without transitive closure, or Findlib without We could also unblock in Lwt, by either including a custom Not sure what's the least painful here :p |
@aantron FWIW my point of view: I'm a happy lwt and lwt.unix user, but usually use OCaml compilers without threading support. I'd be happy to keep the preemptive module separate (and not as part of lwt.unix). But if your changes / fixes require preemptive now being part of lwt.unix, then move along and we can fix up all the (broken) reverse dependencies. Since from I read here, you plan to do this change for 4.0.0 anyways, there's imho not much gained to delay the breaking change (we'll need to fix the libraries anyways). |
@hannesm Actually this is useful to know, as it should stop us from merging |
BTW, even if we change jbuilder and/or findlib, is it going to work for people who are currently linking against |
@aantron it turns out while my |
@diml If we change the However, I suspect I removed the If we can use opam as a proxy for the whole OCaml world, I'd say we don't really have to worry about @hannesm Thanks for checking that. Can you say what the error was on installation? I'm not aware of a non-threads system I have easy access to. I guess I could build a custom compiler.. We still have three months before fully committing to this, so please let us know if you become aware of some system where Lwt is used, but which does not have compiler (or system) threads. |
lwt 3.1.0, stderr:
lwt.3.0.0 (and below), stderr:
stdout:
|
Why is |
@hannesm yeah, Lwt 3.1.0 accidentally made building In any case, in the future, if we, for instance, switch to libuv, all of this will be obsolete, and I am not yet sure if we will be able to support non-threaded builds at all even in principle. Please let me know if non-threaded builds are important on some platform where I/others working on Lwt have blind spots. It will help to make wiser decisions :) @talex5 Synchronous state querying is deliberately not supported by JavaScript promises. It's actually quite a pain not to have it. I'm not sure we would truly deprecate it in Lwt, but it seems reasonable to encourage people not to use it if they don't really need it. |
@aantron I guess it is fine to require a multi-threaded OCaml runtime, and only had the illusion that I used one without threads ;) |
Ok, I added an opam patch to this PR to work around the What the patch does is inline the I believe the content of the Using the |
Adding
due, presumably, to Now waiting for the CI. |
Ok, none of the remaining revdeps failures are due to Lwt 3.2.0. The Ubuntu failure seems to be spurious, perhaps a network problem. I guess merging this PR in its current form depends on whether the |
@aantron thanks for working on this! to avoid potential issues, I propose to bump the version number of ocamlfind (to |
@hannesm It sounds reasonable. I think we should change the |
@aantron oh yes, adjusting the constraint in the dependency is perfectly fine. i somehow conjectured since lwt uses jbuilder, there won't be any ocamlfind dependency... |
The modified ocamlfind 1.7.3 is packaged as ocamlfind 1.7.3-1.
I just replaced the last commit, which added the patch to Thanks for the suggestion, it's definitely important to add a constraint on |
All seems good in CI. |
Thanks! You may want to announce this on https://discuss.ocaml.org, where we have a Community category and an |
This is part of merging lwt.preemptive into lwt.unix without breaking downstream packages. See ocaml/opam-repository#11071 (comment) See also #487.
Lwt is a promise and concurrency library for OCaml.
Release 3.2.0 continues the ongoing Lwt cleanup, adds some features, and fixes several bugs. It also schedules some breaking changes for Lwt 4.0.0, which is to be released in March 2018. See ocsigen/lwt#453 for a summary of these breaking changes, and help with adapting ahead of time.
From the changelog:
Additions
Lwt_mvar.take_available
,Lwt_mvar.is_empty
(Add Lwt_mvar.(take_available, is_empty) ocsigen/lwt#459, Hezekiah Carty).Lwt_io.open_temp_file
,Lwt_io.with_temp_file
(Issue #336: Add temporary file creation capabilities to Lwt_io ocsigen/lwt#467, Joe Thomas).Lwt
(New reference docs for module Lwt ocsigen/lwt#469).Lwt_pool.clear
and?dispose
argument forLwt_pool.create
(Support disposal of Lwt_pool.t elements ocsigen/lwt#483, Hezekiah Carty).Lwt_pool.wait_queue_length
(EAGAIN when a new system thread can't be created ocsigen/lwt#493, Jerome Vouillon).Bugs fixed
Lwt.npick
never worked (Npick fix ocsigen/lwt#447, Zack Coker).Lwt_pool.use
now always calls?validate
on elements (Bugfix: Adjust validation behavior of Lwt_pool.use ocsigen/lwt#461, Joe Thomas).Lwt_unix
whenpthread_create
fails (EAGAIN when a new system thread can't be created ocsigen/lwt#493, @koen-struyve).Lwt_list
(Improve exception safety of some Lwt_list APIs ocsigen/lwt#499).Lwt_unix.getnameinfo
(lwt_unix_free_job if getnameinfo was successfull ocsigen/lwt#503, Hannes Mehnert).Planned to break in 4.0.0
See ocsigen/lwt#453 for details and instructions about planned breakage in Lwt 4.0.0.
lwt_ppx
. This package is installable from opam now, as of Lwt 3.2.0 (Move the PPX to a separate package (?) ocsigen/lwt#338).lwt_camlp4
, which is installable from opam now (Move Camlp4 syntax to a separate package ocsigen/lwt#370).Lwt_log
,Lwt_log_core
,Lwt_log_rules
, andLwt_daemon
are being deprecated and factored out into opam packagelwt_log
, also installable from opam now. Use the logs library for logging, in particular moduleLogs_lwt
. Direct daemonization is deprecated on most platforms (attempt to move lwt.log into separate lwt_log ocsigen/lwt#484, Hannes Mehnert).>>
construct from the PPX will be deleted (Deprecate >> in ppx ocsigen/lwt#471, Raphaël Proust).lwt.preemptive
is being merged intolwt.unix
. In 3.2.0,lwt.preemptive
becomes an alias forlwt.unix
, and the package namelwt.preemptive
will be deleted in 4.0.0 (Make lwt.preemptive an alias for lwt.unix; remove it in 4.0.0 ocsigen/lwt#487).Deprecations
Lwt.waiter_of_wakener
should not be used, as it can lead to soundness bugs in future (but not current) Lwt (Contravariance of Lwt resolvers is unsound ocsigen/lwt#458).Lwt_sequence
was deprecated in Lwt 2.6.0, but it now has a warning attached, as doLwt.add_task_r
andLwt.add_task_l
, which use it (Factor out Lwt_sequence (doubly-linked list) ocsigen/lwt#361).Lwt.with_value
,Lwt.cancel
,Lwt.state
,Lwt.ignore_result
(Discussion: deprecate Lwt.ignore_result ocsigen/lwt#359, New reference docs for module Lwt ocsigen/lwt#469).Miscellaneous
Lwt_pool
(Issue #385: Increase test coverage for Lwt_pool. ocsigen/lwt#464, Joe Thomas).