rusterlium / html5ever_elixir

NIF wrapper of html5ever using Rustler
https://hexdocs.pm/html5ever
Apache License 2.0
81 stars 71 forks source link

Compilation issue on Mac OS X #3

Closed jonzlin95 closed 7 years ago

jonzlin95 commented 7 years ago

I'm on Mac OS X El Capitan (10.11.6). Elixir version

Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.4.1

==> html5ever
Compiling NIF crate :html5ever_nif (native/html5ever_nif)...
could not compile dependency :html5ever, "mix compile" failed. You can recompile this dependency with "mix deps.compile html5ever", update it with "mix deps.update html5ever" or clean it with "mix deps.clean html5ever"
** (ErlangError) erlang error: :enoent
    (elixir) lib/system.ex:564: System.cmd("cargo", ["rustc", "--no-default-features", "--release", "--", "--codegen", "link-args=-flat_namespace -undefined suppress"], [cd: "/Users/jonathanlin/Documents/blitz/blitz-cms/deps/html5ever/native/html5ever_nif", stderr_to_stdout: true, env: [{"CARGO_TARGET_DIR", "/Users/jonathanlin/Documents/blitz/blitz-cms/_build/dev/rustler_crates/html5ever_nif"}], into: %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}])
    lib/mix/tasks/compile.rustler.ex:49: Mix.Tasks.Compile.Rustler.compile_crate/1
    (elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2
    lib/mix/tasks/compile.rustler.ex:12: Mix.Tasks.Compile.Rustler.run/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2
    (mix) lib/mix/tasks/compile.all.ex:19: anonymous fn/1 in Mix.Tasks.Compile.All.run/1
    (mix) lib/mix/tasks/compile.all.ex:37: Mix.Tasks.Compile.All.with_logger_app/1
aphillipo commented 7 years ago

Which version of rust do you have installed?

jonzlin95 commented 7 years ago

Well this is awkward. Didn't realize I needed to have Rust installed.

I library I upgraded seems to have added this to the dependency list without me realizing. Thanks for the quick reply, and sorry!

hansihe commented 7 years ago

@jonzlin95 May I ask which library that is?

jonzlin95 commented 7 years ago

I think it's philss/floki, but as an optional dependency (and they do document the installation of Rust + HTML5Ever). I'm actually not sure how it crept into my mix.lock file, but upon removing it as a dependency, Floki worked fine. I probably did something stupid while upgrading packages.

hansihe commented 7 years ago

Ah yeah, that makes sense.

I was slightly confused because I was fairly sure this package was an optional dependency of floki, so I thought it might have been something else.