From 827e5dd65851eba935fb623c8531f7ff718bf8d7 Mon Sep 17 00:00:00 2001 From: Philip Sampaio Date: Wed, 20 Oct 2021 15:39:34 -0300 Subject: [PATCH 1/2] Remove remaning code from unsupported NIF versions This is a complement to https://github.com/rusterlium/rustler/pull/387 --- README.md | 4 ++-- rustler/build.rs | 2 +- rustler_mix/lib/rustler.ex | 7 ------- rustler_sys/gen_api.erl | 1 - 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c0fbc511..0b685330 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,10 @@ Rustler aims to support the newest three OTP versions as well as Elixir versions 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.7` (Erlang/OTP 17.3), this can be defined using an environment variable: +version should be `2.14` (Erlang/OTP 21), this can be defined using an environment variable: ``` -RUSTLER_NIF_VERSION=2.7 mix compile +RUSTLER_NIF_VERSION=2.14 mix compile ``` #### Community diff --git a/rustler/build.rs b/rustler/build.rs index 9d17cfb8..714176ca 100644 --- a/rustler/build.rs +++ b/rustler/build.rs @@ -4,7 +4,7 @@ use std::process::Command; // keep this sorted by version number const NIF_VERSION: &[&str] = &[ - "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", + "2.14", "2.15", "2.16", ]; fn main() { diff --git a/rustler_mix/lib/rustler.ex b/rustler_mix/lib/rustler.ex index d45edcef..b6fd9aa2 100644 --- a/rustler_mix/lib/rustler.ex +++ b/rustler_mix/lib/rustler.ex @@ -125,13 +125,6 @@ defmodule Rustler do """ def nif_versions, do: [ - '2.7', - '2.8', - '2.9', - '2.10', - '2.11', - '2.12', - '2.13', '2.14', '2.15', '2.16' diff --git a/rustler_sys/gen_api.erl b/rustler_sys/gen_api.erl index 10426b4f..4d6b336d 100644 --- a/rustler_sys/gen_api.erl +++ b/rustler_sys/gen_api.erl @@ -15,7 +15,6 @@ getenv | % enif_getenv() functions time | % new timer API {ulongsize, integer()} | % number of bytes in a C ulong - dirty_schedulers | % enif_is_on_dirty_scheduler(). Only for 2.7-2.10 dirty_scheduler_opt | % dirty scheduler nifentry option flag. For >=2.7 nif_2_11 . % general 2.11 API additions From 60a9762e310f44541c4a04f7fa0faa171522ec2a Mon Sep 17 00:00:00 2001 From: Philip Sampaio Date: Wed, 20 Oct 2021 17:29:20 -0300 Subject: [PATCH 2/2] Format rustler/build.rs --- rustler/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rustler/build.rs b/rustler/build.rs index 714176ca..e7c7453e 100644 --- a/rustler/build.rs +++ b/rustler/build.rs @@ -3,9 +3,7 @@ use std::env; use std::process::Command; // keep this sorted by version number -const NIF_VERSION: &[&str] = &[ - "2.14", "2.15", "2.16", -]; +const NIF_VERSION: &[&str] = &["2.14", "2.15", "2.16"]; fn main() { let latest_version = NIF_VERSION.last().unwrap().to_string();