diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b94aaebdd..3cd4fc85a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,8 +62,8 @@ jobs: - name: Install Erlang/Elixir uses: erlef/setup-elixir@v1 with: - otp-version: 22.1.3 - elixir-version: 1.9.2 + otp-version: "22.3.4" + elixir-version: "1.11.4" - name: Check cargo fmt uses: actions-rs/cargo@v1 @@ -93,8 +93,8 @@ jobs: - name: Install Erlang/Elixir uses: erlef/setup-elixir@v1 with: - otp-version: 22.x - elixir-version: 1.6 + otp-version: "24.1.7" + elixir-version: 1.13 - name: Test rustler_mix working-directory: rustler_mix @@ -140,26 +140,13 @@ jobs: strategy: matrix: pair: - - erlang: "24.0" - elixir: "1.12.2" - - erlang: "24.0" - elixir: "1.11.4" - - erlang: "23.3" - elixir: "1.11.4" - - - erlang: "23.0.3" - elixir: "1.10.3" - - - erlang: 22.x - elixir: "1.10.1" - - erlang: 22.x - elixir: 1.9 - - erlang: 22.x - elixir: 1.8 - - erlang: 22.x - elixir: 1.7 - - erlang: 22.x - elixir: 1.6 + - { erlang: "24.1.7", elixir: "1.13.0" } + - { erlang: "24.1.7", elixir: "1.12.3" } + - { erlang: "24.1.7", elixir: "1.11.4" } + + - { erlang: "23.3.4", elixir: "1.11.4" } + + - { erlang: "22.3.4", elixir: "1.11.4" } rust: - stable diff --git a/CHANGELOG.md b/CHANGELOG.md index 387345425..4fc625ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,16 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 See [`UPGRADE.md`](./UPGRADE.md) for additional help when upgrading to newer versions. -## [Unreleased] +## [0.23.0] - 2021-12-22 ### Added - `NifException` for using Elixir exception structs +- Hashing for term +- Hash and Equality for `Binary` and `OwnedBinary` ### Changed +- Rustler changed its supported range of OTP and Elixir versions. We aim to support the three newest versions of OTP and Elixir. - The decoder for `Range` requires that `:step` equals `1`. The `:step` field was introduced with Elixir v1.12 and cannot be represented with Rust's `RangeInclusive`. +- NIF API bindings are generated using Rust + +## Fixed + +- `mix rustler.new` with Elixir v1.13 +- Template config for `macos` +- Crash if metadata cannot be retrieved while compiling (#398) ## [0.22.2] - 2021-10-07 diff --git a/README.md b/README.md index 0beae225f..c61b2408b 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ rustler::init!("Elixir.Math", [add]); #### Supported OTP and Elixir Versions -Rustler aims to support the newest three OTP versions as well as Elixir versions capable of running the supported versions of OTP. +Rustler aims to support the newest three major OTP versions as well as newest three minor Elixir versions. #### Supported NIF version diff --git a/rustler/Cargo.toml b/rustler/Cargo.toml index 85d42516d..89579d120 100644 --- a/rustler/Cargo.toml +++ b/rustler/Cargo.toml @@ -2,7 +2,7 @@ name = "rustler" description = "Safe Rust wrappers for creating Erlang NIF functions" repository = "https://github.com/rusterlium/rustler" -version = "0.22.2" # rustler version +version = "0.23.0" # rustler version authors = ["Hansihe "] license = "MIT/Apache-2.0" readme = "../README.md" @@ -15,7 +15,7 @@ alternative_nif_init_name = [] [dependencies] lazy_static = "1.4" -rustler_codegen = { path = "../rustler_codegen", version = "0.22.2", optional = true} +rustler_codegen = { path = "../rustler_codegen", version = "0.23.0", optional = true} rustler_sys = { path = "../rustler_sys", version = "~2.1" } [package.metadata.release] diff --git a/rustler_codegen/Cargo.toml b/rustler_codegen/Cargo.toml index 157fbf76f..4931d94f2 100644 --- a/rustler_codegen/Cargo.toml +++ b/rustler_codegen/Cargo.toml @@ -2,7 +2,7 @@ name = "rustler_codegen" description = "Compiler plugin for Rustler" repository = "https://github.com/rusterlium/rustler/tree/master/rustler_codegen" -version = "0.22.2" # rustler_codegen version +version = "0.23.0" # rustler_codegen version authors = ["Hansihe "] license = "MIT/Apache-2.0" readme = "../README.md" diff --git a/rustler_mix/README.md b/rustler_mix/README.md index f79188bb3..93aceb98e 100644 --- a/rustler_mix/README.md +++ b/rustler_mix/README.md @@ -15,7 +15,7 @@ This package is available on [Hex.pm](https://hex.pm/packages/rustler). To insta ```elixir def deps do [ - {:rustler, "~> 0.22.2"} + {:rustler, "~> 0.23.0"} ] end ``` diff --git a/rustler_mix/lib/mix/tasks/rustler.new.ex b/rustler_mix/lib/mix/tasks/rustler.new.ex index 465508ab6..824e91b2b 100644 --- a/rustler_mix/lib/mix/tasks/rustler.new.ex +++ b/rustler_mix/lib/mix/tasks/rustler.new.ex @@ -30,7 +30,7 @@ defmodule Mix.Tasks.Rustler.New do end end - @switches [:module, :name, :otp_app] + @switches [module: :string, name: :string, otp_app: :string] def run(argv) do {opts, _argv, _} = OptionParser.parse(argv, switches: @switches) diff --git a/rustler_mix/lib/rustler.ex b/rustler_mix/lib/rustler.ex index 9fae6b733..79a1374f2 100644 --- a/rustler_mix/lib/rustler.ex +++ b/rustler_mix/lib/rustler.ex @@ -127,7 +127,7 @@ defmodule Rustler do end @doc false - def rustler_version, do: "0.22.2" + def rustler_version, do: "0.23.0" @doc """ Supported NIF API versions. diff --git a/rustler_mix/mix.exs b/rustler_mix/mix.exs index 33d28e92c..e8e142c5e 100644 --- a/rustler_mix/mix.exs +++ b/rustler_mix/mix.exs @@ -2,14 +2,14 @@ defmodule Rustler.Mixfile do use Mix.Project @source_url "https://github.com/rusterlium/rustler" - @version "0.22.2" + @version "0.23.0" def project do [ app: :rustler, name: "Rustler", version: @version, - elixir: "~> 1.6", + elixir: "~> 1.11", build_embedded: Mix.env() == :prod, start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/rustler_mix/test.sh b/rustler_mix/test.sh index 8bfd3e685..cb8906852 100755 --- a/rustler_mix/test.sh +++ b/rustler_mix/test.sh @@ -39,7 +39,7 @@ defmodule TestRustlerMix.MixProject do [ app: :test_rustler_mix, version: "0.1.0", - elixir: "~> 1.6", + elixir: "~> 1.11", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/rustler_tests/mix.exs b/rustler_tests/mix.exs index daa116e32..101fdf6eb 100644 --- a/rustler_tests/mix.exs +++ b/rustler_tests/mix.exs @@ -5,7 +5,7 @@ defmodule RustlerTest.Mixfile do [ app: :rustler_test, version: "0.0.1", - elixir: "~> 1.2", + elixir: "~> 1.11", compilers: [:rustler] ++ Mix.compilers(), build_embedded: Mix.env() == :prod, start_permanent: Mix.env() == :prod, diff --git a/rustler_tests/test/binary_example_test.exs b/rustler_tests/test/binary_example_test.exs index 1d3a2dc9c..d52105c5c 100644 --- a/rustler_tests/test/binary_example_test.exs +++ b/rustler_tests/test/binary_example_test.exs @@ -13,11 +13,11 @@ defmodule BinaryExampleTest do assert_exists(name, :os.type()) end - defp assert_exists(name, {:win32, _} = type) do + defp assert_exists(name, {:win32, _} = _type) do assert File.exists?("priv/native/#{name}.exe") end - defp assert_exists(name, type) do + defp assert_exists(name, _type) do assert File.exists?("priv/native/#{name}") end end