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

Enable Rebar 3 support by default #4042

Closed
josevalim opened this issue Dec 3, 2015 · 17 comments
Closed

Enable Rebar 3 support by default #4042

josevalim opened this issue Dec 3, 2015 · 17 comments
Assignees
Milestone

Comments

@josevalim
Copy link
Member

Before we make this work, we need to find a way for Rebar 3 to not prompt for registry updates repeatedly.

@ericmj
Copy link
Member

ericmj commented Dec 3, 2015

Issue opened on rebar3: erlang/rebar3#958

@ericmj
Copy link
Member

ericmj commented Dec 3, 2015

Note for myself: we also need to verify that rebar3 does not evaluate rebar.config.script when REBAR_CONFIG is used. If it does evaluate the script we need to delete it from _build because the config we pass to rebar3 has already evaluated it.

@josevalim
Copy link
Member Author

I believe this has been enabled for a while, right @ericmj?

@ericmj
Copy link
Member

ericmj commented May 13, 2016

It has been :)

@ericmj ericmj closed this as completed May 13, 2016
@josevalim
Copy link
Member Author

We still need to make rebar3 the default package for Git dependencies.

@josevalim josevalim reopened this May 17, 2016
@josevalim josevalim modified the milestones: v1.4.0, v1.3.0 May 17, 2016
@ericmj
Copy link
Member

ericmj commented May 17, 2016

What do you think about introducing a warning if :manager is not explicitly set and we can't infer it with 100% certainty?

@ericentin
Copy link
Contributor

I'm having trouble compiling the hex package "cf" v0.2.1 with an elixir/mix build from current master and the latest hex and rebar3 installed (from hex). I don't know enough about rebar3 to know if it's the package's fault or not, but it works fine on Elixir 1.2.5.

@josevalim
Copy link
Member Author

You can pass manager: :rebar2 to your dependency options. Does it fix the
issue?

On Wednesday, May 18, 2016, Eric Entin notifications@github.com wrote:

I'm having trouble compiling the hex package "cf" v0.2.1 with an
elixir/mix build from current master and the latest hex and rebar3
installed (from hex). I don't know enough about rebar3 to know if it's the
package's fault or not, but it works fine on Elixir 1.2.5.


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#4042 (comment)

José Valimwww.plataformatec.com.br
http://www.plataformatec.com.br/Founder and Director of R&D

@ericmj
Copy link
Member

ericmj commented May 18, 2016

"cf" is listed as a rebar3 project on hex. But without any more information it's impossible for us to say what is going on.

You can pass manager: :rebar2 to your dependency options. Does it fix the
issue?

It should be :rebar, not :rebar2.

@ericentin
Copy link
Contributor

"cf" does work when the manager is overridden to :rebar for both "cf" and "erlware_commons". Here's the error that happens when you leave it on the default:

╰─$ DEBUG=1 mix compile
===> Expanded command sequence to be run: []
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {bare,compile}]
===> Compiling cf
===> run_hooks("/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf", pre_hooks, compile) -> no hooks defined

===> run_hooks("/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info,debug_info]
===> files to compile ["/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf/src/cf_term.erl",
                              "/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf/src/cf.erl"]
===>      Compiled cf_term.erl
===>      Compiled cf.erl
===> run_hooks("/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf", post_hooks, erlc_compile) -> no hooks defined

===> run_hooks("/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf", pre_hooks, app_compile) -> no hooks defined

===> run_hooks("/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf", post_hooks, app_compile) -> no hooks defined

===> run_hooks("/Users/antipax/Documents/Code/my_app/apps/my_app/deps/cf", post_hooks, compile) -> no hooks defined

===> Expanded command sequence to be run: []
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {bare,compile}]
===> Evaluating config script "/Users/antipax/Documents/Code/my_app/apps/my_app/deps/erlware_commons/rebar.config.script"
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace
===> Uncaught error: {badmatch,
                             {error,
                              {19,file,
                               {error,
                                {badmatch,
                                 ["3","0","0+build","272","ref7d29b74"]},
                                [{erl_eval,expr,3,[]}]}}}}
===> Stack trace to the error location: [{rebar_config,consult_file_,
                                                 1,
                                                 [{file,
                                                   "/home/travis/build/rebar/rebar3/_build/default/lib/rebar/src/rebar_config.erl"},
                                                  {line,106}]},
                                                {rebar_config,consult_file,1,
                                                 [{file,
                                                   "/home/travis/build/rebar/rebar3/_build/default/lib/rebar/src/rebar_config.erl"},
                                                  {line,90}]},
                                                {rebar_app_discover,
                                                 project_app_config,2,
                                                 [{file,
                                                   "/home/travis/build/rebar/rebar3/_build/default/lib/rebar/src/rebar_app_discover.erl"},
                                                  {line,127}]},
                                                {rebar_app_discover,
                                                 merge_deps,2,
                                                 [{file,
                                                   "/home/travis/build/rebar/rebar3/_build/default/lib/rebar/src/rebar_app_discover.erl"},
                                                  {line,81}]},
                                                {rebar_app_discover,
                                                 '-do/2-fun-1-',5,
                                                 [{file,
                                                   "/home/travis/build/rebar/rebar3/_build/default/lib/rebar/src/rebar_app_discover.erl"},
                                                  {line,46}]},
                                                {lists,foldl,3,
                                                 [{file,"lists.erl"},
                                                  {line,1262}]},
                                                {rebar_prv_app_discovery,do,
                                                 1,
                                                 [{file,
                                                   "/home/travis/build/rebar/rebar3/_build/default/lib/rebar/src/rebar_prv_app_discovery.erl"},
                                                  {line,38}]},
                                                {rebar_core,do,2,
                                                 [{file,
                                                   "/home/travis/build/rebar/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
                                                  {line,125}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :erlware_commons, "/Users/antipax/.mix/rebar3 bare compile --paths "/Users/antipax/Documents/Code/my_app/apps/my_app/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile erlware_commons", update it with "mix deps.update erlware_commons" or clean it with "mix deps.clean erlware_commons"

@ericentin
Copy link
Contributor

Here's the rebar3 report for the command, as well:

╰─$ /Users/antipax/.mix/rebar3 report 'bare compile --paths "/Users/antipax/Documents/Code/my_app/apps/my_app/_build/dev/lib/*/ebin"'                                                             1 ↵
Rebar3 report
 version 3.0.0+build.272.ref7d29b74
 generated at 2016-05-18T14:30:24+00:00
=================
Please submit this along with your issue at https://github.com/rebar/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: bare
Entered as:
  bare compile --paths "/Users/antipax/Documents/Code/my_app/apps/my_app/_build/dev/lib/*/ebin"
-----------------
Operating System: x86_64-apple-darwin15.3.0
ERTS: Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]
Root Directory: /usr/local/Cellar/erlang/18.3/lib/erlang
Library directory: /usr/local/Cellar/erlang/18.3/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.0.4
certifi: 0.4.0
cf: 0.2.1
common_test: 1.12
compiler: 6.0.3
crypto: 3.6.3
cth_readable: 1.2.2
dialyzer: 2.9
edoc: 0.7.18
erlware_commons: 0.19.0
eunit: 2.2.13
eunit_formatters: 0.3.1
getopt: 0.8.2
inets: 6.2
kernel: 4.2
providers: 1.6.0
public_key: 1.1.1
relx: 3.17.0
sasl: 2.7
snmp: 5.2.2
ssl_verify_hostname: 1.0.5
stdlib: 2.8
syntax_tools: 1.7
tools: 2.8.3

-----------------
Escript path: /Users/antipax/.mix/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref

@liveforeverx
Copy link
Contributor

liveforeverx commented May 18, 2016

@antipax update erlware_commons from 0.19.0 to 0.20.0 this fixes error for

Uncaught error: {badmatch,
                             {error,
                              {19,file,
                               {error,
                                {badmatch,
                                 ["3","0","0+build","272","ref7d29b74"]},
                                [{erl_eval,expr,3,[]}]}}}}

I had the same issue, it will be fixed with: {:erlware_commons, "~> 0.20.0", override: true}

@ericmj
Copy link
Member

ericmj commented Jun 20, 2016

The issues above with badmatch errors have been resolved with new rebar3 builds that we provide in mix local.rebar.

@josevalim Wdyt about this:

What do you think about introducing a warning if :manager is not explicitly set and we can't infer it with 100% certainty?

@josevalim
Copy link
Member Author

What do you think about introducing a warning if :manager is not explicitly set and we can't infer it with 100% certainty?

When would this happen?

@josevalim
Copy link
Member Author

josevalim commented Jun 24, 2016

@ericmj ping. :)

Btw, I think we should make rebar3 the default in master so we can give it a try for a good while.

@ericmj
Copy link
Member

ericmj commented Jun 24, 2016

When would this happen?

I pushed a change to master that detects rebar.lock which we can with 100% certainty mark as rebar3 since rebar2 didn't use locks. So in practice you would have to explicitly set it for rebar2 deps and rebar3 deps that do not commit rebar.lock (they should commit it). And only for git/path deps.

@ericmj
Copy link
Member

ericmj commented Jun 28, 2016

Implemented in 17557aa.

@ericmj ericmj closed this as completed Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants