Skip to content

Commit 963395b

Browse files
committed
Try using Rustler Precompiled
1 parent 1a2e004 commit 963395b

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

lib/components_guide/rustler/math.ex

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
defmodule ComponentsGuide.Rustler.Math do
22
# use Rustler, otp_app: :components_guide, crate: :componentsguide_rustler_math
33
# use Rustler, otp_app: :components_guide, crate: :componentsguide_rustler_math, target_dir: System.tmp_dir!()
4-
use Rustler, otp_app: :components_guide, crate: :componentsguide_rustler_math, cargo: {:rustup, :stable}
4+
# use Rustler, otp_app: :components_guide, crate: :componentsguide_rustler_math, cargo: {:rustup, :stable}
5+
6+
version = Mix.Project.config()[:version]
7+
8+
use RustlerPrecompiled,
9+
otp_app: :rustler_precompilation_example,
10+
crate: "example",
11+
base_url:
12+
"https://github.com/ComponentsGuide/components_guide/releases/download/v#{version}",
13+
force_build: System.get_env("RUSTLER_PRECOMPILATION_EXAMPLE_BUILD") in ["1", "true"],
14+
version: version
515

616
def add(_, _), do: error()
717

mix.exs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
defmodule ComponentsGuide.MixProject do
22
use Mix.Project
33

4+
@version "0.1.0"
5+
46
def project do
57
[
68
app: :components_guide,
7-
version: "0.1.0",
9+
version: @version,
810
elixir: "~> 1.12",
911
elixirc_paths: elixirc_paths(Mix.env()),
1012
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
@@ -58,7 +60,7 @@ defmodule ComponentsGuide.MixProject do
5860
{:earmark, "~> 1.4.15"},
5961
{:paredown, "~> 0.1.0"},
6062
{:ex_image_info, "~> 0.2.4"},
61-
{:rustler, "~> 0.25.0"},
63+
{:rustler_precompiled, "~> 0.2.0"},
6264
{:benchee, "~> 1.0", only: :dev},
6365
{:reverse_proxy_plug, "~> 1.3.1", only: :dev}
6466
]

mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
5353
"reverse_proxy_plug": {:hex, :reverse_proxy_plug, "1.3.3", "758d927fde8fa2ebaaf0d034848d1c29b5bc106dd38c759e1f34183b2d07fc2e", [:mix], [{:cowboy, "~> 2.4", [hex: :cowboy, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.2", [hex: :httpoison, repo: "hexpm", optional: false]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "4f9bd590e9c34402373753f2df9dcf57c7085977265940e99ff0eb769e9dd71c"},
5454
"rustler": {:hex, :rustler, "0.25.0", "32526b51af7e58a740f61941bf923486ce6415a91c3934cc16c281aa201a2240", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:toml, "~> 0.6", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "6b43a11a37fe79c6234d88c4102ab5dfede7a6a764dc5c7b539956cfa02f3cf4"},
55+
"rustler_precompiled": {:hex, :rustler_precompiled, "0.2.0", "8cb0fb2527d51de624e91b45e0a2b12c92e1cb614f8616f8dfc07c3d1180f48a", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "583be3d480fa292770d45d4e20418ad81b6d9acd2bc42d8776e79f4a283cbae4"},
5556
"sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"},
5657
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
5758
"statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"},

0 commit comments

Comments
 (0)