policy question with respect to data races in opam packages and OCaml 5 upper bounds
hannesm opened this issue · 2 comments
Dear Madam or Sir,
I understand that some people want to use OCaml 5. I also know that some opam packages are racy -- which is commonly not an issue at all, but with OCaml 5 this is more likely to become an issue.
So, my question is about policy: if a package that has races compiles fine with OCaml 5, and the test are running fine, should it nevertheless be restricted to "ocaml" {< "5"}
? I'm asking since I don't quite understand what the expectation is from people trying out OCaml 5 -- also I'm asking since it seems not (easily) doable to setup a opam-repo-CI check that tests each opam package for race conditions.
Given that in OCaml 5, lots of users still only use a single core (or a specific library on a single core only), restricting to < 5 also sounds pretty restrictive.
Have there been previous discussions about that? The package I'm talking about is mirage-crypto (as well as nocrypto).
OCaml 5 was designed specifically to allow for running OCaml 4 and below code on the OCaml 5 compiler with minimal modifications and no change in behaviour, thus allowing for the migration to multiple cores as a separate step.
Therefore, it would be a real barrier to migration if parallel-unsafe code were disallowed via an upper bound to OCaml 5 in opam packages! The vast majority of code I run on OCaml 5 is still single-core, and that's completely ok.
There have been other approaches to documented the parallel safety of dependencies:
- documentation (e.g. ocaml/ocaml#11237)
- annotations for unsynchronized access (e.g. https://github.com/ocaml/ocaml/pull/11193/files)
- whole-program race detectors like TSAN (e.g. https://discuss.ocaml.org/t/ann-tsan-support-in-ocaml-5-1-and-blog-post/13306)
Thanks @avsm for your opinion. I'm myself not using OCaml 5 anywhere, and just want to gather some feedback / opinions about what a potential OCaml 5 user could expect of the opam-repository packages. I understand your perspective, while it may be frustrating for new users that find every 2 seconds a data race - but c'est la vie.