esq icon indicating copy to clipboard operation
esq copied to clipboard

rebar2.config is missing from hex.

Open lud opened this issue 4 years ago • 1 comments

This package is a dependency of erlkaf and when erlkaf is build as a dependency in a mix project, there is an error:

Error evaluating Rebar config script ./rebar.config.script:22: evaluation failed with reason error:{badmatch,{error,enoent}} and stacktrace [{erl_eval,expr,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]}
,{line,450}]},{erl_eval,exprs,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,123}]},{erl_eval,expr_list,6,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,893}]},{erl_eval,expr,5,[{fil
e,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,426}]},{file,eval_stream2,6,[{file,[102,105,108,101,46,101,114,108]},{line,1504}]},{file,script,2,[{file,[102,105,108,101,46,101,114,108]},{line,1142}]},{'E
lixir.File','cd!',2,[{file,[108,105,98,47,102,105,108,101,46,101,120]},{line,1560}]},{'Elixir.Mix.Rebar',eval_script,2,[{file,[108,105,98,47,109,105,120,47,114,101,98,97,114,46,101,120]},{line,204}]}]            
Any dependencies defined in the script won't be available unless you add them to your Mix project                                                                                                                   
Error evaluating Rebar config script ./rebar.config.script:22: evaluation failed with reason error:{badmatch,{error,enoent}} and stacktrace [{erl_eval,expr,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]}
,{line,450}]},{erl_eval,exprs,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,123}]},{erl_eval,expr_list,6,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,893}]},{erl_eval,expr,5,[{fil
e,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,426}]},{file,eval_stream2,6,[{file,[102,105,108,101,46,101,114,108]},{line,1504}]},{file,script,2,[{file,[102,105,108,101,46,101,114,108]},{line,1142}]},{'E
lixir.File','cd!',2,[{file,[108,105,98,47,102,105,108,101,46,101,120]},{line,1560}]},{'Elixir.Mix.Rebar',eval_script,2,[{file,[108,105,98,47,109,105,120,47,114,101,98,97,114,46,101,120]},{line,204}]}]            
Any dependencies defined in the script won't be available unless you add them to your Mix project  

If I add the rebar2.config file manually, the error is gone.

I don't know rebar very well, neither management of erl apps in Hex, but would it be a solution to add the rebar2.config file to the hex package?

Thank you

lud avatar Jul 22 '21 13:07 lud

@fogfish seems there is a problem with mix and rebar.config.script files. On erlkaf we don't include this file into hex package but esq does..

I'm not familiar with mix but I received this pull request from rebar3 author https://github.com/silviucpp/erlkaf/pull/10/files

silviucpp avatar Jul 22 '21 15:07 silviucpp

Hello @fogfish . It is possible to fix this problem ? It's causing issues to all libraries published on hex that are using your lib as dependency.

Silviu

silviucpp avatar Dec 29 '22 21:12 silviucpp

absolutely! I need to deep dive into syntax of rebar2. Will make adaptation asap.

fogfish avatar Dec 30 '22 15:12 fogfish

A quick fix is to not include that file into hex package. Anyway is pointless as it's related to the ancient rebar2 compatibility.

You can specifiy what files to include into the hex using the files property . Example: https://github.com/silviucpp/erlkaf/blob/master/src/erlkaf.app.src

Silviu

silviucpp avatar Dec 30 '22 16:12 silviucpp

Version 2.0.5 is published to hex. Please confirm if the issue is fixed.

fogfish avatar Dec 31 '22 13:12 fogfish

@lud can you please check the last erlkaf from hex ?

silviucpp avatar Dec 31 '22 22:12 silviucpp

I could not reproduce the same error as before, but I still had an error on esq. Now it seem to compile correctly.

I have another error :

  • pipes (Hex package) could not find an app file at "_build/dev/lib/pipes/ebin/pipes.app". Another app file was found in the same directory "_build/dev/lib/pipes/ebin/pipe.app", try changing the dependency name to :pipe ** (Mix) Can't continue due to errors on dependencies

But that seems not related to esq.

lud avatar Jan 01 '23 15:01 lud

Hmm pipes it's a dep of esq.. @fogfish I see you changed the name of dep from pipe to pipes in this last release.. and compilr it's complaining about this. I also see into https://hex.pm/packages/pipes that it says:

{pipe, "2.0.1", {pkg, pipes}}

silviucpp avatar Jan 01 '23 16:01 silviucpp

I can confirm, this works.

I tried to override my esq dependency:

  defp deps do
    [
      {:erlkaf, "~> 2.1.1"},
      {:esq, path: "/home/lud/osef/esq", override: true}
    ]
  end

And modify esq rebar.config to have this:

{deps, [
datum,
{pipe, "2.0.1", {pkg, pipes}},
uid
]}.

And now the project compiles.

lud avatar Jan 01 '23 17:01 lud

@fogfish can you please make a fix ?

silviucpp avatar Jan 01 '23 18:01 silviucpp

Version 2.0.6 is published to hex. Please confirm if the issue is fixed.

fogfish avatar Jan 02 '23 15:01 fogfish

It works with {:erlkaf, "~> 2.1.1"}, {:esq, "~> 2.0.6", override: true}

I'll try again when a new version of erlkaf is published by @silviucpp .

lud avatar Jan 02 '23 18:01 lud

@lud I just published a new package. Please test.

silviucpp avatar Jan 02 '23 19:01 silviucpp

Yep, project builds correctly!

lud avatar Jan 03 '23 07:01 lud