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

Try using rebar3 #3938

Draft
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Draft

Try using rebar3 #3938

wants to merge 1 commit into from

Conversation

nickva
Copy link
Contributor

@nickva nickva commented Feb 22, 2022

  • Use 3.15.2 version which is compatible with Erlang 20
  • Use Basho's rebar_raw_resource for raw deps

Currently fails with:

DIAGNOSTIC=1 ./configure --dev
==> configuring couchdb in rel/couchdb.config
==> updating dependencies
===> Evaluating config script "rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Conflicting 'resource' resource definitions
===> error: {rebar_raw_resource,{duplicate_res_type,resource}} [{rebar_raw_resource,
                                                                        map_res,
                                                                        2,
                                                                        [{file,
                                                                          "/Users/nvatama/asf-3/_build/default/plugins/rebar_raw_resource/src/rebar_raw_resource.erl"},
                                                                         {line,
                                                                          586}]},
                                                                       {rebar_raw_resource,
                                                                        absorb_resources,
                                                                        2,
                                                                        [{file,
                                                                          "/Users/nvatama/asf-3/_build/default/plugins/rebar_raw_resource/src/rebar_raw_resource.erl"},
                                                                         {line,
                                                                          395}]},
                                                                       {rebar_raw_resource,
                                                                        absorb_state,
                                                                        1,
                                                                        [{file,
                                                                          "/Users/nvatama/asf-3/_build/default/plugins/rebar_raw_resource/src/rebar_raw_resource.erl"},
                                                                         {line,
                                                                          350}]},
                                                                       {rebar_raw_resource,
                                                                        init,
                                                                        1,
                                                                        [{file,
                                                                          "/Users/nvatama/asf-3/_build/default/plugins/rebar_raw_resource/src/rebar_raw_resource.erl"},
                                                                         {line,
                                                                          198}]},
                                                                       {rebar_state,
                                                                        '-create_logic_providers/2-fun-0-',
                                                                        2,
                                                                        [{file,
                                                                          "/Users/nvatama/asf-3/src/rebar3/src/rebar_state.erl"},
                                                                         {line,
                                                                          506}]},
                                                                       {lists,
                                                                        foldl,
                                                                        3,
                                                                        [{file,
                                                                          "lists.erl"},
                                                                         {line,
                                                                          1263}]},
                                                                       {rebar_state,
                                                                        create_logic_providers,
                                                                        2,
                                                                        [{file,
                                                                          "/Users/nvatama/asf-3/src/rebar3/src/rebar_state.erl"},
                                                                         {line,
                                                                          505}]},
                                                                       {rebar_plugins,
                                                                        '-handle_plugins/4-fun-0-',
                                                                        4,
                                                                        [{file,
                                                                          "/Users/nvatama/asf-3/src/rebar3/src/rebar_plugins.erl"},
                                                                         {line,
                                                                          101}]}]
===> Failed creating providers. Run with DIAGNOSTIC=1 for stacktrace or consult rebar3.crashdump.

configure Outdated
@@ -345,7 +345,7 @@ fi
# only update dependencies, when we are not in a release tarball
if [ -d .git -a $SKIP_DEPS -ne 1 ]; then
echo "==> updating dependencies"
${REBAR} get-deps update-deps
${REBAR3} get-deps update-deps

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no update-deps command. Also, you can't run multiple commands this way but have to use do:

rebar3 do compile, ct

You also shouldn't need to run get-deps ever. It is a backwards compat command we added after the fact even though it isn't really needed -- though can be useful like when building a docker image to first fetch the deps into a layer. So you may just be wanting rebar3 upgrade here.

@tsloughter
Copy link

I just looked at rebar_raw_resource hasn't been updated in over 6 years, I doubt it works. There may be another raw resource plugin.

@nickva
Copy link
Contributor Author

nickva commented Mar 12, 2022

Thanks for taking a look, @tsloughter. It's much appreciated.

For raw dependencies, would it be feasible to turn those into empty/no-op erlang apps so they can compile and build like regular dependencies?

@tsloughter
Copy link

If you are able to control the dependencies then yes, turning them into empty erlang apps should work. They wouldn't be included in the release, so would just be "apps" fetched and kept in _build.

@nickva
Copy link
Contributor Author

nickva commented Mar 12, 2022

If you are able to control the dependencies then yes, turning them into empty erlang apps should work. They wouldn't be included in the release, so would just be "apps" fetched and kept in _build.

Thanks! We do control them and that may be the easiest way to go, then

 * Use 3.15.2 version which is compatible with Erlang 20
 * Fauxton and docs converted to be used as rebar3 deps
 * Use get-deps only instead of update-deps
@nickva
Copy link
Contributor Author

nickva commented Mar 15, 2022

Some progress

  • Basic Erlang app structure in raw dependencies seems to have worked (thanks, Tristan!)
  • Created an initially broken symlink from src/{docs|fauxton} -> _build/_build/default/lib/{docs|fauxton} which later gets filled in by the get-deps. This is mainly to avoid altering docs and Fauxton tooling which expects those deps in those directories.
  • configure i.e. download rebar3, get-deps seems to work
  • make works as well, but not sure if it all the artifacts end up in the right place
  • eunit starts and runs for a few basic erlang app but chokes on a NIF
   module 'couch_debug'
      link_tree tests
        couch_debug:753: should_have_same_shape...[0.001 s] ok
        couch_debug:761: should_include_extra_info...[0.001 s] ok
        [done in 0.020 s]
      [done in 0.020 s]
    module 'couch_doc'
undefined
*** test module not found ***
**couch_ejson_compare

@jaydoane
Copy link
Contributor

Given that we may be dropping OTP 20 support "soon", what happens when you try a more modern version like 3.18.0 or main? Guessing that won't help with the NIF choke?

@nickva
Copy link
Contributor Author

nickva commented Apr 6, 2022

@jaydoane good idea to try. The version we have is pretty old. But I suspect in this case it's the issue with odd paths we expect these NIFs to have relative the top of the (top) umbrella folder vs the individual dep app folder in various contexts (eunit tests vs regular builds).

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.

None yet

3 participants