Closed ferd closed 4 years ago
I guess this is an issue with the support for publishing multiple apps from the same project. I don't think there are any tests for it or that any one uses it so not surprised it is broken.
Thanks for your answer! My intent was to publish through this project a single (library) application (myriad), moreover with no dependency (except Erlang of course). Maybe there is something in https://github.com/Olivier-Boudeville/Ceylan-Myriad/blob/master/rebar.config or in https://github.com/Olivier-Boudeville/Ceylan-Myriad/blob/master/conf/myriad.app.src that is wrong with this regard? (my next step will be to do the same for applications that themselves will depend on Myriad, but I start with this autonomous base first).
I thought I saw other apps in there but I guess I was just confused by the use of an apps
directory you have under src
and the use of _app.erl
modules not for the starting module of an application.
But conf
is not a directory that rebar3 will search for .app.src
file. Try moving it to src
.
Oh, I was not expecting rebar3 to read or even lookup conf/myriad.app.src: from that template, I generate a (supposedly correct) _build/default/lib/myriad/ebin/myriad.app (see http://esperide.com/myriad.app) which, as I understand, is found and read by rebar3; from that I believe the OTP application and release are correctly generated by rebar3 (that part looks good), but, after, the generation of the hex package fails. Here is the structure on which it operates : _build ├── default │ ├── lib │ │ └── myriad │ │ ├── doc │ │ │ ├── LICENSE │ │ │ └── README.md │ │ ├── ebin │ │ │ ├── app_facilities.beam │ │ │ ├── asset_tool_app.beam │ │ │ ├── ast_base.beam │ │ │ ├── ast_bitstring.beam │ │ │ ├── ast_clause.beam │ │ │ ├── ast_expression.beam │ │ │ ├── ast_function.beam │ │ │ ├── ast_generation.beam │ │ │ ├── ast_guard.beam │ │ │ ├── ast_info.beam │ │ │ ├── ast_map.beam │ │ │ ├── ast_pattern.beam │ │ │ ├── ast_record.beam │ │ │ ├── ast_scan.beam │ │ │ ├── ast_transform.beam │ │ │ ├── ast_type.beam │ │ │ ├── ast_utils.beam │ │ │ ├── ast_value.beam │ │ │ ├── basic_utils.beam │ │ │ ├── bijective_table.beam │ │ │ ├── bin_utils.beam │ │ │ ├── bounding_box.beam │ │ │ ├── cipher_utils.beam │ │ │ ├── code_utils.beam │ │ │ ├── cond_utils.beam │ │ │ ├── const_table.beam │ │ │ ├── csv_utils.beam │ │ │ ├── example_parse_transform.beam │ │ │ ├── executable_utils.beam │ │ │ ├── file_utils.beam │ │ │ ├── fsm_utils.beam │ │ │ ├── generate_password_app.beam │ │ │ ├── graph_utils.beam │ │ │ ├── gui.beam │ │ │ ├── gui_canvas.beam │ │ │ ├── gui_color.beam │ │ │ ├── gui_event.beam │ │ │ ├── gui_opengl.beam │ │ │ ├── gui_text.beam │ │ │ ├── gui_wx_backend.beam │ │ │ ├── hashtable.beam │ │ │ ├── id_utils.beam │ │ │ ├── java_utils.beam │ │ │ ├── language_utils.beam │ │ │ ├── lazy_hashtable.beam │ │ │ ├── linear_2D.beam │ │ │ ├── linear_3D.beam │ │ │ ├── linear_4D.beam │ │ │ ├── linear.beam │ │ │ ├── list_table.beam │ │ │ ├── list_utils.beam │ │ │ ├── map_hashtable.beam │ │ │ ├── math_utils.beam │ │ │ ├── merge_app.beam │ │ │ ├── merge_utils.beam │ │ │ ├── meta_utils.beam │ │ │ ├── monitor_utils.beam │ │ │ ├── most_basic_example_app.beam │ │ │ ├── myriad.app │ │ │ ├── myriad_parse_transform.beam │ │ │ ├── naming_utils.beam │ │ │ ├── net_utils.beam │ │ │ ├── option_list.beam │ │ │ ├── otp_utils.beam │ │ │ ├── pair.beam │ │ │ ├── password_generation.beam │ │ │ ├── polygon.beam │ │ │ ├── preferences.beam │ │ │ ├── process_dictionary.beam │ │ │ ├── python_utils.beam │ │ │ ├── random_utils.beam │ │ │ ├── rdf_utils.beam │ │ │ ├── rest_utils.beam │ │ │ ├── ring_utils.beam │ │ │ ├── rk4_solver.beam │ │ │ ├── script_utils.beam │ │ │ ├── set_utils.beam │ │ │ ├── simple_parse_transform_target.beam │ │ │ ├── sms_utils.beam │ │ │ ├── system_utils.beam │ │ │ ├── term_ui.beam │ │ │ ├── test_facilities.beam │ │ │ ├── text_ui.beam │ │ │ ├── text_utils.beam │ │ │ ├── time_utils.beam │ │ │ ├── trace_utils.beam │ │ │ ├── tracked_hashtable.beam │ │ │ ├── tree.beam │ │ │ ├── type_utils.beam │ │ │ ├── ui.beam │ │ │ ├── unit_utils.beam │ │ │ └── web_utils.beam │ │ ├── include │ │ │ ├── app_facilities.hrl │ │ │ ├── ast_info.hrl │ │ │ ├── ast_transform.hrl │ │ │ ├── ast_utils.hrl │ │ │ ├── bounding_box.hrl │ │ │ ├── data_types.hrl │ │ │ ├── fsm_utils.hrl │ │ │ ├── gui_canvas.hrl │ │ │ ├── gui.hrl │ │ │ ├── gui_internal_defines.hrl │ │ │ ├── lazy_hashtable.hrl │ │ │ ├── linear_2D.hrl │ │ │ ├── linear_3D.hrl │ │ │ ├── linear_4D.hrl │ │ │ ├── linear.hrl │ │ │ ├── math_utils.hrl │ │ │ ├── meta_utils.hrl │ │ │ ├── myriad_script_include.hrl │ │ │ ├── net_utils.hrl │ │ │ ├── polygon.hrl │ │ │ ├── spawn_utils.hrl │ │ │ ├── system_utils.hrl │ │ │ ├── term_ui.hrl │ │ │ ├── test_facilities.hrl │ │ │ └── ui.hrl │ │ ├── priv │ │ │ └── examples │ │ ├── src -> ../../../../src │ │ └── test │ │ ├── ast_generation_test.erl │ │ ├── basic_utils_test.erl │ │ ├── bijective_table_test.erl │ │ ├── bin_utils_test.erl │ │ ├── cipher_utils_test.erl │ │ ├── code_utils_test.erl │ │ ├── cond_utils_test.erl │ │ ├── const_table_test.erl │ │ ├── csv_utils_test.erl │ │ ├── executable_utils_test.erl │ │ ├── file_utils_test.erl │ │ ├── fsm_utils_test.erl │ │ ├── graph_utils_test.erl │ │ ├── gui_minimal_test.erl │ │ ├── gui_opengl_test.erl │ │ ├── gui_overall_test.erl │ │ ├── gui_simple_test.erl │ │ ├── hashtable_test.erl │ │ ├── hdf5_support_test.erl │ │ ├── id_utils_test.erl │ │ ├── lazy_hashtable_test.erl │ │ ├── linear_2D_test.erl │ │ ├── linear_3D_test.erl │ │ ├── linear_4D_test.erl │ │ ├── list_table_test.erl │ │ ├── list_utils_test.erl │ │ ├── lorenz_test.erl │ │ ├── map_hashtable_test.erl │ │ ├── math_utils_test.erl │ │ ├── meta_utils_test.erl │ │ ├── minimal_parse_transform_test.erl │ │ ├── myriad_otp_application_test.erl │ │ ├── myriad_parse_transform_test.erl │ │ ├── naming_utils_test.erl │ │ ├── net_utils_test.erl │ │ ├── option_list_test.erl │ │ ├── polygon_test.erl │ │ ├── preferences_test.erl │ │ ├── process_dictionary_test.erl │ │ ├── random_utils_test.erl │ │ ├── raw_hdf5_test.erl │ │ ├── rest_utils_test.erl │ │ ├── ring_utils_test.erl │ │ ├── script_utils_test.erl │ │ ├── set_utils_test.erl │ │ ├── sms_utils_test.erl │ │ ├── sql_support_test.erl │ │ ├── system_utils_test.erl │ │ ├── tables_comparison_test.erl │ │ ├── table_test.erl │ │ ├── term_ui_test.erl │ │ ├── text_ui_test.erl │ │ ├── text_utils_test.erl │ │ ├── time_utils_test.erl │ │ ├── trace_utils_test.erl │ │ ├── tracked_hashtable_test.erl │ │ ├── tree_test.erl │ │ ├── ui_test.erl │ │ ├── unit_utils_test.erl │ │ └── web_utils_test.erl │ └── rel │ └── myriad_release │ ├── bin │ │ ├── install_upgrade.escript │ │ ├── myriad_release │ │ ├── myriad_release-1.0.0 │ │ ├── nodetool │ │ ├── no_dot_erlang.boot │ │ └── start_clean.boot │ ├── lib │ │ └── myriad-1.0.0 -> [...]/Ceylan-Myriad/_build/default/lib/myriad │ └── releases │ ├── 1.0.0 │ │ ├── myriad_release.boot │ │ ├── myriad_release.rel │ │ ├── myriad_release.script │ │ ├── no_dot_erlang.boot │ │ ├── start_clean.boot │ │ ├── sys.config │ │ └── vm.args │ ├── RELEASES │ └── start_erl.data
(said differently, the GNU make system must be reproducing the usual structure that Emakefile-based projects rely on; as far as I can tell [rebar3 being happy + testing as well], the myriad application and release are ok)
Unlike a release which just cares that you have beams and a .app file, rebar3_hex works on the source so it is a different level of concern.
Oh, I see, I thought the package was based on top of the application or the release (on BEAM files thus). I will then experiment by myself and mimic a standard source layout rather than creating a symlink to my real, nested source tree. Hopefully no compilation or check will be attempted by the plugin, as most modules are parse-transformed... I will report any findings here. Thanks again!
I mimicked said structure (all sources directly in src, all BEAMs directly in ebin, myriad.app in both directories (to be sure)), and tried:
rebar3 hex publish ===> Verifying dependencies... ===> Using deprecated rebar_utils:vcs_vsn/3. Please upgrade your plugins. ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump ===> When submitting a bug report, please include the output of
rebar3 report "your command"
I thought rebar3 and its plugins were self-updating though, knowing (as I understand) that the plugin has been automatically installed when "{plugins, [rebar3_hex]}." was found in rebar.config?
More info follows:
DEBUG=1 rebar3 hex publish ===> Load global config file MY_HOME/.config/rebar3/rebar.config ===> 22.0 satisfies the requirement for minimum OTP version 18 ===> 22.0 satisfies the requirement for minimum OTP version 18 ===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user ===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut ===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key ===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner ===> Not adding provider hex repo from module rebar3_hex_repo because it already exists from module rebar3_hex_repo ===> Not adding provider hex docs from module rebar3_hex_docs because it already exists from module rebar3_hex_docs ===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search ===> Not adding provider hex revert from module rebar3_hex_revert because it already exists from module rebar3_hex_revert ===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire ===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish ===> Expanded command sequence to be run: [] ===> Provider: {default,do} ===> Expanded command sequence to be run: [{default,app_discovery}, {default,install_deps}, {default,lock}, {hex,publish}] ===> Provider: {default,app_discovery} ===> 22.0 satisfies the requirement for minimum OTP version 18 ===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user ===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut ===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key ===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner ===> Not adding provider hex repo from module rebar3_hex_repo because it already exists from module rebar3_hex_repo ===> Not adding provider hex docs from module rebar3_hex_docs because it already exists from module rebar3_hex_docs ===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search ===> Not adding provider hex revert from module rebar3_hex_revert because it already exists from module rebar3_hex_revert ===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire ===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish ===> Provider: {default,install_deps} ===> Verifying dependencies... ===> Provider: {default,lock} ===> Provider: {hex,publish} ===> Using deprecated rebar_utils:vcs_vsn/3. Please upgrade your plugins. ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump ===> Uncaught error: {badmatch,[]} ===> Stack trace to the error location: [{rebar3_hex_utils,update_app_src,2, [{file,"/tmp/Ceylan-Myriad/_build/default/plugins/rebar3_hex/src/rebar3_hex_utils.erl"}, {line,214}]}, {rebar3_hex_publish,publish,3, [{file,"/tmp/Ceylan-Myriad/_build/default/plugins/rebar3_hex/src/rebar3_hex_publish.erl"}, {line,132}]}, {lists,foldl,3,[{file,"lists.erl"},{line,1263}]}, {rebar_core,do,2, [{file,"MY_HOME/Software/rebar3/src/rebar_core.erl"}, {line,154}]}, {rebar_prv_do,do_task,5, [{file,"MY_HOME/Software/rebar3/src/rebar_prv_do.erl"}, {line,87}]}, {rebar_core,do,2, [{file,"MY_HOME/Software/rebar3/src/rebar_core.erl"}, {line,154}]}, {rebar3,run_aux,2, [{file,"MY_HOME/Software/rebar3/src/rebar3.erl"},{line,178}]}, {rebar3,main,1, [{file,"MY_HOME/Software/rebar3/src/rebar3.erl"},{line,66}]}] ===> When submitting a bug report, please include the output of
rebar3 report "your command"
rebar3 report hex publish Rebar3 report version 3.11.1+build.4421.ref76935555 generated at 2019-07-20T19:38:26+00:00
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
Task: hexpublish Entered as: hexpublish
Operating System: x86_64-unknown-linux-gnu ERTS: Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] Root Directory: MY_HOME/Software/Erlang/Erlang-22.0/lib/erlang Library directory: MY_HOME/Software/Erlang/Erlang-22.0/lib/erlang/lib
Loaded Applications: bbmustache: 1.6.1 certifi: 2.5.1 cf: 0.2.2 common_test: 1.17.3 compiler: 7.4 crypto: 4.5 cth_readable: 1.4.5 dialyzer: 4.0 edoc: 0.11 erlware_commons: 1.3.1 eunit: 2.3.7 eunit_formatters: 0.5.0 getopt: 1.0.1 hipe: 3.19 inets: 7.0.8 kernel: 6.4 providers: 1.8.1 public_key: 1.6.7 relx: 3.32.1 sasl: 3.4 snmp: 5.3 ssl_verify_fun: 1.1.5 stdlib: 3.9 syntax_tools: 2.2 tools: 3.2
Escript path: /usr/local/bin/rebar3 Providers: app_discovery as clean compile compile cover ct cut deps dialyzer do docs edoc escriptize eunit get-deps help install install_deps key list lock new owner path pkgs publish release relup repo report repos retire revert search shell state tar tree unlock update upgrade upgrade upgrade user version xref
Looks like a different concern, with the plugin itself, w.r.t its update?
"myriad.app in both directories" -- don't you have a myriad.app.src
? Place that file, delete any others or any myriad.app
file, in src/
.
rebar3 is not self updating, nor is the rebar3_hex plugin.
OK, thanks to your help and a bit of investigation I think most issues are solved:
I had: "==> Using deprecated rebar_utils:vcs_vsn/3. Please upgrade your plugins."
Which are they? $ rebar3 plugins list --- Global plugins --- rebar3_hex (6.7.0)
--- Local plugins --- rebar3_hex (6.7.0)
So:
$ rebar3 plugins upgrade rebar3_hex ===> No upgrade needed for rebar3_hex ===> No upgrade needed for hex_core ===> No upgrade needed for verl
Strange, but I continued nevertheless (I had tried also 'rebar3 local upgrade' beforehand).
regarding the myriad.app.src: I thought (after having read the "Erlang and OTP In action" book) that only myriad.app mattered and that the myriad.app.src was a mere (optional) template (mine could not be read by file:consult/1, as it included placeholders); I understand now that the .app.src it is a de facto standard for rebar3, even if I then fail to see what is the difference between a .app.src and a .app; anyway I copied a correct myriad.app to src/myriad.app.src, and:
rebar3 hex publish ===> Verifying dependencies... ===> Using deprecated rebar_utils:vcs_vsn/3. Please upgrade your plugins. Publishing myriad 1.0.0 to hexpm Description: Ceylan-Myriad, a generic-purpose Erlang toolbox, as an OTP application library here (see http://myriad.esperide.org) Dependencies:
Included files: LICENSE README.md rebar.config rebar.lock src/app_facilities.erl [...] Build tools: rebar3 Be aware, you are publishing to the public Hexpm repository. Before publishing, please read Hex CoC: https://hex.pm/policies/codeofconduct Proceed? ("Y")> Local Password: ===> Published myriad 1.0.0
And indeed it worked, as one can check at https://hex.pm/packages/myriad. I do not know yet how correct and usable that package is, but it is already, considering the date, "one small step for man".
Thanks for your help!
@ferd This issue seems resolved/stale to me, do you still a need for it?
Didn't recall but seems to line up with a bunch of sections you had reworked, closing until more is heard.
This issue is taken from: https://www.rebar3.org/discuss/5d316b697eda3a002e68ca8e
Hi,
I have an Erlang/OTP library application / release (namely myriad, i.e. https://github.com/Olivier-Boudeville/Ceylan-Myriad) that I try to integrate as an hex package thanks to rebar3.
I tried to follow the guidelines in https://www.rebar3.org/docs/publishing-packages and https://www.rebar3.org/docs/hex-package-management but with not much luck.
I have an account at hex.pm and tried to set up everything properly (outputs edited so that real info are replaced with MY_* placeholders):
(looks ok)
(looks ok)
(so: still nothing)
(no clear what to enter; I tried nothing, A, "A", etc.), it just stops just after I hit Enter (no output, no error, return code is 0).
If I enter 0 or 1 instead:
With more details:
So:
Any help appreciated!
Thanks in advance, Best regards,
Olivier.
PS: By the way, the 'info' command (mentioned in https://www.rebar3.org/docs/hex-package-management) does not seem to exist: