Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor committed May 25, 2023
1 parent a91549f commit a2ac3e3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ See [`UPGRADE.md`](./UPGRADE.md) for additional help when upgrading to newer ver

## [unreleased]

### Changed

* Use Cargo features to define the NIF version level (#537), deprecating
`RUSTLER_NIF_VERSION`

## [0.28.0] - 2023-04-24

### Added
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ Rustler aims to support the newest three major OTP versions as well as newest th

#### Supported NIF version

Rustler uses `erlang:system_info(nif_version)` to detect the supported NIF version of the Erlang/OTP
system for which the NIF is to be compiled. It is possible to restrict the NIF version to an older
version if the NIF is to be compiled for an older version of Erlang. For example, if the target NIF
version should be `2.14` (Erlang/OTP 21), this can be defined using an environment variable:

```
RUSTLER_NIF_VERSION=2.14 mix compile
The minimal supported NIF version for a library should be defined via Cargo
features. The default is currently `2.14` (Erlang/OTP 21). To use features from
NIF version `2.16` (Erlang/OTP 24), the respective feature flag has to be
enabled on the dependency:

```toml
[dependencies]
rustler = { version = "...", features = ["nif_version_2_16"] }
```

For compatibility reasons, this can be defined (and overridden) by setting the
`RUSTLER_NIF_VERSION` environment variable during build.

#### Community

You can find us in the `#rustler:matrix.org` channel on [Matrix](https://matrix.to/#/#rustler:matrix.org)
Expand Down
19 changes: 19 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

This document is intended to simplify upgrading to newer versions by extending the changelog.

## 0.28 -> 0.29

`RUSTLER_NIF_VERSION` is deprecated and will not be considered anymore for 0.30.
The NIF version will also not be guessed anymore from a potentially available
installed Erlang version. By default, NIF libraries will now be compiled against
NIF version 2.14 which is compatible down to OTP21. The default will be adjusted
along with the supported OTP versions.

If additional features are required that use newer NIF versions, these can be
included explicitly in the project's `Cargo.toml` as, e.g.

```toml
[dependencies]
rustler = { version = "0.30", features = ["nif_version_2_17"] }
```

With this configuration, the resulting NIF library will only work from OTP26
onwards, but will also have access to the largest feature set.

## 0.26 -> 0.27

`MIX_ENV` is no longer considered for determining the build profile. Now, the
Expand Down

0 comments on commit a2ac3e3

Please sign in to comment.