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

Mix compile goes to error because of invoking module rebar_utils functions in rebar.config.script #2189

Closed
jsvisa opened this Issue Apr 24, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@jsvisa
Contributor

jsvisa commented Apr 24, 2014

When use a Erlang dependence druuid in Elixir, which module uses rebar to compile, and in the rebar.config.script, it invoke a function rebar_utils:is_arch/ defined in module rebar_utils to diff the platform. That module can be compiled successfully in Erlang, otherwise in Elixir, and it turns out the the following error:

Error evaluating rebar config script ./rebar.config.script: 27: evaluation failed with reason error:undef and stacktrace [{rebar_utils,is_arch,[[98,115,100]],[]},{erl_eval,do_apply,6,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,657}]},{erl_eval,expr,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,272}]},{file,eval_stream2,6,[{file,[102,105,108,101,46,101,114,108]},{line,1376}]},{file,script,2,[{file,[102,105,108,101,46,101,114,108]},{line,1077}]},{'Elixir.File','cd!',2,[{file,[108,105,98,47,102,105,108,101,46,101,120]},{line,1001}]},{'Elixir.Mix.Rebar',eval_script,2,[{file,[108,105,98,47,109,105,120,47,114,101,98,97,114,46,101,120]},{line,133}]},{'Elixir.Mix.Dep.Loader','-rebar_dep/1-fun-0-',2,[{file,[108,105,98,47,109,105,120,47,100,101,112,47,108,111,97,100,101,114,46,101,120]},{line,210}]}] Any dependency defined in the script won't be available unless you add them to your Mix project

In my opinion, in Elixir side, it doesn't export rebar_utils module, so it returns error when invoke file:script/2 in Mix.Rebar.eval_script/2

@josevalim

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Apr 24, 2014

Member

Yeah, that's a bug. Thanks. Although there isn't much we can do, which sucks.

@ericmj do you have any solution in mind? Maybe we should warn saying we could not evaluate the rebar script and say that any dependency in the script is not going to be fetched?

Member

josevalim commented Apr 24, 2014

Yeah, that's a bug. Thanks. Although there isn't much we can do, which sucks.

@ericmj do you have any solution in mind? Maybe we should warn saying we could not evaluate the rebar script and say that any dependency in the script is not going to be fetched?

@jsvisa

This comment has been minimized.

Show comment
Hide comment
@jsvisa

jsvisa Apr 24, 2014

Contributor

I have an solution, we can add rebar as one of Mix dependence, and export the modules associated with rebar, although it doesn't sounds very well.

Contributor

jsvisa commented Apr 24, 2014

I have an solution, we can add rebar as one of Mix dependence, and export the modules associated with rebar, although it doesn't sounds very well.

@josevalim

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Apr 24, 2014

Member

Yeah, having rebar as a dependency would work, but it doesn't look like the best idea.

Member

josevalim commented Apr 24, 2014

Yeah, having rebar as a dependency would work, but it doesn't look like the best idea.

@josevalim

This comment has been minimized.

Show comment
Hide comment
@josevalim

josevalim Apr 24, 2014

Member

I just checked with @ericmj and indeed there is nothing to do rather than adding rebar as a dependency to your project.

Member

josevalim commented Apr 24, 2014

I just checked with @ericmj and indeed there is nothing to do rather than adding rebar as a dependency to your project.

@josevalim josevalim closed this in 659a479 Apr 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment