-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meeseeks (and Rustler) doesn't work with escript.build #23
Comments
If you could provide more info about the input that caused that it would be great. |
I fetched HTML code of this page: http://www.onepiece.wbijam.pl/pierwsza_seria.html |
html = """
<The Page Source>
""""
d = Meeseeks.parse(html)
Meeseeks.all(d, css("table.lista a"))
Returns a list of results for me. Can you try running |
The Rustler line referenced in the error is: https://github.com/hansihe/rustler/blob/master/rustler_mix/lib/rustler.ex#L74 Is there any reason that that line would cause a problem for you? |
I found a problem. It works in defmodule Sample do
import Meeseeks.CSS
def main([main_url]) do
Meeseeks.parse HTTPoison.get!(main_url).body
# minified version - works in iex
end
end and here is defmodule Sample.Mixfile do
use Mix.Project
def application, do: [extra_applications: [:logger]]
def project, do: [
app: :sample,
deps: [
{:httpoison, "~> 0.13"},
{:meeseeks, "~> 0.7.2"}
],
elixir: "~> 1.5",
escript: [main_module: Sample],
start_permanent: Mix.env == :prod,
version: "0.1.0",
]
end
# also minified rest is as same as after calling: |
It looks like that problem might result from a combination of The
And the line I linked to above from Rustler, the one in the error, reads priv_dir = otp_app |> :code.priv_dir() |> to_string() |
@mischov: oh, is there any other way to compile my project to binary file that could work with rustler? |
Well, escripts don't work with NIFs (source), so not in a way that involves an escript. |
I don't really know what your use case and restrictions are, but your best bet is probably to make an Erlang/OTP release with something like Distillery. I am going to close this issue, but feel free to continue commenting if you have more questions or if you want to describe your eventual solution. |
Hey, I just called
&Meeseeks.all/2
function with css like:but I got:
My dependencies:
Erlang:
20.0
Elixir:
1.5.1-otp-20
Rust:
stable
- rustc 1.19.0 (0ade33941 2017-07-17)All installed using
asdf
.Let me know if you need more info about my input data.
Edit: I got exactly same error when I changed
all
toone
function name.The text was updated successfully, but these errors were encountered: