Git Product home page Git Product logo

meeseeks_html5ever's Introduction

Meeseeks_Html5ever

MeeseeksHtml5ever version tests

Originally a fork of Hansihe's html5ever_elixir that is more tightly coupled with Meeseeks, Meeseeks_Html5ever has grown to include additional functionality, such as use of xml5ever for XML parsing.

Compatibility

Meeseeks_Html5ever requires a minimum combination of Elixir 1.12.0 and Erlang/OTP 23.0, and is tested with a maximum combination of Elixir 1.14.0 and Erlang/OTP 25.0.

Installation

Ensure Rust is installed, then add Meeseeks_Html5ever to your mix.exs:

def deps do
  [
    {:meeseeks_html5ever, "~> 0.14.3"}
  ]
end

Finally, run mix deps.get.

Dependencies

Meeseeks_Html5ever depends on the Rust library html5ever, providing a Rustler-based NIF to interface with it.

You do not need to have Rust installed because the library will attempt to download a precompiled NIF file.

To force compilation you can either set the MEESEEKS_HTML5EVER_BUILD environment variable to true or 1, or add the following application configuration

config :meeseeks_html5ever, MeeseeksHtml5ever, build_from_source: true

If you want to force compilation you will need to have the Rust compiler installed, and will need to add Rustler to your dependencies.

def deps do
  [
    {:meeseeks_html5ever, "~> 0.14.3"},
    {:rustler, ">= 0.0.0", optional: true}
  ]
end

Contributing

If you are interested in contributing please read the contribution guidelines.

License

Licensed under either of

at your option.

meeseeks_html5ever's People

Contributors

jeroenvisser101 avatar mischov avatar overminddl1 avatar sgoettschkes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

meeseeks_html5ever's Issues

Unnecessarily panicking in `get_parent_and_index`

Issue uncovered by @aclemmensen in mischov/meeseeks#26

Problem

Currently get_parent_and_index panics when it is called on a node without a parent

fn get_parent_and_index(&self, child: Id) -> (Id, usize) {
        let maybe_parent = &self.node(child).parent;
        match *maybe_parent {
            Parent::None => panic!("expected parent found none"),
            Parent::Some(parent) => { ... }
        }
    }

When get_parent_and_index is then used by remove_from_parent on a node with no parent, it panics.

The Implementation of a similar function in RcDom returns None instead of panicking, which then allows remove_from_parent to do nothing if a node has no parent.

Solution

Return Option<(Id, usize)> from get_parent_and_index, and DON'T PANIC.

OTP 22 support

Hey folks!

Attempting to compile this on OTP 22 results in:

error: failed to run custom build command for `erlang_nif-sys v0.6.4`
process didn't exit successfully: `/Users/ben/src/sensetra/_build/dev/rustler_crates/meeseeks_html5ever_nif/release/build/erlang_nif-sys-f70957cbbbd4ee34/build-script-build` (exit code: 101)
--- stdout
Unsupported Erlang version.

Is the erlang_nif-sys version up to date in the Cargo.toml?
Does 'cargo update' fix it?
If not please report at https://github.com/goertzenator/erlang_nif-sys.

--- stderr
thread 'main' panicked at 'gen_api.erl encountered an error.', /Users/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/erlang_nif-sys-0.6.4/build.rs:28:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
could not compile dependency :meeseeks_html5ever, "mix compile" failed. You can recompile this dependency with "mix deps.compile meeseeks_html5ever", update it with "mix deps.update meeseeks_html5ever" or clean it with "mix deps.clean meeseeks_html5ever"
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    lib/mix/tasks/compile.rustler.ex:68: Mix.Tasks.Compile.Rustler.compile_crate/1
    (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
    lib/mix/tasks/compile.rustler.ex:15: Mix.Tasks.Compile.Rustler.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/tasks/compile.all.ex:73: Mix.Tasks.Compile.All.run_compiler/2
    (mix) lib/mix/tasks/compile.all.ex:53: Mix.Tasks.Compile.All.do_compile/4
    (mix) lib/mix/tasks/compile.all.ex:24: anonymous fn/1 in Mix.Tasks.Compile.All.run/1
    (mix) lib/mix/tasks/compile.all.ex:40: Mix.Tasks.Compile.All.with_logger_app/1

I'm using the latest rustler from git.

mix compile failed.

==> meeseeks_html5ever
Compiling NIF crate :meeseeks_html5ever_nif (native/meeseeks_html5ever_nif)...
could not compile dependency :meeseeks_html5ever, "mix compile" failed. You can recompile
this dependency with "mix deps.compile meeseeks_html5ever", update it with "mix deps.updat
e meeseeks_html5ever" or clean it with "mix deps.clean meeseeks_html5ever"
** (ErlangError) Erlang error: :enoent
(elixir) lib/system.ex:791: System.cmd("cargo", ["rustc", "--no-default-features", "--
release"], [cd: "/home/ubuntu/sg3-portal/deps/meeseeks_html5ever/native/meeseeks_html5ever
_nif", stderr_to_stdout: true, env: [{"CARGO_TARGET_DIR", "/home/ubuntu/sg3-portal/build/
dev/rustler_crates/meeseeks_html5ever_nif"}], into: %IO.Stream{device: :standard_io, line

or_bytes: :line, raw: false}])
lib/mix/tasks/compile.rustler.ex:51: Mix.Tasks.Compile.Rustler.compile_crate/1
(elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
lib/mix/tasks/compile.rustler.ex:14: Mix.Tasks.Compile.Rustler.run/1
(mix) lib/mix/task.ex:331: Mix.Task.run_task/3
(mix) lib/mix/tasks/compile.all.ex:73: Mix.Tasks.Compile.All.run_compiler/2
(mix) lib/mix/tasks/compile.all.ex:53: Mix.Tasks.Compile.All.do_compile/4
(mix) lib/mix/tasks/compile.all.ex:24: anonymous fn/1 in Mix.Tasks.Compile.All.run/1

Im using Erlang/OTP 21 [erts-10.0], Elixir (1.6.6)

Provide an XML parser

There are people out there trying to use Meeseeks or Floki with XML files, and that can lead to some confusing results (particularly in the case of meeseeks_html5ever and html5ever_elixir, which are HTML5 spec compliant).

Rather than have people reach for the wrong tool because it's the one readily at hand, I'd prefer to provide an XML parser.

Solution

Happily the html5ever project also has a permissive XML parser, xml5ever, and there has recently been work to unify the two so that they can use the same TreeSink (in my case the FlatDom that I convert to a Meeseeks.Document).

Consequently, all that should be required to support an XML parser is to provide functions which allow the use of xml5ever to parse instead of html5ever.

Rustler NIFs don't compile on m1 macbooks

I'm attempting to compile a nif on m1 macbook and i seem to be getting the following error:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-arch" "arm64" "-L" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.0.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.1.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.10.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.11.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.12.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.13.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.14.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.15.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.2.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.3.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.4.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.5.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.6.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.7.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.8.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.9.rcgu.o" "-o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/libchacha20.dylib" "-Wl,-exported_symbols_list,/var/folders/dt/m_txjf8n4pz6lk172r5mvllc0000gn/T/rustcSDfq7t/list" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.51lttcmo14u0j1wn.rcgu.o" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs" "-L" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps" "-L" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/librustler-c7b8861dbac0aea6.rlib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/liblazy_static-cdae5297f94b2fc0.rlib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/librustler_sys-6ffb53a8f5bb9814.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-a77d2ee571f558e4.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-b9303f5dcd4c8d61.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-ae5454bb02d34cb7.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-074193e7ccb12f2d.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-ba7e4c687a24d092.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-592dc2260cf64a27.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-95abce77d407cda5.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-6d0f3b01c36286cc.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-07ad8f4801703872.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-e33a663a2dcce97d.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-d02e2e94e82428e3.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-9911d63dc36d4937.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-f2cc3399f2e93551.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-e12e04ef43bf5ffa.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-d8b74547953a18ba.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv"
  = note: Undefined symbols for architecture arm64:
            "_enif_schedule_nif", referenced from:
                rustler::codegen_runtime::NifReturned::apply::h66ebfff8d05e2be3 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.9.rcgu.o)
            "_enif_make_copy", referenced from:
                rustler::term::Term::in_env::hf82d192ed878f0fb in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.13.rcgu.o)
            "_enif_free_env", referenced from:
                _$LT$rustler..env..OwnedEnv$u20$as$u20$core..ops..drop..Drop$GT$::drop::h07a9eab9739be7ff in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.2.rcgu.o)
            "_enif_alloc_env", referenced from:
                rustler::env::OwnedEnv::new::h6e3186f16a7913f8 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.2.rcgu.o)
            "_enif_make_badarg", referenced from:
                rustler::wrapper::exception::raise_badarg::h4ed8df67b930db8a in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.7.rcgu.o)
            "_enif_make_tuple_from_array", referenced from:
                rustler::wrapper::tuple::make_tuple::hcf60ca038b5c25bd in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.12.rcgu.o)
            "_enif_make_atom_len", referenced from:
                rustler::wrapper::atom::make_atom::h88ec94fbc80324b6 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.12.rcgu.o)
            "_enif_make_long", referenced from:
                rustler_sys::rustler_sys_api::enif_make_int64::h7a6e5230b7325758 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.15.rcgu.o)
            "_enif_raise_exception", referenced from:
                rustler::wrapper::exception::raise_exception::h0c9e9aa57b5d9089 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.7.rcgu.o)
            "_enif_get_long", referenced from:
                rustler_sys::rustler_sys_api::enif_get_int64::he084276bb6f8fc53 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.15.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error; 1 warning emitted

error: could not compile `chacha20`

To learn more, run the command again with --verbose.
pablogrant@Pablos-MacBook-Air src % cargo build
   Compiling chacha20 v0.1.0 (/Users/pablogrant/elixir-projects/paseto/native/chacha20)
warning: function is never used: `main`
 --> src/lib.rs:5:4
  |
5 | fn main() {
  |    ^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.35s
pablogrant@Pablos-MacBook-Air src % cargo build
   Compiling chacha20 v0.1.0 (/Users/pablogrant/elixir-projects/paseto/native/chacha20)
warning: function is never used: `main`
 --> src/lib.rs:5:4
  |
5 | fn main() {
  |    ^^^^
  |
  = note: `#[warn(dead_code)]` on by default

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-arch" "arm64" "-L" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.0.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.1.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.10.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.11.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.12.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.13.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.14.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.15.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.2.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.3.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.4.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.5.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.6.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.7.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.8.rcgu.o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.chacha20.6k3uwcp7-cgu.9.rcgu.o" "-o" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/libchacha20.dylib" "-Wl,-exported_symbols_list,/var/folders/dt/m_txjf8n4pz6lk172r5mvllc0000gn/T/rustcpGmofO/list" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/chacha20.51lttcmo14u0j1wn.rcgu.o" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs" "-L" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps" "-L" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/librustler-c7b8861dbac0aea6.rlib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/liblazy_static-cdae5297f94b2fc0.rlib" "/Users/pablogrant/elixir-projects/paseto/native/chacha20/target/debug/deps/librustler_sys-6ffb53a8f5bb9814.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-a77d2ee571f558e4.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-b9303f5dcd4c8d61.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-ae5454bb02d34cb7.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-074193e7ccb12f2d.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-ba7e4c687a24d092.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-592dc2260cf64a27.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-95abce77d407cda5.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-6d0f3b01c36286cc.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-07ad8f4801703872.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-e33a663a2dcce97d.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-d02e2e94e82428e3.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-9911d63dc36d4937.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-f2cc3399f2e93551.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-e12e04ef43bf5ffa.rlib" "/Users/pablogrant/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-d8b74547953a18ba.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv"
  = note: Undefined symbols for architecture arm64:
            "_enif_schedule_nif", referenced from:
                rustler::codegen_runtime::NifReturned::apply::h66ebfff8d05e2be3 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.9.rcgu.o)
            "_enif_make_copy", referenced from:
                rustler::term::Term::in_env::hf82d192ed878f0fb in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.13.rcgu.o)
            "_enif_free_env", referenced from:
                _$LT$rustler..env..OwnedEnv$u20$as$u20$core..ops..drop..Drop$GT$::drop::h07a9eab9739be7ff in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.2.rcgu.o)
            "_enif_alloc_env", referenced from:
                rustler::env::OwnedEnv::new::h6e3186f16a7913f8 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.2.rcgu.o)
            "_enif_make_badarg", referenced from:
                rustler::wrapper::exception::raise_badarg::h4ed8df67b930db8a in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.7.rcgu.o)
            "_enif_make_tuple_from_array", referenced from:
                rustler::wrapper::tuple::make_tuple::hcf60ca038b5c25bd in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.12.rcgu.o)
            "_enif_make_atom_len", referenced from:
                rustler::wrapper::atom::make_atom::h88ec94fbc80324b6 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.12.rcgu.o)
            "_enif_make_long", referenced from:
                rustler_sys::rustler_sys_api::enif_make_int64::h7a6e5230b7325758 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.15.rcgu.o)
            "_enif_raise_exception", referenced from:
                rustler::wrapper::exception::raise_exception::h0c9e9aa57b5d9089 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.7.rcgu.o)
            "_enif_get_long", referenced from:
                rustler_sys::rustler_sys_api::enif_get_int64::he084276bb6f8fc53 in librustler-c7b8861dbac0aea6.rlib(rustler-c7b8861dbac0aea6.rustler.2a6b77nr-cgu.15.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error; 1 warning emitted

Error when attempting to compile meeseeks_html5ever on M1 Macbook

I'm trying to get meeseeks to run within my project, but meeseeks_html5ever does not compile. I'm seeing the following output to deps.compile (trimmed for readability):

Compiling meeseeks_html5ever_nif v0.13.0 (/Users/sebastian/workspace/meeseeks_test/deps/meeseeks_html5ever/native/meeseeks_html5ever_nif)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,-exported_symbols_list,/var/folders/cs/qdvgc20x4t3_8q80jc7mylpc0000gn/T/rustcC1kRae/list" "-arch" "arm64" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.0.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.1.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.10.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.11.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.12.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.13.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.14.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.15.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.2.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.3.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.4.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.5.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.6.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.7.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.8.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.bcbdbdf5-cgu.9.rcgu.o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.3z0ri4hrxkgcb8gn.rcgu.o" "-L" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps" "-L" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libxml5ever-3c9aa7844d9cd1b3.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libtime-985408a2bd3f221f.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/liblibc-fc6d1371c9ed40c1.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libhtml5ever-abaffb5f1ffa5956.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libmarkup5ever-2b82eb318a29be46.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libtendril-9bfda85fd6eef0e5.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libutf8-68fc3322da07b3de.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libfutf-74bb4790074c3eb2.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libmac-0ba03350b56434cb.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libphf-019ce30e69e481a0.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libstring_cache-5d1a8c79842ae9d7.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libstring_cache_shared-072590d5088db619.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libserde-c4e7b2961eea5e89.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libprecomputed_hash-cddb056d2cb615e9.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libphf_shared-4987174ea7d65abd.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libsiphasher-4f1f24e11c41652f.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libdebug_unreachable-95ba8f269668beb9.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/liblog-20e24bd1524d8c74.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libcfg_if-128d5c2290fa979f.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/librustler-06ed3d621db92764.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/liblazy_static-79cda6058ad2d108.rlib" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/librustler_sys-adeeafb549e0d04f.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libstd-fe51b9edd1d1eaed.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-44199c5b0b3a0970.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libobject-0178d92e8a45283b.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-4174108a800ed70c.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libgimli-f59e2e4344ad4694.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-e31dee0395c6f0ff.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-87a8a17fb40368e9.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-3355699b7a3b475f.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-39a37ce3deee7fd0.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libunwind-591c7780ec815f4f.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-263742f878cd5cbc.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/liblibc-5a0601951d9d7d33.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/liballoc-a36b8c03c80d8f5a.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-347f56b9a3cedfe8.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libcore-ba68e6d9cc991d90.rlib" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-8f4a2de164170192.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/opt/homebrew/Cellar/rust/1.55.0/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/sebastian/workspace/meeseeks_test/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libmeeseeks_html5ever_nif.dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs"
  = note: Undefined symbols for architecture arm64:
            "_enif_make_list_from_array", referenced from:
                rustler::wrapper::list::make_list::hbd1bda88eb7adf93 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.5.rcgu.o)
            "_enif_make_ulong", referenced from:
                rustler::types::primitive::_$LT$impl$u20$rustler..types..Encoder$u20$for$u20$u64$GT$::encode::he49fb40fde4f71ea in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.2.rcgu.o)
            "_enif_alloc_binary", referenced from:
                rustler::types::string::_$LT$impl$u20$rustler..types..Encoder$u20$for$u20$str$GT$::encode::hf11e17216d4e209d in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.6.rcgu.o)
            "_enif_free_env", referenced from:
                _$LT$rustler..env..OwnedEnv$u20$as$u20$core..ops..drop..Drop$GT$::drop::ha10c86909c3bec34 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.14.rcgu.o)
                std::sync::once::Once::call_once::_$u7b$$u7b$closure$u7d$$u7d$::hd2f7ea865264dd2e (.llvm.10254186834831073615) in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.13.rcgu.o)
                core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h1811baefb0585ec1 (.llvm.10254186834831073615) in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.13.rcgu.o)
                core::ptr::drop_in_place$LT$rustler..env..OwnedEnv$GT$::hbc4f5f16205aa6fd in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.13.rcgu.o)
            "_enif_alloc_env", referenced from:
                _$LT$rustler..env..OwnedEnv$u20$as$u20$core..default..Default$GT$::default::hef18b4c0c0013efa in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.14.rcgu.o)
                std::sync::once::Once::call_once::_$u7b$$u7b$closure$u7d$$u7d$::hd2f7ea865264dd2e (.llvm.10254186834831073615) in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.13.rcgu.o)
                core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h1811baefb0585ec1 (.llvm.10254186834831073615) in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.13.rcgu.o)
            "_enif_make_binary", referenced from:
                rustler::types::string::_$LT$impl$u20$rustler..types..Encoder$u20$for$u20$str$GT$::encode::hf11e17216d4e209d in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.6.rcgu.o)
            "_enif_schedule_nif", referenced from:
                rustler::codegen_runtime::NifReturned::apply::h629cc30f6ef60938 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.6.rcgu.o)
            "_enif_raise_exception", referenced from:
                rustler::codegen_runtime::NifReturned::apply::h629cc30f6ef60938 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.6.rcgu.o)
            "_enif_release_binary", referenced from:
                core::ptr::drop_in_place$LT$rustler..types..binary..OwnedBinary$GT$::hb5354ca88619fc61 (.llvm.4781004469425706106) in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.6.rcgu.o)
            "_enif_make_tuple_from_array", referenced from:
                _$LT$rustler..error..Error$u20$as$u20$rustler..codegen_runtime..NifReturnable$GT$::into_returned::h8c893fd57a00bfbb in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.5.rcgu.o)
                rustler::wrapper::tuple::make_tuple::hc68c55a0bbb5c196 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.4.rcgu.o)
            "_enif_make_copy", referenced from:
                _$LT$rustler..term..Term$u20$as$u20$rustler..types..Encoder$GT$::encode::h002f059eebd0fe84 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.1.rcgu.o)
                _$LT$rustler..error..Error$u20$as$u20$rustler..codegen_runtime..NifReturnable$GT$::into_returned::h8c893fd57a00bfbb in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.5.rcgu.o)
            "_enif_inspect_binary", referenced from:
                _$LT$rustler..types..binary..Binary$u20$as$u20$rustler..types..Decoder$GT$::decode::h2a8d27e915fbc323 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.7.rcgu.o)
            "_enif_make_badarg", referenced from:
                rustler::codegen_runtime::NifReturned::apply::h629cc30f6ef60938 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.6.rcgu.o)
            "_enif_make_atom_len", referenced from:
                rustler::types::atom::Atom::from_str::h9996d08dc62aee50 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.8.rcgu.o)
            "_enif_make_map_from_arrays", referenced from:
                rustler::types::map::_$LT$impl$u20$rustler..term..Term$GT$::map_from_arrays::h7d53d07ac3eb86d6 in librustler-06ed3d621db92764.rlib(rustler-06ed3d621db92764.rustler.8d424656-cgu.1.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: could not compile `meeseeks_html5ever_nif` due to previous error

I have installed rust using brew install rust and rust is available:

$ rustc --version
rustc 1.55.0

I'm pretty sure I'm missing something, but I've never worked with Rust or NIFs so I can't really debug the issue.

Warning: Compiling on macOS requires special link args in order to compile correctly

FYI, I'm seeing the following warning when building on macOS BigSur with 0.12.1:

Compiling on macOS requires special link args in order to compile
correctly.

Rustler is currently working around this issue in the compiler task.
This will be removed in v1.0.0 in favor of a user supplied .cargo/config
file.

To remove this warning, please create /Users/me/project/deps/meeseeks_html5ever/native/meeseeks_html5ever_nif/.cargo/config
with the following content:

      [target.x86_64-apple-darwin]
      rustflags = [
          "-C", "link-arg=-undefined",
          "-C", "link-arg=dynamic_lookup",
      ]

See https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/executing_files.html
for more details.

NIF version mismatch 2.15, 2.16

Hello,

I have this error In my CI:

{:error,
 {:load_failed,
  ~c"Failed to load NIF library: '/home/circleci/myapp-build-dir/_build/test/lib/meeseeks_html5ever/priv/native/libmeeseeks_html5ever_nif-v0.14.3-nif-2.16-x86_64-unknown-linux-gnu.so: cannot open shared object file: No such file or directory'"}}

I see the github release only defines nif-2.15 binaries. Is there something I can configure on my side to use those ?

The current nif version seems to be 2.17:

iex(1)> :erlang.system_info :nif_version
~c"2.17"

I guess 2.16 is compatble, but maybe 2.15 is not, so that is why it does not try to download 2.15?

Thank you.

Feature request: RustlerPrecompiled to improve build time

Current behavior

When adding this package as a dependency you must have Rust installed and compile the Nifs locally.
This is not a terrible overhead but could definitely be improved.

Suggested behavior

Using the RustlerPrecompiled module you can deliver compiled Nifs for Linux, Mac and Windows in your releases that can be downloaded automatically during the build of the package, removing the overhead of having to install Rust and compile the Nifs locally.
Since your package already uses GitHub Actions to do some CI testing, it would take just another workflow to implement the Nif build and release.

This behavior has been accomplished in a fork I did of your repository, and I am ready to make a pull request of the changes.
#50

Important details

The RustlerPrecompiled module requires Elixir v1.11 and above to work and your package currently is compatible with v1.7. That change in minimal version might impose some compatibility issues for someone using an older release of Elixir. Also, I still have not made the Nif completely compatible with RustlerPrecompiled, with some Windows builds throwing errors. But this can be solved soon.
The Rust dependencies of the Nif can be upgraded, and doing so, the build works in all OSs. But that would change the Nif API and also would cause incompatibility. Probably a major release would be recommended if you decided to merge the pull request to main.

Unable to get MeeseeksHtml5ever.Native.parse_html/1 to run

Elixir 1.9/OTP 0.21
Meeseeks 0.13.1
Meeseeks_html5ever 0.12.1

I continually get this when trying to parse html with Meeseeks.parse() from my calling module:

(UndefinedFunctionError) function MeeseeksHtml5ever.Native.parse_html/1 is undefined (module MeeseeksHtml5ever.Native is not available)
    (meeseeks_html5ever) MeeseeksHtml5ever.Native.parse_html("<!DOCTYPE html>\n<!-- Created by pdf2htmlEX (https://github.com/coolwanglu/pdf2htmlex) -->\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta charset=\"utf-8\"/>\n<meta name=\"generator\" content=\"pdf2htmlEX\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\"/>\n<style type=\"text/css\">\n/*! \n * Base CSS for pdf2htmlEX\n * Copyright 2012,2013 Lu Wang <[email protected]> \n * https://github.com/coolwanglu/pdf2htmlEX/blob/master/share/LICENSE\n */#sidebar{position:absolute;top:0;left:0;bottom:0;width:250px;padding:0;margin:0;overflow:auto}#page-container{position:absolute;top:0;left:0;margin:0;padding:0;border:0}@media screen{#sidebar.opened+#page-container{left:250px}#page-container{bottom:0;right:0;overflow:auto}.loading-indicator{display:none}.loading-indicator.active{display:block;position:absolute;width:64px;height:64px;top:50%;left:50%;margin-top:-32px;margin-left:-32px}.loading-indicator img{position:absolute;top:0;left:0;bottom:0;right:0}}@media print{@page{margin:0}html{margin:0}body{margin:0;-webkit-print-color-adjust:exact}#sidebar{display:none}#page-container{width:auto;height:auto;overflow:visible;background-color:transparent}.d{display:none}}.pf{position:relative;background-color:white;overflow:hidden;margin:0;border:0}.pc{position:absolute;border:0;padding:0;margin:0;top:0;left:0;width:100%;height:100%;overflow:hidden;display:block;transform-origin:0 0;-ms-transform-origin:0 0;-webkit-transform-origin:0 0}.pc.opened{display:block}.bf{position:absolute;border:0;margin:0;top:0;bottom:0;width:100%;height:100%;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}.bi{position:absolute;border:0;margin:0;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}@media print{.pf{margin:0;box-shadow:none;page-break-after:always;page-break-inside:avoid}@-moz-document url-prefix(){.pf{overflow:visible;border:1px solid #fff}.pc{overflow:visible}}}.c{position:absolute;border:0;padding:0;margin:0;overflow:hidden;display:block}.t{position:absolute;white-space:pre;font-size:1px;transform-origin:0 100%;-ms-transform-origin:0 100%;-webkit-transform-origin:0 100%;unicode-bidi:bidi-override;-moz-font-feature-settings:\"liga\" 0}.t:after{content:''}.t:before{content:'';display:inline-block}.t span{position:relative;unicode-bidi:bidi-override}._{display:inline-block;color:transparent;z-index:-1}::selection{background:rgba(127,255,255,0.4)}::-moz-selection{background:rgba(127,255,255,0.4)}.pi{display:none}.d{position:absolute;transform-origin:0 100%;-ms-transform-origin:0 100%;-webkit-transform-origin:0 100%}.it{border:0;background-color:rgba(255,255,255,0.0)}.ir:hover{cursor:pointer}</style>\n<style type=\"text/css\">\n/*! \n * Fancy styles for pdf2htmlEX\n * Copyright 2012,2013 Lu Wang <[email protected]> \n * https://github.com/coolwanglu/pdf2htmlEX/blob/master/share/LICENSE\n */@keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes swing{0{transform:rotate(0)}10%{transform:rotate(0)}90%{transform:rotate(720deg)}100%{transform:rotate(720deg)}}@-webkit-keyframes swing{0{-webkit-transform:rotate(0)}10%{-webkit-transform:rotate(0)}90%{-webkit-transform:rotate(720deg)}100%{-webkit-transform:rotate(720deg)}}@media screen{#sidebar{background-color:#2f3236;background-image:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjNDAzYzNmIj48L3JlY3Q+CjxwYXRoIGQ9Ik0wIDBMNCA0Wk00IDBMMCA0WiIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2U9IiMxZTI5MmQiPjwvcGF0aD4KPC9zdmc+\")}#outline{font-family:Georgia,Times,\"Times New Roman\",serif;font-size:13px;margin:2em 1em}#outline ul{padding:0}#outline li{list-style-type:none;margin:1em 0}#outline li>ul{margin-left:1em}#outline a,#outline a:visited,#outline a:hover,#outline a:active{line-height:1.2;color:#e8e8e8;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;display:block;overflow:hidden;outline:0}#outline a:hover{color:#0cf}#page-container{background-color:#9e9e9e;background-image:" <> ...)
    (meeseeks_html5ever) lib/meeseeks_html5ever.ex:12: MeeseeksHtml5ever.parse_html/1
    (meeseeks) lib/meeseeks/parser.ex:15: Meeseeks.Parser.parse/1
    (junior) lib/junior.ex:159: anonymous fn/1 in Junior.parse/2
    (progress_bar) lib/progress_bar/spinner.ex:30: ProgressBar.Spinner.render/2
    (junior) lib/junior.ex:19: Junior.start/1
    (elixir) lib/kernel/cli.ex:121: anonymous fn/3 in Kernel.CLI.exec_fun/2

I was able to successfully parse with floki + html5ever but would prefer to use meeseeks. Any suggestions/thoughts?

Use dirty scheduler instead of async

Currently meeseeks_html5ever works asynchronously, calling the NIF then receiving a response, but since the minimum supported version of Erlang/OTP is now 20 we can start using dirty schedulers instead.

This should simplify the NIF's implementation since it can work synchronously and hopefully get rid of a little performance overhead.

Element namespace and tag splitting is broken

Problem

split_ns_and_tag uses split_at, which means that if a namespace exists the : separating ns and tag is included in tag.

Solution

Don't include the :.

Either trim or use method that doesn't include, such as splitn.

Compilation error with ERTS 9.2

Attempts to compile with ERTS 9.2 yield following error

error: failed to run custom build command for `erlang_nif-sys v0.6.2`

Unable to compile with ERTS 9.2, due to issue with Rustler and erlang_nif-sys. See: rusterlium/rustler#115

Awaiting release of Rustler containing merged fix.

compilation failed with elixir 1.8.1-otp-21 & erlang 22.3.4.26

error message:


==> meeseeks_html5ever
Compiling NIF crate :meeseeks_html5ever_nif (native/meeseeks_html5ever_nif)...
Compiling markup5ever v0.7.5
Compiling erlang_nif-sys v0.6.4
Compiling rustler v0.20.0
error: failed to run custom build command for erlang_nif-sys v0.6.4

Caused by:
process didn't exit successfully: /Users/57block/work/messages/_build/dev/rustler_crates/meeseeks_html5ever_nif/release/build/erlang_nif-sys-652fa8f99a73d793/build-script-build (exit status: 101)
--- stdout
Unsupported Erlang version.

Is the erlang_nif-sys version up to date in the Cargo.toml?
Does 'cargo update' fix it?
If not please report at https://github.com/goertzenator/erlang_nif-sys.

--- stderr
thread 'main' panicked at 'gen_api.erl encountered an error.', /Users/57block/.cargo/registry/src/index.crates.io-6f17d22bba15001f/erlang_nif-sys-0.6.4/build.rs:28:22
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for rustler v0.20.0

Caused by:
process didn't exit successfully: /Users/57block/work/messages/_build/dev/rustler_crates/meeseeks_html5ever_nif/release/build/rustler-6cf301e09488846d/build-script-build (exit status: 101)
--- stderr
thread 'main' panicked at 'Erlang version 2.15 not handled, please file a a bug report.', /Users/57block/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustler-0.20.0/build.rs:51:10

rustc 1.72.1

I tried cargo update in the nif folder and i did't help as well.

issue with tendril

remote: Compiling tendril v0.4.1
remote: error[E0793]: reference to packed field is unaligned
remote: --> /tmp/codon/tmp/cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/tendril-0.4.1/src/tendril.rs:241:20
remote: |
remote: 241 | if (*header).refcount.decrement() == 1 {
remote: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
remote: |
remote: = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
remote: = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
remote: = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use read_unaligned/write_unaligned (loads and stores via *p must be properly aligned even when using raw pointers)
remote:
remote: error[E0793]: reference to packed field is unaligned
remote: --> /tmp/codon/tmp/cache/cargo/registry/src/index.crates.io-6f17d22bba15001f/tendril-0.4.1/src/tendril.rs:958:9
remote: |
remote: 958 | (*self.header()).refcount.increment();
remote: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
remote: |
remote: = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
remote: = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
remote: = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use read_unaligned/write_unaligned (loads and stores via *p must be properly aligned even when using raw pointers)
remote:
remote: For more information about this error, try rustc --explain E0793.
remote: error: could not compile tendril (lib) due to 2 previous errors
remote: warning: build failed, waiting for other jobs to finish...
remote: could not compile dependency :meeseeks_html5ever, "mix compile" failed. You can recompile this dependency with "mix deps.compile meeseeks_html5ever", update it with "mix deps.update meeseeks_html5ever" or clean it with "mix deps.clean meeseeks_html5ever"
remote: ** (RuntimeError) Rust NIF compile error (rustc exit code 101)
remote: lib/mix/tasks/compile.rustler.ex:67: Mix.Tasks.Compile.Rustler.compile_crate/1
remote: (elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
remote: lib/mix/tasks/compile.rustler.ex:14: Mix.Tasks.Compile.Rustler.run/1
remote: (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
remote: (mix) lib/mix/tasks/compile.all.ex:68: Mix.Tasks.Compile.All.run_compiler/2
remote: (mix) lib/mix/tasks/compile.all.ex:52: Mix.Tasks.Compile.All.do_compile/4
remote: (mix) lib/mix/tasks/compile.all.ex:23: anonymous fn/1 in Mix.Tasks.Compile.All.run/1
remote: (mix) lib/mix/tasks/compile.all.ex:39: Mix.Tasks.Compile.All.with_logger_app/1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.