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

Add support for rebar3 - remove use of rebar2 port compiler config #135

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

Vagabond
Copy link
Contributor

@Vagabond Vagabond commented Mar 4, 2015

Rebar3 doesn't include a port compiler because it turns out it is too
brittle and unportable. Switch to a Makefile via a compile hook instead
to make things compatible with both rebar2 and rebar3.

Rebar3 doesn't include a port compiler because it turns out it is too
brittle and unportable. Switch to a Makefile via a compile hook instead
to make things compatible with both rebar2 and rebar3.
@cmeiklejohn
Copy link
Contributor

Hrm.

[cmeiklejohn@ChristophersMBP eleveldb ((230111a...))]$ ./rebar -v
ERROR: Failed to load /Users/cmeiklejohn/Documents/eleveldb/rebar.config: {error,
                                                                           {32,
                                                                            file,
                                                                            {error,
                                                                             {badmatch,
                                                                              false},
                                                                             [{erl_eval,
                                                                               expr,
                                                                               3,
                                                                               []}]}}}

@Vagabond
Copy link
Contributor Author

Vagabond commented Mar 4, 2015

It doesn't happen for me, line 32 of the rebar.config seems ok to me?

@cmeiklejohn
Copy link
Contributor

[cmeiklejohn@ChristophersMBP eleveldb ((230111a...))]$ git status
HEAD detached at helium/adt-rebar3
nothing to commit, working directory clean

Did you try the included rebar or are you using your own rebar?

@Vagabond
Copy link
Contributor Author

Vagabond commented Mar 4, 2015

I'm using the included one

git status
On branch adt-rebar3
Your branch is up-to-date with 'origin/adt-rebar3'.
nothing to commit, working directory clean
erl
Erlang R16B02-basho4 (erts-5.10.3) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

@cmeiklejohn
Copy link
Contributor

[cmeiklejohn@ChristophersMBP eleveldb ((230111a...))]$ erl -v
Erlang R16B02-basho6 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [frame-pointer] [dtrace]

@cmeiklejohn
Copy link
Contributor

[cmeiklejohn@ChristophersMBP eleveldb ((230111a...))]$ git checkout develop
Previous HEAD position was 230111a... Add support for rebar3 - remove use of rebar2 port compiler config
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
[cmeiklejohn@ChristophersMBP eleveldb (develop)]$ make
./rebar get-deps
==> eleveldb (get-deps)
Cloning into 'leveldb'...
Note: checking out '2.0.0'.

Is there some sort of weird character encoding in that rebar file or something?

@cmeiklejohn cmeiklejohn self-assigned this Mar 4, 2015
@cmeiklejohn
Copy link
Contributor

I can reproduce this problem on the develop branch by removing the port_env section of the rebar.config file and running ./rebar compile.

@Vagabond
Copy link
Contributor Author

Vagabond commented Mar 4, 2015

1> file:consult("rebar.config").
{ok,[{eunit_opts,[verbose]},
     {so_name,"eleveldb.so"},
     {xref_checks,[undefined_function_calls]},
     {port_sources,["c_src/*.cc"]},
     {erl_opts,[warnings_as_errors,
                {parse_transform,lager_transform},
                debug_info]},
     {deps,[{cuttlefish,".*",
                        {git,"git://github.com/basho/cuttlefish.git",
                             {branch,"develop"}}}]},
     {pre_hooks,[{'get-deps',"c_src/build_deps.sh get-deps"},
                 {compile,"c_src/build_deps.sh"},
                 {compile,"make -C c_src"}]},
     {post_hooks,[{clean,"c_src/build_deps.sh clean"}]}]}

@cmeiklejohn
Copy link
Contributor

Adding {port_env, []} resolves the problem, but omitting port_env triggers the parse failure.

@tsloughter
Copy link

You can now simply add this to your config that lists eleveldb as a dep to be able to build eleveldb: https://gist.github.com/tsloughter/8135f58949e7a3144bf7

But eleveldb's port config stuff is even legacy by rebar2's standards. I had to update @blt's port compiler plugin to support it. Also covered in this PR #84

So something to clean up eleveldb building would be nice whether it is updating the rebar config or going with the Makefile :)

@marianoguerra
Copy link

I'm trying to port some stuff to rebar3 and this is one of the stoppers at the moment 👍

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

Successfully merging this pull request may close these issues.

4 participants