davisp / jiffy

JSON NIFs for Erlang
Other
869 stars 319 forks source link

jiffy 1.0.4 fails to compile with Erlang/OTP 23.0-rc3 #197

Closed legoscia closed 4 years ago

legoscia commented 4 years ago

Compiling jiffy with Erlang/OTP 23.0-rc3 fails with the following error message:

$ make
./rebar compile
Uncaught error in rebar_core: {'EXIT',
                               {undef,
                                [{rebar_utils,get_cwd,[],[]},
                                 {rebar_config,new,0,[]},
                                 {rebar,init_config,1,[]},
                                 {rebar,run,1,[]},
                                 {rebar,main,1,[]},
                                 {escript,run,2,
                                  [{file,"escript.erl"},{line,758}]},
                                 {escript,start,1,
                                  [{file,"escript.erl"},{line,277}]},
                                 {init,start_em,1,[]}]}}
=ERROR REPORT==== 22-Apr-2020::13:39:22.741797 ===
beam/beam_load.c(1624): Error loading module rebar_utils:
  please re-compile this module with an 23 compiler (old-style fun with indices: 3/6)

=ERROR REPORT==== 22-Apr-2020::13:39:22.741840 ===
Loading of /home/magnus/src/jiffy-upstream/rebar/rebar/ebin/rebar_utils.beam failed: badfile

=ERROR REPORT==== 22-Apr-2020::13:39:22.761395 ===
beam/beam_load.c(1624): Error loading module rebar_utils:
  please re-compile this module with an 23 compiler (old-style fun with indices: 3/6)

=ERROR REPORT==== 22-Apr-2020::13:39:22.761467 ===
Loading of /home/magnus/src/jiffy-upstream/rebar/rebar/ebin/rebar_utils.beam failed: badfile

escript: exception error: undefined function rebar_utils:delayed_halt/1
  in function  escript:run/2 (escript.erl, line 758)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3 
Makefile:19: recipe for target 'build' failed
make: *** [build] Error 127

This happens because release 23 dropped support for loading beam files compiled with a compiler older than R15 (see here), and the beam files inside the rebar binary were compiled with R14.

rickpayne commented 4 years ago

I think the same issue applies to the 'enc' escript included too...

laktech commented 4 years ago

I upgrade Erlang/OTP to 23 and was having troubles building this PR. Turns out it was a problem with my version of rebar3. Under rebar 3.6.1, the build failed to produce priv/jiffy.so. rebar3 output was not helpful in identifying the problem, it quietly terminated. Running rebar3 under strace I discovered that it was complaining about not being able to find the liberl_interface shared library.

Upgrading to the latest rebar3 resolved the problem.

darrenklein commented 4 years ago

I struck this issue as well after upgrading to Erlang/OTP 23; however, upgrading rebar3 didn't resolve the issue for me. The PR #199 resolves this issue for me.

stephb9959 commented 4 years ago

I forked this code into stephb9959/jiffy and removed all rebar/enc stuff. The project just uses erlang.mk and works in Erlang/OPT23. All tests pass on MacOSx and Linux. I am just looking for others to try that to see if there's value in making a pull request.

vkatsuba commented 4 years ago

I forked this code into stephb9959/jiffy and removed all rebar/enc stuff. The project just uses erlang.mk and works in Erlang/OPT23. All tests pass on MacOSx and Linux. I am just looking for others to try that to see if there's value in making a pull request.

Hi @stephb9959, I'm try add https://github.com/stephb9959/jiffy as dependency into rebar project and get error: ===> Dependency failure: source for jiffy does not contain a recognizable project and can not be built Looks like the rebar have some conflicts with erlang.mk. Looks like for non-rebar projects was provided fix https://github.com/erlang/rebar3/pull/1978 but still don't merged. So, I suppose for rebar projects need to add src/jiffy.app.src into https://github.com/stephb9959/jiffy.

stephb9959 commented 4 years ago

Sorry @vkatsuba , this project uses erlang.mk and is made by running make instead of rebar. I put a note at the top of the readme but I forgot to mention this here. Hope this helps.

vkatsuba commented 4 years ago

Sorry @vkatsuba , this project uses erlang.mk and is made by running make instead of rebar. I put a note at the top of the readme but I forgot to mention this here. Hope this helps.

@stephb9959, sorry this my fault, I didn't pay attention to note at the top of the readme. Thanks.

cburgmer commented 4 years ago

This issue is now fixed with #199 and a new version is released. I hope my comment here notifies everybody subscribing to this issue here.

legoscia commented 4 years ago

Indeed, jiffy 1.0.5 seems to work fine. Thanks @davisp !