couchdb icon indicating copy to clipboard operation
couchdb copied to clipboard

Try using rebar3

Open nickva opened this issue 2 years ago • 7 comments

  • 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.

nickva avatar Feb 22 '22 16:02 nickva

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.

tsloughter avatar Mar 12 '22 17:03 tsloughter

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?

nickva avatar Mar 12 '22 17:03 nickva

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.

tsloughter avatar Mar 12 '22 23:03 tsloughter

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

nickva avatar Mar 12 '22 23:03 nickva

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

nickva avatar Mar 15 '22 05:03 nickva

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?

jaydoane avatar Mar 29 '22 15:03 jaydoane

@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).

nickva avatar Apr 06 '22 03:04 nickva