# OTP 25.0-rc2 (Release Candidate 2) is released

**URL:** <https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246>\
**Category:** Erlang News\
**Tags:** erlang-release\
**Created:** [March 24, 2022, 11:19am UTC](https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246 "2022-03-24T11:19:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![proxyles](https://erlangforums.com/letter_avatar_proxy/v4/letter/p/9de053/32.png) [@proxyles](https://erlangforums.com/u/proxyles)\
**Post date:** [March 24, 2022, 11:19am UTC](https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246/1 "2022-03-24T11:19:37Z")

</div>

# OTP 25-rc2

Erlang/OTP 25-rc2 is the second release candidate of three before the OTP 25.0 release.

The intention with this release is to get feedback from our users. All feedback is welcome, even if it is only to say that it works for you. We encourage users to try it out and give us feedback either by creating an issue here [GitHub · Where software is built](https://github.com/erlang/otp/issues) or by posting to [Erlangforums](https://erlangforums.com) or the mailing list [erlang-questions@erlang.org](mailto:erlang-questions@erlang.org).

All artifacts for the release can be downloaded from the [Erlang/OTP Github](https://github.com/erlang/otp/releases/tag/OTP-25.0-rc2) release and you can view the new documentation at [Erlang/OTP 25.0 Release Candidate 2](https://erlang.org/documentation/doc-13.0-rc2/doc/). You can also install the latest release using [kerl](https://github.com/kerl/kerl) like this: `kerl build 25.0-rc2 25.0-rc2`.

Erlang/OTP 25 is a new major release with new features, improvements as well as a few incompatibilities. Some of the new features are highlighted below.

Many thanks to all contributors!

Below are some highlights of the release:

## Highlights rc2

### stdlib

- New function `filelib:ensure_path/1` will ensure that all directories for the given path exists
- New functions `groups_from_list/2` and `groups_from_list/3` in the `maps` module
- New functions `uniq/1` `uniq/2` in the lists module

### compiler, kernel, stdlib, syntax\_tools

- Added support for selectable features as described in [`EEP-60`](https://www.erlang.org/eeps/eep-0060). Features can be enabled/disabled during compilation with options (ordinary and +term) to `erlc` as well as with directives in the file. Similar options can be used to `erl` for enabling/disabling features allowed at runtime. The new `maybe` expression [`EEP-49`](https://www.erlang.org/eeps/eep-0049) is fully supported as the feature maybe\_expr.

For more details about new features and potential incompatibilities see

- [https://erlang.org/download/otp\_src\_25.0-rc2.readme](https://erlang.org/download/otp_src_25.0-rc2.readme)

## Highlights rc1

### erts & jit

- The JIT now works for 64-bit ARM processors.
- The JIT now does type-based optimizations based on type information in the BEAM files.
- Improved the JIT’s support for external tools like `perf` and `gdb`, allowing them to show line numbers and even the original Erlang source code when that can be found.

### erts, stdlib, kernel

- Users can now configure ETS tables with the `{write_concurrency, auto}` option. This option forces tables to automatically change the number of locks that are used at run-time depending on how much concurrency is detected. The `{decentralized_counters, true}` option is enabled by default when `{write_concurrency, auto}` is active.Benchmark results comparing this option with the other ETS optimization options are available here: [benchmarks](https://erlang.org/bench/ets_bench_result_lock_config.html).
- To enable more optimizations, BEAM files compiled with OTP 21 and earlier cannot be loaded in OTP 25.
- The signal queue of a process with the process flag `message_queue_data=off_heap` has been optimized to allow parallel reception of signals from multiple processes. This can improve performance when many processes are sending in parallel to one process. [See benchmark](https://erlang.org/bench/sigq_bench_result.html).
- The Erlang installation directory is now relocatable on the file system given that the paths in the installation’s RELEASES file are paths that are relative to the installations root directory.
- A new option called `short` has been added to the functions `erlang:float_to_list/2` and `erlang:float_to_binary/2`. This option creates the shortest correctly rounded string representation of the given float that can be converted back to the same float again.
- Introduction of `quote/1` and `unquote/1` functions in the `uri_string` module - a replacement for the deprecated functions `http_uri:encode` and `http_uri:decode`.
- The new module `peer` supersedes the `slave` module. The `slave` module is now deprecated and will be removed in OTP 27.
- `global` will now by default prevent overlapping partitions due to network issues. This is done by actively disconnecting from nodes that reports that they have lost connections to other nodes. This will cause fully connected partitions to form instead of leaving the network in a state with overlapping partitions.It is possible to turn off the new behavior by setting the the `kernel` configuration parameter `prevent_overlapping_partitions` to `false`. Doing this will retain the same behavior as in OTP 24 and earlier.
- The `format_status/2` callback for `gen_server`, `gen_statem` and `gen_event` has been deprecated in favor of the new `format_status/1` callback.The new callback adds the possibility to limit and change many more things than the just the state.
- The `timer` module has been modernized and made more efficient, which makes the timer server less susceptible to being overloaded. The `timer:sleep/1` function now accepts an arbitrarily large integer.

### Compiler

- The `maybe ... end` construction as proposed in [`EEP-49`](https://www.erlang.org/eeps/eep-0049) has been implemented. It can simplify complex code where otherwise deeply nested cases would have to be used.To enable `maybe`, give the option `{enable_feature,maybe_expr}` to the compiler. The exact option to use will change in a coming release candidate and then it will also be possible to use from inside the module being compiled.
- When a record matching or record update fails, a `{badrecord, ExpectedRecordTag}` exception used to be raised. In this release, the exception has been changed to `{badrecord, ActualValue}`, where `ActualValue` is the value that was found instead of the expected record.
- Add compile attribute `-nifs()` to empower compiler and loader with information about which functions may be overridden as NIFs by `erlang:load_nif/2`.
- Improved and more detailed error messages when binary construction with the binary syntax fails. This applies both for error messages in the shell and for `erl_error:format_exception/3,4`.

### Crypto

- Add `crypto:hash_equals/2` which is a constant time comparision of hashvalues.

### Dialyzer

- Optimize operations in the `erl_types` module. Parallelize the Dialyzer pass remote.
- Added the `missing_return` and `extra_return` options to raise warnings when specifications differ from inferred types. These are similar to, but not quite as verbose as overspecs and underspecs.
- Dialyzer now better understands the types for `min/2`, `max/2`, and `erlang:raise/3`. Because of that, Dialyzer can potentially generate new warnings. In particular, functions that use `erlang:raise/3` could now need a spec with a `no_return()` return type to avoid an unwanted warning.

### Misc

- A new [DEVELOPMENT HOWTO guide](https://github.com/erlang/otp/blob/master/HOWTO/DEVELOPMENT.md) has been added that describes how to build and test Erlang/OTP when fixing bugs or developing new functionality.
- Testing has been added to the Github actions run for each opened PR so that more bugs are caught earlier when bug fixes and new features are proposed.

For more details about new features and potential incompatibilities see

- [https://erlang.org/download/otp\_src\_25.0-rc1.readme](https://erlang.org/download/otp_src_25.0-rc1.readme)

---

<div class="post-metadata">

**Author:** ![bjorng](https://erlangforums.com/user_avatar/erlangforums.com/bjorng/32/174_2.png) [@bjorng](https://erlangforums.com/u/bjorng)\
**Post date:** [March 24, 2022, 11:53am UTC](https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246/2 "2022-03-24T11:53:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [March 25, 2022, 9:22am UTC](https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246/3 "2022-03-25T09:22:40Z")

</div>

I tried the new `maybe...else...end` (just because) and stumbled at the first hurdle because I named my test file `maybe.erl`. I have not tried naming a module as a reserved keyword before; perhaps unsurprisingly it is not allowed, but the error could be more helpful. E.g. for `case.erl`:

```erlang
$ erlc case.erl
case.erl:1:13: syntax error before: ')'
% 1| -module(case).
% | ^

case.erl:3:2: no module definition
% 3| -export([test/0]).
% | ^

```

In case it is of use to someone, the command for compiling a single file with `maybe` feature support is:

```erlang
erlc -enable-feature maybe_expr <file.erl>

```

Then start the shell with:

```erlang
erl -enable-feature maybe_expr

```

---

<div class="post-metadata">

**Author:** ![vinoski](https://erlangforums.com/user_avatar/erlangforums.com/vinoski/32/265_2.png) [@vinoski](https://erlangforums.com/u/vinoski)\
**Post date:** [March 25, 2022, 12:21pm UTC](https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246/4 "2022-03-25T12:21:09Z")

</div>

Just reporting that Yaws builds correctly and passes all tests with 25.0-rc2.

---

<div class="post-metadata">

**Author:** ![dischoen](https://erlangforums.com/user_avatar/erlangforums.com/dischoen/32/695_2.png) [@dischoen](https://erlangforums.com/u/dischoen)\
**Post date:** [March 27, 2022, 3:46pm UTC](https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246/5 "2022-03-27T15:46:28Z")

</div>

I tried the new peer module.  
I think I will use it a lot for distributed tests,  
it is like having containers directly in erlang.

In my view, the documentation could be enhanced by explicitly stating that in order  
to use the default connection mechanism, the origin must be running with distribution enabled.  
Otherwise you get these not\_alive errors.

Also, when using long names, it is important to have a fully qualified domainname.  
I have it now. 😉  
I had a real nice Sunday afternoon playing around and learning peer and ct.

---

<div class="post-metadata">

**Author:** ![dischoen](https://erlangforums.com/user_avatar/erlangforums.com/dischoen/32/695_2.png) [@dischoen](https://erlangforums.com/u/dischoen)\
**Post date:** [March 28, 2022, 1:39pm UTC](https://erlangforums.com/t/otp-25-0-rc2-release-candidate-2-is-released/1246/6 "2022-03-28T13:39:19Z")

</div>

I have an unexpected behaviour with peer and 25.0rc2 here.

Test case: create three nodes a,b and c (short names) and let a ping b and c.  
If I do this manually in three shells, it works as expected: each nodes sees the other two.

If I try the same via peer, b and c only see a:

```erlang
test() ->
    {ok, PidA, NodeA} = peer:start_link(#{name => a, connection => standard_io}),
    {ok, PidB, NodeB} = peer:start_link(#{name => b, connection => standard_io}),
    {ok, PidC, NodeC} = peer:start_link(#{name => c, connection => standard_io}),

    pong = peer:call(PidA, net_adm, ping, [NodeB]),
    pong = peer:call(PidA, net_adm, ping, [NodeC]),

    ['b@zed', 'c@zed'] = peer:call(PidA, erlang, nodes, []),
    ['a@zed'] = peer:call(PidB, erlang, nodes, []),
    ['a@zed'] = peer:call(PidC, erlang, nodes, []),

    peer:stop(PidA),
    peer:stop(PidB),
    peer:stop(PidC).

```

From what I can see, the peer nodes are neither `-hidden` nor do they have the flag `-connect_all` disabled.

Any ideas?
