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

can't run this plugin as a release hook any more? #7

Closed
marianoguerra opened this issue Feb 20, 2016 · 8 comments
Closed

can't run this plugin as a release hook any more? #7

marianoguerra opened this issue Feb 20, 2016 · 8 comments

Comments

@marianoguerra
Copy link
Contributor

hi,

I used to have cuttlefish as a post hook for release, now it complains with:

escript: exception error: no function clause matching 
             rlx_prv_release:format_error({error,
                                           {rebar_hooks,
                                            {bad_provider,post,release,
                                             cuttlefish}}}) (/home/mariano/soft/rebar3/_build/default/lib/relx/src/rlx_prv_release.erl, line 53)
  in function  rebar3:handle_error/1 (/home/mariano/soft/rebar3/_build/default/lib/rebar/src/rebar3.erl, line 270)
  in call from escript:run/2 (escript.erl, line 757)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1 
  in call from init:start_em/1 

if I change the post hook for {cuttlefish, release} it enters in a loop.

I think there should be a way to hook cuttlefish into the release task so it's transparent for the user and she can run the release task always not having to think about cuttlefish. or am I missing something?

@tsloughter
Copy link
Collaborator

@marianoguerra I just pushed a fix for this if you grab the latest rebar3 master as well. You have to put it under {project_plugins, [rebar3_cuttlefish]}. and use the git repo for the plugin right now actually, not the hex package like I did just there, until I publish the new version.

@marianoguerra
Copy link
Contributor Author

I get

 ===> Plugin rebar3_cuttlefish not available. It will not be used.

if I put it as a git dependency I get the same

===> Plugin {rebar3_cuttlefish,
                   {git,
                       "git://github.com/tsloughter/rebar3_cuttlefish.git",
                       {branch,"master"}}} not available. It will not be used.

@marianoguerra
Copy link
Contributor Author

$ rebar3 report
Rebar3 report
 version alpha-4+build.3311.refcb02636
 generated at 2016-02-22T07:53:48+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: 
Entered as:

-----------------
Operating System: x86_64-pc-linux-gnu
ERTS: Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false]
Root Directory: /usr/lib/erlang
Library directory: /usr/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.0.4
certifi: 0.3.0
cf: 0.2.1
common_test: 1.11
compiler: 6.0
crypto: 3.6
cth_readable: 1.2.0
dialyzer: 2.8
edoc: 0.7.17
erlware_commons: 0.19.0
eunit: 2.2.10
eunit_formatters: 0.3.1
getopt: 0.8.2
inets: 6.0
kernel: 4.0
providers: 1.6.0
public_key: 1.0
relx: 3.17.0
sasl: 2.5
snmp: 5.2
ssl_verify_hostname: 1.0.5
stdlib: 2.5
syntax_tools: 1.7
tools: 2.8

-----------------
Escript path: /home/mariano/bin/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 tar tree unlock update upgrade upgrade upgrade version xref

@marianoguerra
Copy link
Contributor Author

I'm getting some inconsistent results, I create a rebar3_riak_core project and then run:

rebar3 release

the first time the ===> Running cuttlefish schema generator part is not displayed, if I run it a second time it appears but then if I try tu run the build I get Cuttlefish failed! Oh no! the weird thing is that 2 or 3 times starting from scratch (even removing .cache/rebar3 to be sure) it made a build that worked, but with the same setup I removed _build rebar.lock and .cache/rebar3 and the next time it failed :/

@marianoguerra
Copy link
Contributor Author

one question, should I put the project plugin like this?

{project_plugins, [{rebar3_cuttlefish, {git, "git://github.com/tsloughter/rebar3_cuttlefish.git", {branch, "master"}}}]}.

if I put it there then it shouldn't go in the plugins section right?

this is the current rebar.config generated from the template: https://github.com/marianoguerra/rebar3_template_riak_core/blob/master/rebar3_riak_core_rebar.config.tpl

also one thing I think I commented but I can't see in the comments, sometimes on rebar3 release _build/default/bin/cuttlefish is not found and I have to copy it from _build/default/lib/cuttlefish/cuttlefish

@marianoguerra
Copy link
Contributor Author

===> Unable to copy from /home/mariano/tmp/ricor/_build/default/bin/cuttlefish to /home/mariano/tmp/ricor/_build/default/rel/ricor/bin/cuttlefish because of {copy_failed, enoent}

@tsloughter
Copy link
Collaborator

Yes, it should be {project_plugins, [{rebar3_cuttlefish, {git, "git://github.com/tsloughter/rebar3_cuttlefish.git", {branch, "master"}}}]}.

I'll play around with it this morning to see if I have similar issues. A couple others are also working on it, I think @ahf is trying the latest version today.

@marianoguerra
Copy link
Contributor Author

tried with latest master, it works, thanks!

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

No branches or pull requests

2 participants