mischov / meeseeks_html5ever

Meeseeks-specific NIF binding of html5ever using Rustler.
Apache License 2.0
10 stars 15 forks source link

Feature request: RustlerPrecompiled to improve build time #51

Closed un3481 closed 1 year ago

un3481 commented 2 years ago

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.

mischov commented 2 years ago

Thank you for the suggestion and your work to implement it.

I will investigate and get back to you once I have reviewed or if I have questions.

Meeseeks's current minimum supported version of Elixir is 1.7, and even once 1.14 is released my typical version support would move to 1.9 being the minimum version. This is potentially a larger set of supported versions than is really needed but I prefer to provide people a large grace period.

I am curious if there is a way to continue to support 1.9 for the un-precompiled version while making precompiled versions available for users of 1.11 and later?

un3481 commented 2 years ago

I will check the possibility of supporting the older versions. I believe this can be done by selectively compiling either Rustler or the Precompiled module but I am not sure of the best way to do it.

mischov commented 2 years ago

Just wanted to let you know this is still on my radar. I've been really busy the past several weeks so this hasn't been something I've been able to spend a lot of time on yet.

I did a quick check on the Elixir forums to try and make sure that moving up versions so much wouldn't cause any problems for people and it doesn't seem like it will, so I'm leaning towards going that route.

I'll keep you updated as I figure out more.

Manzanit0 commented 1 year ago

Not sure how relevant it is, but just dropping the comment here in case it is: I recently attempted to compile an old project which used meeseeks_html5ever in an Apple silicon computer and it's been a bit more challenging. I wonder if that might be something to consider for bundling the binary.

mischov commented 1 year ago

@Manzanit0 Thank you for the heads up and the reminder about this- it's been an insanely busy year for me and I haven't had an opportunity to focus on this issue. Apologies to anybody that this has been inconveniencing.

Regarding Apple Silicon compilation, the latest version (v0.13.1) should have added support for that- were you using that version? If you were already using that version and still had problems, can you describe the issues you faced a bit? Precompilation or not I would like to address those problems if it's something that makes sense to address in Meeseeks.

Manzanit0 commented 1 year ago

To be honest, I actually didn't solve it. I just dockerised the app and started working with it that way. I don't have any Rust knowledge, and I wasn't really keen on going down that rabbit hole.

If you want to take a look, find below my specic versions and compilation problem, but don't feel like you have to take a look :)

Proof of what's running:

$ cat mix.exs | grep meeseeks
      {:meeseeks, "~> 0.16.1", override: true},
      {:meeseeks_html5ever, "~> 0.13.1", override: true},

$ cat .tool-versions
elixir 1.12.3-otp-24
erlang 24.3.4.6
nodejs 17.3.0

$ elixir --version
Erlang/OTP 24 [erts-12.3.2.6] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1]

Elixir 1.12.3 (compiled with Erlang/OTP 24)

$ rustc --version
rustc 1.66.0 (69f9c33d7 2022-12-12)

The actual compilation issue:

$ mix deps.compile meeseeks_html5ever
==> meeseeks_html5ever
Compiling 2 files (.ex)
Compiling crate meeseeks_html5ever_nif in release mode (native/meeseeks_html5ever_nif)
   Compiling rand_core v0.4.0
   Compiling libc v0.2.48
   Compiling semver-parser v0.7.0
   Compiling autocfg v0.1.2
   Compiling proc-macro2 v0.4.27
   Compiling unicode-xid v0.1.0
   Compiling siphasher v0.2.3
   Compiling serde v1.0.88
   Compiling string_cache_shared v0.3.0
   Compiling ryu v0.2.7
   Compiling rand_core v0.3.1
   Compiling semver v0.9.0
   Compiling phf_shared v0.7.24
   Compiling itoa v0.4.3
   Compiling rand_xorshift v0.1.1
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling rand_isaac v0.1.1
   Compiling rustc_version v0.2.3
   Compiling rand_hc v0.1.0
   Compiling proc-macro2 v1.0.27
   Compiling new_debug_unreachable v1.0.2
   Compiling rand_pcg v0.1.1
   Compiling lazy_static v1.4.0
   Compiling mac v0.1.1
   Compiling unicode-xid v0.2.2
   Compiling futf v0.1.4
   Compiling precomputed-hash v0.1.1
   Compiling utf-8 v0.7.5
   Compiling syn v1.0.73
   Compiling tendril v0.4.1
   Compiling phf v0.7.24
   Compiling cfg-if v0.1.6
   Compiling rustler_sys v2.1.1
   Compiling void v1.0.2
   Compiling unicode-segmentation v1.3.0
   Compiling unreachable v1.0.0
   Compiling quote v0.6.11
   Compiling heck v0.3.1
   Compiling syn v0.15.26
   Compiling log v0.4.6
   Compiling rustler v0.22.0
   Compiling quote v1.0.9
   Compiling rand_os v0.1.2
   Compiling rand_jitter v0.1.3
   Compiling time v0.1.42
   Compiling serde_derive v1.0.88
   Compiling html5ever v0.22.5
   Compiling phf_generator v0.7.24
   Compiling serde_json v1.0.38
   Compiling string_cache_codegen v0.4.2
   Compiling phf_codegen v0.7.24
   Compiling string_cache v0.7.3
   Compiling rustler_codegen v0.22.0
   Compiling markup5ever v0.7.5
Compiling lib/meeseeks_html5ever/native.ex (it's taking more than 10s)
   Compiling xml5ever v0.12.1
   Compiling meeseeks_html5ever_nif v0.13.1 (/Users/manzanit0/repositories/manzanit0/cookbook/deps/meeseeks_html5ever/native/meeseeks_html5ever_nif)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,-exported_symbols_list,/var/folders/2c/qvljt5md5x7_qhdvsrvxv8cm0000gn/T/rustcgDwmk8/list" "-arch" "arm64" "/var/folders/2c/qvljt5md5x7_qhdvsrvxv8cm0000gn/T/rustcgDwmk8/symbols.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.0.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.1.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.10.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.11.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.12.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.13.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.14.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.15.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.2.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.3.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.4.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.5.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.6.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.7.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.8.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.meeseeks_html5ever_nif.a4fc85d1-cgu.9.rcgu.o" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/meeseeks_html5ever_nif.17nd2j5kh2x5qk3f.rcgu.o" "-L" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps" "-L" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libxml5ever-e1f4c4608e2d05d4.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libtime-bab8fd67a08283da.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/liblibc-11717719a6545e25.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libhtml5ever-2c181b582f01d552.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libmarkup5ever-cc43020926248589.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libtendril-dfe6ce18edb5d973.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libutf8-49fbc84796657b5d.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libfutf-5290fea5158bf50f.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libmac-ad774d038cafc997.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libphf-b1fd30bb82b8d4c7.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libstring_cache-cf48485d9f1b7576.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libstring_cache_shared-cb7ac7fa8c2e04e3.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libserde-ffd090df9ddbf5c6.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libprecomputed_hash-1214131826d7df38.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libphf_shared-007004b5af9dcc3b.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libsiphasher-16466daedbc2f1b8.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libdebug_unreachable-89f69e5758bbbe5a.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/liblog-81714db150fa623c.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/libcfg_if-7a07fa826dcfef15.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/librustler-3490d21b236f87b1.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/liblazy_static-a079c1087d5e6dba.rlib" "/Users/manzanit0/repositories/manzanit0/cookbook/_build/dev/lib/meeseeks_html5ever/native/meeseeks_html5ever_nif/release/deps/librustler_sys-7cce26f43e8e0ea9.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-8b48f6cefff7b1fb.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-77aeaad8f850e496.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-4374cc9e76b48de5.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-71ce82846aaede9b.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-88478a43231eec41.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-219a0c42f67a2534.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-967edde4cff44b15.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-5e9bad2c7ec1f53a.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-f2d3de7828f2e1f2.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-39feb0179b2f197f.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-fe7523d51d4e2154.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-1fb439e2b08a54ae.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-0ece1873dc3050cd.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-1094a874bdfc7dbb.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-8cd76113b92d6775.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-3a7cb21921429c0e.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-5b42fb3902d391c7.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-b495777441600026.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-cba95c4386a21469.rlib" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-b8f163a13cf94b5d.rlib" "-lSystem" "-lc" "-lm" "-L" "/Users/manzanit0/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/manzanit0/repositories/manzanit0/cookbook/_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_alloc_binary", referenced from:
                rustler::types::string::_$LT$impl$u20$rustler..types..Encoder$u20$for$u20$str$GT$::encode::hdc0d9aea8fcbe1ee in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.9.rcgu.o)
            "_enif_alloc_env", referenced from:
                _$LT$rustler..env..OwnedEnv$u20$as$u20$core..default..Default$GT$::default::h4cab2a4da7037422 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.11.rcgu.o)
                std::sync::once::Once::call_once::_$u7b$$u7b$closure$u7d$$u7d$::h3a4f73348b8f11fe (.llvm.18392041622057299856) in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.8.rcgu.o)
            "_enif_free_env", referenced from:
                _$LT$rustler..env..OwnedEnv$u20$as$u20$core..ops..drop..Drop$GT$::drop::h6c47625d6d3ad5f2 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.11.rcgu.o)
                std::sync::once::Once::call_once::_$u7b$$u7b$closure$u7d$$u7d$::h3a4f73348b8f11fe (.llvm.18392041622057299856) in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.8.rcgu.o)
                core::ptr::drop_in_place$LT$rustler..env..OwnedEnv$GT$::hc41ef80dcdcdd879 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.8.rcgu.o)
            "_enif_inspect_binary", referenced from:
                _$LT$rustler..types..binary..Binary$u20$as$u20$rustler..types..Decoder$GT$::decode::h26552e32e48d5da8 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.5.rcgu.o)
            "_enif_make_atom_len", referenced from:
                rustler::types::atom::Atom::from_str::h5c3df212ba556a79 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.8.rcgu.o)
            "_enif_make_badarg", referenced from:
                rustler::codegen_runtime::NifReturned::apply::hef882aeb72679d53 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.6.rcgu.o)
            "_enif_make_binary", referenced from:
                rustler::types::string::_$LT$impl$u20$rustler..types..Encoder$u20$for$u20$str$GT$::encode::hdc0d9aea8fcbe1ee in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.9.rcgu.o)
            "_enif_make_copy", referenced from:
                _$LT$rustler..term..Term$u20$as$u20$rustler..types..Encoder$GT$::encode::hbabf3fd09657d8ec in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.2.rcgu.o)
                _$LT$rustler..error..Error$u20$as$u20$rustler..codegen_runtime..NifReturnable$GT$::into_returned::h3a0e728d1cd4921e in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.7.rcgu.o)
            "_enif_make_list_from_array", referenced from:
                rustler::wrapper::list::make_list::h96d68b533881a23e in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.4.rcgu.o)
            "_enif_make_map_from_arrays", referenced from:
                rustler::types::map::_$LT$impl$u20$rustler..term..Term$GT$::map_from_arrays::h0b127fe97b8f81d0 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.2.rcgu.o)
            "_enif_make_tuple_from_array", referenced from:
                rustler::wrapper::tuple::make_tuple::h7dc02372c8a09b9b in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.10.rcgu.o)
                _$LT$rustler..error..Error$u20$as$u20$rustler..codegen_runtime..NifReturnable$GT$::into_returned::h3a0e728d1cd4921e in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.7.rcgu.o)
            "_enif_make_ulong", referenced from:
                rustler::types::primitive::_$LT$impl$u20$rustler..types..Encoder$u20$for$u20$u64$GT$::encode::h0946bd74c7a91bdc in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.3.rcgu.o)
            "_enif_raise_exception", referenced from:
                rustler::codegen_runtime::NifReturned::apply::hef882aeb72679d53 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.6.rcgu.o)
            "_enif_release_binary", referenced from:
                core::ptr::drop_in_place$LT$rustler..types..binary..OwnedBinary$GT$::h2a7ffeb8d53ad6d7 (.llvm.835606843064718136) in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.9.rcgu.o)
            "_enif_schedule_nif", referenced from:
                rustler::codegen_runtime::NifReturned::apply::hef882aeb72679d53 in librustler-3490d21b236f87b1.rlib(rustler-3490d21b236f87b1.rustler.e4aae4ea-cgu.6.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

== Compilation error in file lib/meeseeks_html5ever/native.ex ==
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    (rustler 0.22.2) lib/rustler/compiler.ex:36: Rustler.Compiler.compile_crate/2
    lib/meeseeks_html5ever/native.ex:4: (module)
    (stdlib 3.17.2.1) erl_eval.erl:685: :erl_eval.do_apply/6
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"
neilberkman commented 1 year ago

Just wanted to let you know this is still on my radar. I've been really busy the past several weeks so this hasn't been something I've been able to spend a lot of time on yet.

@mischov just checking in on this. Not a big deal for me - I can keep using my fork. Thanks.

mischov commented 1 year ago

@neilberkman Thanks for the nudge. Released v0.14.0 of meeseeks_html5ever which adds NIF precompilation. I'll be updating Meeseeks to rely on it shortly.

@un3481 Thanks for doing the initial legwork on this- rustler_precompiled has changed since your PR so I did things differently, but your worked helped.

mischov commented 1 year ago

Just a heads up, I've retired v0.14.0 (as well as v0.14.2) because when compiling on OTP 23 it segfaulted.

v0.14.3 works.

Manzanit0 commented 1 year ago

Just circled back to this after ages; thanks you so much @mischov for sorting it out! ❤️