Open watsy0007 opened 1 year ago
This NIF currently tries to load lz4_nif.so
which is a Linux-specific binary file.
thanks for reply, are there any plan to support more architectures?
The reason for lz4_nif.so having the wrong architecture is because the currently included version of erlang.mk always sets -arch x86_64
when it detects a Darwin/MacOS platform.
This has been fixed upstream in https://github.com/ninenines/erlang.mk/commit/94718f7715a05087d966a0ca4b32527892ac6cfc
After removing the hardcoded flags, I could build and use the package on an M1 machine.
@pgorczak can you give #84 a try?
The upgrade broke something else for me. Erlang.mk now fails at host_triple with
...
DEP host_triple (0.1.0)
Evaluating config script ".../lz4/.erlang.mk/rebar3/_build/default/lib/rebar/src/rebar.app.src.script"
===> Verifying dependencies...
===> Failed to update package host_triple from repo hexpm
escript: exception error: no match of right hand side value
{error,
{rebar_app_utils,
{missing_package,<<"host_triple">>,<<"0.1.0">>}}}
in function erl_eval:expr/6 (erl_eval.erl, line 498)
in call from escript:eval_exprs/5 (escript.erl, line 869)
in call from erl_eval:local_func/8 (erl_eval.erl, line 646)
in call from escript:interpret/4 (escript.erl, line 780)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1
in call from init:do_boot/3
...
Followed by
Error: No Makefile to build dependency .../lz4/deps/host_triple.
The package lz4/deps/host_triple
did get downloaded though
I think the error happens during autopatch (see 7.10). I can reproduce it when just running make fetch-deps
after removing the deps
directory.
Yup, host_triple
can be "new" (newer than the last update of this package) and may need updating to work as a dependency in an erlang.mk-managed codebase.
Finally got around to digging into the remaining issue. It's because I'm using the library through mix and mix was trying to compile it with rebar (probably because it detected the rebar config file). I needed to specify the dependency as
{:lz4, git: "https://github.com/rabbitmq/lz4-erlang.git", tag: "v1.9.4.1", manager: :make}
I can confirm the project compiles (with some warnings) on Erlang/OTP 26 on Apple Silicon (macOS 14.2).
hi, i try run it on my macos immediately when i saw #37 merged
i get the same error
this is my
mix.exs
depscompile log
error log
sorry for my lack of c++ knowledge, Are there any steps I'm doing wrong?