Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebar2.config is missing from hex. #20

Closed
lud opened this issue Jul 22, 2021 · 14 comments
Closed

rebar2.config is missing from hex. #20

lud opened this issue Jul 22, 2021 · 14 comments

Comments

@lud
Copy link

lud commented Jul 22, 2021

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
Copy link

@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
Copy link

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
Copy link
Owner

fogfish commented Dec 30, 2022

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

@silviucpp
Copy link

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
Copy link
Owner

fogfish commented Dec 31, 2022

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

@silviucpp
Copy link

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

@lud
Copy link
Author

lud commented Jan 1, 2023

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
Copy link

silviucpp commented Jan 1, 2023

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
Copy link
Author

lud commented Jan 1, 2023

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
Copy link

@fogfish can you please make a fix ?

@fogfish
Copy link
Owner

fogfish commented Jan 2, 2023

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

@lud
Copy link
Author

lud commented Jan 2, 2023

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
Copy link

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

@lud
Copy link
Author

lud commented Jan 3, 2023

Yep, project builds correctly!

@lud lud closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants