exthereum / libsecp256k1

Erlang NIF bindings for libsecp256k1 ECDSA library
MIT License
8 stars 23 forks source link

Use mix as build system #6

Closed atoulme closed 6 years ago

hayesgm commented 6 years ago

Great, I think this is the right direction!

When I run mix deps.get && mix locally, I get:

==> libsecp256k1
Compiling 1 file (.erl)
src/libsecp256k1.erl:146: Warning: function not_loaded/1 is unused
Generated libsecp256k1 app
=CRASH REPORT==== 15-Aug-2018::00:06:35.313683 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.199.0>
    registered_name: []
    exception exit: {bad_return,
                        {{libsecp256k1,start,[normal,[]]},
                         {'EXIT',
                             {undef,
                                 [{libsecp256k1,start,[normal,[]],[]},
                                  {application_master,start_it_old,4,
                                      [{file,"application_master.erl"},
                                       {line,277}]}]}}}}
      in function  application_master:init/4 (application_master.erl, line 138)
    ancestors: [<0.198.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.200.0>,normal}]
    links: [<0.198.0>,<0.42.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 242
  neighbours:

=INFO REPORT==== 15-Aug-2018::00:06:35.315752 ===
    application: libsecp256k1
    exited: {bad_return,
                {{libsecp256k1,start,[normal,[]]},
                 {'EXIT',
                     {undef,
                         [{libsecp256k1,start,[normal,[]],[]},
                          {application_master,start_it_old,4,
                              [{file,"application_master.erl"},
                               {line,277}]}]}}}}
    type: temporary
** (Mix) Could not start application libsecp256k1: exited in: :libsecp256k1.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function :libsecp256k1.start/2 is undefined or private
            (libsecp256k1) :libsecp256k1.start(:normal, [])
            (kernel) application_master.erl:277: :application_master.start_it_old/4

any thoughts?

atoulme commented 6 years ago

I'm guessing this is because this is not an app, and therefore there is no start method.

atoulme commented 6 years ago

I have removed the applications definition from the mix build file, and now mix runs with an empty output, and a return code of 0.

hayesgm commented 6 years ago

Cool looks good to me. I believe the readme is inaccurate now, since it should just be mix compile etc, right? Plus, we should probably add a reference to adding this as a dependency from hex.

hayesgm commented 6 years ago

lgtm

hayesgm commented 6 years ago

Added as https://hex.pm/packages/libsecp256k1/0.1.5