Skip to content

Commit

Permalink
Merge pull request #546 from filmor/drop-rustler-nif-version-env
Browse files Browse the repository at this point in the history
Drop support for RUSTLER_NIF_VERSION
  • Loading branch information
filmor authored Jun 22, 2023
2 parents b1a4da7 + 3ccd2d5 commit 5aa3f18
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 75 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ See [`UPGRADE.md`](./UPGRADE.md) for additional help when upgrading to newer ver

## [unreleased]

### Added

### Changed

* Dropped support for `RUSTLER_NIF_VERSION`

## [0.29.0] - 2023-06-22

### Added
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ enabled on the dependency:
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
55 changes: 0 additions & 55 deletions build_common.rs

This file was deleted.

8 changes: 0 additions & 8 deletions rustler/build.rs

This file was deleted.

1 change: 0 additions & 1 deletion rustler/build_common.rs

This file was deleted.

12 changes: 4 additions & 8 deletions rustler_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
//
// Generate the NIF APIs that will be built in `src/rustler_sys_api.rs`.
//
// This script rely on the `RUSTLER_NIF_VERSION` environment variable
// and will fallback to the installed OTP version to detect the version.
// If none of them are available, then we are going to use the latest version.
//

use regex::Regex;
use std::fmt::Write;
use std::path::Path;
use std::{env, fs};

pub const MIN_SUPPORTED_VERSION: (u32, u32) = (2, 14);
pub const MAX_SUPPORTED_VERSION: (u32, u32) = (2, 17);

const SNIPPET_NAME: &str = "nif_api.snippet";

trait ApiBuilder {
Expand Down Expand Up @@ -880,9 +879,6 @@ fn build_api(b: &mut dyn ApiBuilder, opts: &GenerateOptions) {
}
}

include!("build_common.rs");
use common::*;

fn get_nif_version_from_features() -> (u32, u32) {
for major in ((MIN_SUPPORTED_VERSION.0)..=(MAX_SUPPORTED_VERSION.0)).rev() {
for minor in ((MIN_SUPPORTED_VERSION.1)..=(MAX_SUPPORTED_VERSION.1)).rev() {
Expand All @@ -898,7 +894,7 @@ fn get_nif_version_from_features() -> (u32, u32) {
}

fn main() {
let nif_version = handle_nif_version_from_env().unwrap_or_else(get_nif_version_from_features);
let nif_version = get_nif_version_from_features();

let target_family = if cfg!(target_family = "windows") {
OsFamily::Win
Expand Down

0 comments on commit 5aa3f18

Please sign in to comment.