fogfish / esq

simple persistent queues for Erlang
Apache License 2.0
56 stars 8 forks source link

rebar2.config is missing from hex. #20

Closed lud closed 1 year ago

lud commented 3 years ago

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

silviucpp commented 3 years ago

@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 commented 1 year ago

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

fogfish commented 1 year ago

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

silviucpp commented 1 year ago

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

fogfish commented 1 year ago

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

silviucpp commented 1 year ago

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

lud commented 1 year ago

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.

silviucpp commented 1 year ago

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}}
lud commented 1 year ago

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.

silviucpp commented 1 year ago

@fogfish can you please make a fix ?

fogfish commented 1 year ago

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

lud commented 1 year ago

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 .
silviucpp commented 1 year ago

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

lud commented 1 year ago

Yep, project builds correctly!