|
| 1 | +--- |
| 2 | +title: OCaml 5.0.0 - First Beta |
| 3 | +tags: [ocaml] |
| 4 | +unstable: true |
| 5 | +changelog: | |
| 6 | + ## Changes Since Last Alpha Release |
| 7 | +
|
| 8 | + ### `Stdlib` Changes |
| 9 | +
|
| 10 | + + [#11309](https://github.com/ocaml/ocaml/issues/11309), [#11424](https://github.com/ocaml/ocaml/issues/11424), [#11427](https://github.com/ocaml/ocaml/issues/11427), +[#11545](https://github.com/ocaml/ocaml/issues/11545): Add Domain.recommended_domain_count. |
| 11 | + (Christiano Haesbaert, Konstantin Belousov, review by David Allsopp, |
| 12 | + KC Sivaramakrishnan, Gabriel Scherer, Nicolas Ojeda Bar) |
| 13 | +
|
| 14 | + - [#11423](https://github.com/ocaml/ocaml/issues/11423): Move the effect exceptions to the Effect module |
| 15 | + (KC Sivaramakrishnan, Xavier Leroy, Florian Angeletti, review by |
| 16 | + Florian Angeletti, Xavier Leroy, and KC Sivaramakrishnan) |
| 17 | +
|
| 18 | + - [#11593](https://github.com/ocaml/ocaml/issues/11593): Remove Domain.at_each_spawn |
| 19 | + (Florian Angeletti, review by Guillaume Munch-Maccagnoni |
| 20 | + and KC Sivaramakrishnan) |
| 21 | +
|
| 22 | + ### Bug Fixes |
| 23 | +
|
| 24 | + - [#11303](https://github.com/ocaml/ocaml/issues/11303): Ensure that GC is not invoked from bounds check failures |
| 25 | + (Stephen Dolan, review by Sadiq Jaffer and Xavier Leroy) |
| 26 | +
|
| 27 | + - [#5299](https://github.com/ocaml/ocaml/issues/5299), [#4787](https://github.com/ocaml/ocaml/issues/4787), [#11138](https://github.com/ocaml/ocaml/issues/11138), [#11272](https://github.com/ocaml/ocaml/issues/11272), [#11506](https://github.com/ocaml/ocaml/issues/11506): To help debugging, `Caml_state` |
| 28 | + now dynamically checks that the domain lock is held and fails |
| 29 | + otherwise (with a fatal error at most entry points of the C API, or |
| 30 | + systematically in debug mode). A new variable `Caml_state_opt` is |
| 31 | + introduced and is `NULL` when the domain lock is not held. This |
| 32 | + allows to test from C code if the current thread holds its domain lock. |
| 33 | + (Guillaume Munch-Maccagnoni, review by Florian Angeletti, Damien |
| 34 | + Doligez, Sadiq Jaffer, Xavier Leroy, and Gabriel Scherer) |
| 35 | +
|
| 36 | + - [#11223](https://github.com/ocaml/ocaml/issues/11223): The serialisation format of custom blocks changed in 4.08, |
| 37 | + but the deserialiser would still support the pre-4.08 format. OCaml |
| 38 | + 5.x removed support for this old format and provided a clear error message |
| 39 | + in this case. |
| 40 | + (Hugo Heuzard, review by Gabriel Scherer) |
| 41 | +
|
| 42 | + - [#11504](https://github.com/ocaml/ocaml/issues/11504), [#11522](https://github.com/ocaml/ocaml/issues/11522): Use static allocation for `caml_make_float_vect` in |
| 43 | + no-flat-float-array mode, it's more efficient and avoids a race condition |
| 44 | + (Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by David Allsopp) |
| 45 | +
|
| 46 | + - [#11461](https://github.com/ocaml/ocaml/issues/11461), [#11466](https://github.com/ocaml/ocaml/issues/11466): Fix `gethostbyaddr` for IPv6 arguments and make it domain-safe |
| 47 | + (Olivier Nicole, Nicolás Ojeda Bär, David Allsopp and Xavier Leroy, |
| 48 | + review by the same) |
| 49 | +
|
| 50 | + - [#11479](https://github.com/ocaml/ocaml/issues/11479): Make Unix.symlink domain-safe on Windows |
| 51 | + (Olivier Nicole, review by Xavier Leroy and David Allsopp) |
| 52 | +
|
| 53 | + - [#11294](https://github.com/ocaml/ocaml/issues/11294): Switch minimum required autoconf to 2.71. |
| 54 | + (David Allsopp, review by Xavier Leroy) |
| 55 | +
|
| 56 | + - [#11370](https://github.com/ocaml/ocaml/issues/11370), [#11373](https://github.com/ocaml/ocaml/issues/11373): Don't pass CFLAGS to flexlink during configure. |
| 57 | + (David Allsopp, report by William Hu, review by Xavier Leroy and |
| 58 | + Sébastien Hinderer) |
| 59 | +
|
| 60 | + - [#11487](https://github.com/ocaml/ocaml/issues/11487): Thwart FMA test optimization during configure |
| 61 | + (William Hu, review by David Allsopp and Sébastien Hinderer) |
| 62 | +
|
| 63 | + - [#11468](https://github.com/ocaml/ocaml/issues/11468): Fix regression from [#10186](https://github.com/ocaml/ocaml/issues/10186) (OCaml 4.13) detecting IPv6 on Windows for |
| 64 | + mingw-w64 i686 port. |
| 65 | + (David Allsopp, review by Xavier Leroy and Sébastien Hinderer) |
| 66 | +
|
| 67 | + - [#11482](https://github.com/ocaml/ocaml/issues/11482), [#11542](https://github.com/ocaml/ocaml/issues/11542): Fix random crash in large closure allocation |
| 68 | + (Damien Doligez, report by Thierry Martinez and Vincent Laviron, review by |
| 69 | + Xavier Leroy) |
| 70 | +
|
| 71 | + - [#11508](https://github.com/ocaml/ocaml/issues/11508), [#11509](https://github.com/ocaml/ocaml/issues/11509): make Bytes.escaped domain-safe |
| 72 | + (Christiano Haesbaert and Gabriel Scherer, |
| 73 | + review by Xavier Leroy, |
| 74 | + report by Jan Midtgaard and Tom Kelly) |
| 75 | +
|
| 76 | + - [#11516](https://github.com/ocaml/ocaml/issues/11516), [#11524](https://github.com/ocaml/ocaml/issues/11524): Fix the `deprecated_mutable` attribute. |
| 77 | + (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti) |
| 78 | +
|
| 79 | + - [#11576](https://github.com/ocaml/ocaml/issues/11576): Fix bug in Bigarray.Genarray.init in the the case of zero-dimensional |
| 80 | + arrays. |
| 81 | + (Nicolás Ojeda Bär, Jeremy Yallop, report by Masayuki Takeda, review by Jeremy |
| 82 | + Yallop and Florian Angeletti) |
| 83 | +
|
| 84 | + - [#11587](https://github.com/ocaml/ocaml/issues/11587): Prevent integer comparison from being used on pointers |
| 85 | + (Vincent Laviron, review by Gabriel Scherer) |
| 86 | +
|
| 87 | + ### Documentation Changes |
| 88 | +
|
| 89 | + - [#11093](https://github.com/ocaml/ocaml/issues/11093): Add tutorials on parallelism features and the relaxed memory model |
| 90 | + (KC Sivaramakrishnan, review by Damien Doligez, Anil Madhavapeddy, Gabriel |
| 91 | + Scherer, Thomas Leonard, Tom Ridge, Xavier Leroy, Luc Maranget, Fabrice |
| 92 | + Buoro, Olivier Nicole, Guillaume Munch-Maccagnoni, Jacques-Henri Jourdan) |
| 93 | +--- |
| 94 | + |
| 95 | +The release of OCaml 5.0.0 is drawing near. |
| 96 | +The standard library has been stabilized and many opam packages already |
| 97 | +work with this release. |
| 98 | +After two alpha releases, we have released the first beta version to help you update your software and libraries ahead of the release (see below for the installation instructions). |
| 99 | + |
| 100 | +If you find any bugs, please report them [on GitHub issues](https://github.com/ocaml/ocaml/issues). |
| 101 | + |
| 102 | +Compared to the last alpha release, this beta contains many small, internal |
| 103 | +runtime fixes (in particular in the `systhreads` library). |
| 104 | + |
| 105 | +At the user level, the interface of the Domain and Effect module has been tweaked to be (hopefully) more forward-compatible: |
| 106 | + |
| 107 | +- Exceptions related to effects are now defined in the Effecŧ module. |
| 108 | +- The value `Domain.recommended_domain_count` is no longer a constant and the function `Domain.at_each_spawn` has been removed. |
| 109 | + |
| 110 | +With those changes, the standard library should be stable now. |
| 111 | + |
| 112 | +If you are interested in the ongoing list of bug fixes, the |
| 113 | +updated change log for OCaml 5.0.0 is available [on GitHub](https://github.com/ocaml/ocaml/blob/5.0/Changes). |
| 114 | + |
| 115 | +You can also follow the state of the opam ecosystem on [this `opam-repository` issues](https://github.com/ocaml/opam-repository/issues/21526), and at [check.ocamllabs.io](http://check.ocamllabs.io/) |
| 116 | + |
| 117 | +A short summary of the changes since the last alpha release is also available |
| 118 | +below. |
| 119 | + |
| 120 | + |
| 121 | +Installation Instructions |
| 122 | +------------------------- |
| 123 | + |
| 124 | +The base compiler can be installed as an opam switch with the following commands |
| 125 | +on opam 2.1: |
| 126 | +```bash |
| 127 | +opam update |
| 128 | +opam switch create 5.0.0~beta1 |
| 129 | +``` |
| 130 | + |
| 131 | +For previous versions of opam, the switch creation command line is slightly more verbose: |
| 132 | +```bash |
| 133 | +opam update |
| 134 | +opam switch create 5.0.0~beta1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git |
| 135 | +``` |
| 136 | + |
| 137 | +It might also be interesting to check the new support for parallelism by installing |
| 138 | +the `domainslib` library with |
| 139 | + |
| 140 | +```bash |
| 141 | +opam install domainslib |
| 142 | +``` |
| 143 | + |
| 144 | +The source code for the beta release is also available at these addresses: |
| 145 | + |
| 146 | +* [https://github.com/ocaml/ocaml/archive/5.0.0-beta1.tar.gz](https://github.com/ocaml/ocaml/archive/5.0.0-beta1.tar.gz) |
| 147 | +* [https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0~beta1.tar.gz](https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0~beta1.tar.gz) |
| 148 | + |
| 149 | +## Fine-Tuned Compiler Configuration |
| 150 | + |
| 151 | +If you want to tweak the configuration of the compiler, you can switch to the option variant with: |
| 152 | +```bash |
| 153 | +opam update |
| 154 | +opam switch create <switch_name> ocaml-variants.5.0.0~beta1+options <option_list> |
| 155 | +``` |
| 156 | +where `option_list` is a comma-separated list of `ocaml-option-*` packages. For instance, for a `flambda` and `no-flat-float-array` switch: |
| 157 | +```bash |
| 158 | +opam switch create 5.0.0~beta1+flambda+nffa ocaml-variants.5.0.0~beta1+options ocaml-option-flambda ocaml-option-no-flat-float-array |
| 159 | +``` |
| 160 | +The command line above is slightly more complicated for opam versions before 2.1: |
| 161 | +```bash |
| 162 | +opam update |
| 163 | +opam switch create <switch_name> --packages=ocaml-variants.5.0.0~beta1+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git |
| 164 | +``` |
| 165 | + |
| 166 | +In both cases, all available options can be listed with `opam search ocaml-option`. |
| 167 | + |
| 168 | +## Optional opam Alpha Repository |
| 169 | + |
| 170 | +During the beta release, if your dependencies are not yet compatible with OCaml 5.0.0, |
| 171 | +you might want to check the alpha opam repository: [https://github.com/kit-ty-kate/opam-alpha-repository](https://github.com/kit-ty-kate/opam-alpha-repository). |
| 172 | + |
| 173 | +Which can be installed with |
| 174 | +```bash |
| 175 | +opam repo add alpha git+https://github.com/kit-ty-kate/opam-alpha-repository.git |
| 176 | +``` |
| 177 | +You can check that the alpha repository has been correctly installed with |
| 178 | +```bash |
| 179 | +$ opam repo |
| 180 | +<><> Repository configuration for switch 5.0.0~beta1 <><><><><><><><><><><><><> |
| 181 | + 1 alpha git+https://github.com/kit-ty-kate/opam-alpha-repository.git |
| 182 | + 2 default https://opam.ocaml.org |
| 183 | +``` |
| 184 | +This alpha repository contains various fixes that are in the process of being upstreamed, |
| 185 | +but it should be less and less required with the progress of the beta release. |
0 commit comments