nkezhaya / on_flow

Elixir client for Flow
MIT License
5 stars 3 forks source link

Can't compile Elixir project with on_flow dependencies as instructed #1

Closed njwest closed 3 years ago

njwest commented 3 years ago

Steps to generate project:

  1. mix new my_app
  2. Add deps to mix.exs as described in readme:
    {:on_flow, "~> 0.1"},
    {:grpc, github: "elixir-grpc/grpc"},
    {:cowlib, "~> 2.9", override: true}
  3. Run mix deps.get
  4. Run mix compile

Step four throws the following error:

== Compilation error in file lib/on_flow/channel.ex ==
** (CompileError) lib/on_flow/channel.ex:27: GRPC.Channel.__struct__/0 is undefined, cannot expand struct GRPC.Channel. Make sure the struct name is correct. If the struct name exists and is correct but it still cannot be found, you likely have cyclic module usage in your code
    (stdlib 3.13.2) lists.erl:1358: :lists.mapfoldl/3
could not compile dependency :on_flow, "mix compile" failed. You can recompile this dependency with "mix deps.compile on_flow", update it with "mix deps.update on_flow" or clean it with "mix deps.clean on_flow"

Can run this repo as a standalone elixir app, though

nkezhaya commented 3 years ago

@njwest Thanks! I can definitely reproduce this. Looking into a solution.

nkezhaya commented 3 years ago

Fixed in version 0.2.0. README file updated.

njwest commented 3 years ago

@whitepaperclip Confirming this fixes the compilation error, but on mix run with the new deps I now get the following error (looks like GRPC.Stub.connect/2 called by OnFlow.Channel):

23:01:07.162 [info]  Application on_flow exited: OnFlow.Application.start(:normal, []) returned an error: shutdown: failed to start child: OnFlow.Channel
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in GRPC.Stub.connect/2
            (grpc 0.5.0-beta.1) lib/grpc/stub.ex:129: GRPC.Stub.connect(nil, [])
            (on_flow 0.2.0) lib/on_flow/channel.ex:68: OnFlow.Channel.new_channel/0
            (on_flow 0.2.0) lib/on_flow/channel.ex:28: OnFlow.Channel.init/1
            (stdlib 3.13.2) gen_server.erl:417: :gen_server.init_it/2
            (stdlib 3.13.2) gen_server.erl:385: :gen_server.init_it/6
            (stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
** (Mix) Could not start application on_flow: OnFlow.Application.start(:normal, []) returned an error: shutdown: failed to start child: OnFlow.Channel
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in GRPC.Stub.connect/2
            (grpc 0.5.0-beta.1) lib/grpc/stub.ex:129: GRPC.Stub.connect(nil, [])
            (on_flow 0.2.0) lib/on_flow/channel.ex:68: OnFlow.Channel.new_channel/0
            (on_flow 0.2.0) lib/on_flow/channel.ex:28: OnFlow.Channel.init/1
            (stdlib 3.13.2) gen_server.erl:417: :gen_server.init_it/2
            (stdlib 3.13.2) gen_server.erl:385: :gen_server.init_it/6
            (stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
nkezhaya commented 3 years ago

Updated the README file with the required configuration options to fix this.