:neotoma is using Rebar 2 error

I apologise for the misfire → previous topic of the same summary got deleted by my mistake. Now once more

After updating to Erlang/OTP 25 I get:

dependency :neotoma is using Rebar 2, which is no longer maintained and no longer works in recent Erlang/OTP versions. Remove the :manager option or set it to :rebar3 instead

Any quick fix for this? Other than downgrading Erlang/OTP :wink:

How is it specified in your mix.exs? IIRC we will only use Rebar2 if you explicitly opt-in to that.

Neither Rebar nor Neotoma is specified there. It is a dependency of something. Looking at the mix.lock file it looks like neotoma is pulled by “slime”. I checked its issues and found the suggestion:

to specify neotoma explicitly in the mix.exs file

{:neotoma, "~> 1.7.3", manager: :rebar3, override: true},

but this didn’t help. So things apparently changed but maybe there’s still a way to override this?

What you wrote should be enough to overwrite it in your mix.exs file. If not, please open up an issue in Elixir’s issues tracker with the specific steps to reproduce it. :slight_smile:

This worked with OTP 24. With 25 things still break:

=ERROR REPORT==== 23-May-2022::19:12:50.195973 ===
beam/beam_load.c(551): Error loading function rebar3:parse_args/1: op put_tuple u x:
  please re-compile this module with an Erlang/OTP 25 compiler

escript: exception error: undefined function rebar3:main/1
  in function  escript:run/2 (escript.erl, line 750)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3

Well, I should of course have mentioned that it breaks differently. I probably now need to “recompile” rebar itself

That’s another error! It can be addressed by running mix local.rebar.

2 Likes

Yes, TNX.

Hi! I also had the same issue. But cannot solve it using mix local.rebar :frowning: . Can someone help me? Or this is an issue of OTP erlang 25?

I guess if it was, then “rcompiling” with mix local.rebar wouldn’t help in my case but it did. So it is more probably your local setup that causes trouble. Maybe you could give a bit more info/context following the thread from the top

@silverdr . I did these steps:

  1. delete _build and deps folders
  2. add to mix.exs file this row
{:neotoma, "~> 1.7.3", manager: :rebar3, override: true},
  1. mix deps.get
  2. mix local.rebar (confirmed 2 times Yes to replace the existed rebar and rebar3 folders)
  3. mix phx.server

And my log as below.

dependency :neotoma is using Rebar 2, which is no longer maintained and no longer works in recent Erlang/OTP versions. Remove the :manager option or set it to :rebar3 instead
==> toml
Compiling 10 files (.ex)
Generated toml app
=ERROR REPORT==== 3-Jun-2022::22:33:15.955424 ===
beam/beam_load.c(148): Error loading module rebar:
please re-compile this module with an Erlang/OTP 25 compiler

escript: exception error: undefined function rebar:main/1
in function escript:run/2 (escript.erl, line 750)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1
in call from init:do_boot/3
==> hypervine
** (Mix) Could not compile dependency :neotoma, “/Users/admin/.mix/rebar compile skip_deps=true deps_dir=”/Users/admin/hypervine-backend/_build/dev/lib"" command failed. Errors may have been logged above. You can recompile this dependency with “mix deps.compile neotoma”, update it with “mix deps.update neotoma” or clean it with “mix deps.clean neotoma”

I think you may need to add the neotoma line before the package that neotoma is a dependency of. Please check if that’s the case in your mix.exs

Thanks for pointing out this to me. Yes, my problem is my mix.exs was not saved after I added the " {:neotoma, “~> 1.7.3”, manager: :rebar3, override: true}, ". It took me a day to find out hahaha, I am using Visual Studio Code and I remember it 's autosaved without Command + S, but in this case I have to press Command +S to save the new update in mix.exs file. One a gain many thanks @silverdr ^^

2 Likes

Hi :wave:
Following the above suggestion solved my issue, but since I’m doing it from a package that I want to publish in Hex, I get the following error:

** (Mix) Can't build package with overridden dependency neotoma, remove `override: true`

If I remove the override I get the following one:

Unchecked dependencies for environment dev:
* neotoma (Hex package)
  the dependency neotoma in mix.exs is overriding a child dependency:

  > In mix.exs:
    {:neotoma, "~> 1.7.3", [env: :prod, repo: "hexpm", hex: "neotoma"]}

  > In deps/slime/mix.exs:
    {:neotoma, "~> 1.7", [env: :prod, hex: "neotoma", repo: "hexpm", optional: false]}

  Ensure they match or specify one of the above in your deps and set "override: true"1

I’m a new to the ecosystem so I’m struggling a bit to address the above issue. Any suggestion is highly appreciated :pray: