Skip to content

Commit e3b3b7b

Browse files
authored
Update rustler_precompiled to v0.2.0 (#48)
* Update `rustler_precompiled` to v0.2.0 This simplifies the way we define the module since the lib will fallback to Rustler in case of "forced build". * Set version to a pre-release
1 parent e5535d9 commit e3b3b7b

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

lib/html5ever/native.ex

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@ defmodule Html5ever.Native do
66
version = mix_config[:version]
77
github_url = mix_config[:package][:links]["GitHub"]
88

9-
rustler_opts = [otp_app: :html5ever, crate: "html5ever_nif", mode: :release]
10-
env_config = Application.get_env(rustler_opts[:otp_app], Html5ever, [])
9+
env_config = Application.get_env(:html5ever, Html5ever, [])
1110

1211
# This module will be replaced by the NIF module after
1312
# loaded. It throws an error in case the NIF can't be loaded.
14-
if System.get_env("HTML5EVER_BUILD") in ["1", "true"] or env_config[:build_from_source] do
15-
use Rustler, rustler_opts
16-
else
17-
use RustlerPrecompiled,
18-
rustler_opts ++
19-
[
20-
base_url: "#{github_url}/releases/download/v#{version}",
21-
version: version
22-
]
23-
end
13+
use RustlerPrecompiled,
14+
otp_app: :html5ever,
15+
crate: "html5ever_nif",
16+
mode: :release,
17+
base_url: "#{github_url}/releases/download/v#{version}",
18+
force_build:
19+
System.get_env("HTML5EVER_BUILD") in ["1", "true"] or env_config[:build_from_source],
20+
version: version
2421

2522
def parse_sync(_binary), do: err()
2623
def parse_dirty(_binary), do: err()

mix.exs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Html5ever.Mixfile do
22
use Mix.Project
33

4-
@version "0.11.0"
4+
@version "0.12.0-dev"
55
@repo_url "https://github.com/rusterlium/html5ever_elixir"
66

77
def project do
@@ -24,8 +24,7 @@ defmodule Html5ever.Mixfile do
2424

2525
defp deps do
2626
[
27-
{:rustler, "~> 0.23.0"},
28-
{:rustler_precompiled, "~> 0.1.0"},
27+
{:rustler_precompiled, "~> 0.2"},
2928
{:ex_doc, ">= 0.0.0", only: :dev}
3029
]
3130
end

mix.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"earmark_parser": {:hex, :earmark_parser, "1.4.19", "de0d033d5ff9fc396a24eadc2fcf2afa3d120841eb3f1004d138cbf9273210e8", [:mix], [], "hexpm", "527ab6630b5c75c3a3960b75844c314ec305c76d9899bb30f71cb85952a9dc45"},
44
"ex_doc": {:hex, :ex_doc, "0.28.0", "7eaf526dd8c80ae8c04d52ac8801594426ae322b52a6156cd038f30bafa8226f", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "e55cdadf69a5d1f4cfd8477122ebac5e1fadd433a8c1022dafc5025e48db0131"},
55
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
6-
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
6+
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
77
"makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"},
88
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
9-
"nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"},
9+
"nimble_parsec": {:hex, :nimble_parsec, "1.2.2", "b99ca56bbce410e9d5ee4f9155a212e942e224e259c7ebbf8f2c86ac21d4fa3c", [:mix], [], "hexpm", "98d51bd64d5f6a2a9c6bb7586ee8129e27dfaab1140b5a4753f24dac0ba27d2f"},
1010
"rustler": {:hex, :rustler, "0.23.0", "87162ffdf5a46b6aa03d624a77367070ff1263961ae35332c059225e136c4a87", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:toml, "~> 0.5.2", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "f5ab6f0ec564f5569009c0f5685b0e5b379fd72655e82a8dc5a3c24f9fdda36a"},
11-
"rustler_precompiled": {:hex, :rustler_precompiled, "0.1.0", "815bff532c9410fd03ae9b54307eec7763d59cda3243529bcd1aa879e54ce450", [:mix], [{:castore, "~> 0.1.14", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "86e6c097667f29ee3cdeae7acf3706c439327a4cafb6ea9dded64f7482f63887"},
11+
"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"},
1212
"toml": {:hex, :toml, "0.5.2", "e471388a8726d1ce51a6b32f864b8228a1eb8edc907a0edf2bb50eab9321b526", [:mix], [], "hexpm", "f1e3dabef71fb510d015fad18c0e05e7c57281001141504c6b69d94e99750a07"},
1313
}

0 commit comments

Comments
 (0)