8000 Is Poolboy supported on Windows? · Issue #81 · devinus/poolboy · GitHub
[go: up one dir, main page]

Skip to content

Is Poolboy supported on Windows? #81

Open

Description

I tried using poolboy in my Elixir program on Windows. Mix fails to compile it. Something about rebar.


>mix deps.compile
==> poolboy (compile)
Compiling src/poolboy.erl failed:
src/poolboy.erl:17: type queue() undefined
ERROR: compile failed while processing c:/Users/my_user/Projects/my_app/deps/poolboy: rebar_abort
** (Mix) Could not compile dependency :poolboy, "escript.exe "c:/Users/my_user/.mix/rebar"" command failed. You can recompile this dependency with "mix deps.compile poolboy", update it with "mix deps.update poolboy" or clean it with "mix deps.clean poolboy"

On Mac it complied fine:


$ mix
Could not find "rebar", which is needed to build dependency :poolboy
I can install a local copy which is just used by Mix
Shall I install rebar? [Yn] Y
* creating /Users/my_user/.mix/rebar
==> poolboy (compile)
Compiled src/poolboy_sup.erl
Compiled src/poolboy_worker.erl
Compiled src/poolboy.erl
Compiled lib/my_app.ex
Generated my_app app

Activity

  1. Vagabond commented on Oct 21, 2015

    @Vagabond
    Collaborator

    That's an erlang version difference problem. Your erlang on windows is probably older.

  2. devinus commented on Oct 21, 2015

    @devinus
    Owner

    @ejstembler What is your Erlang version on Windows?

    Give me the output of erlang:system_info(otp_release).

  3. OnorioCatenacci commented on Oct 26, 2015

    @OnorioCatenacci

    This isn't really a bug. You just need to install Rebar on your Windows machine. http://theburningmonk.com/2014/08/getting-started-with-rebar-on-windows/

  4. OnorioCatenacci commented on Oct 26, 2015

    @OnorioCatenacci

    By the way, Eshell v7.0 is not the same as Eshell v7.1. They're both major version 18 but they're different minor versions.

  5. devinus commented on Oct 26, 2015

    @devinus
    Owner

    @OnorioCatenacci Wont mix download rebar automatically if not found?

  6. OnorioCatenacci commented on Oct 26, 2015

    @OnorioCatenacci

    That's a good question. I'm not sure. I just manually downloaded rebar
    when I needed it (there was some other dependency in Phoenix that needed
    rebar at one point).

    On Mon, Oct 26, 2015 at 4:00 PM, Devin Torres notifications@github.com
    wrote:

    @OnorioCatenacci https://github.com/OnorioCatenacci Wont mix download
    rebar automatically if not found?

    —
    Reply to this email directly or view it on GitHub
    #81 (comment).

    Onorio Catenacci

    http://onor.io
    http://www.google.com/+OnorioCatenacci

  7. OnorioCatenacci commented on Oct 26, 2015

    @OnorioCatenacci

    Here's something that may have relevance: elixir-lang/elixir#2152

    While the bug mentioned may have been fixed last year it's still worth taking a look at the comments.

  8. OnorioCatenacci commented on Oct 27, 2015

    @OnorioCatenacci

    That wouldn't have been the way that I would have suggested to get rebar
    but no matter. What do you get when you type "rebar" at a command prompt?
    That's the simplest way to insure rebar is set up and running correctly and
    in the path.

    Onorio

    On Tue, Oct 27, 2015 at 9:26 AM, Edward J. Stembler <
    notifications@github.com> wrote:

    I cloned rebar, compiled it locally, then added it to my path. The output:

    C:\Users\my_user\Projects\my_project>mix deps.get

    • Getting poolboy (https://github.com/devinus/poolboy.git)
      Cloning into 'c:/Users/my_user/Projects/my_project/deps/poolboy'...
      remote: Counting objects: 838, done.�[K
      Receiving objects: 100% (838/838), 1.83 MiB, done.
      Resolving deltas: 100% (404/404), done.
      remote: Total 838 (delta 0), reused 0 (delta 0), pack-reused 838�[K

    C:\Users\my_user\Projects\my_project>mix
    ==> poolboy (compile)
    src/poolboy.erl:17: type queue() undefined
    Compiling src/poolboy.erl failed:
    ERROR: compile failed while processing c:/Users/my_user/Projects/my_project/deps/poolboy: rebar_abort
    ** (Mix) Could not compile dependency :poolboy, "c:/Users/my_user/Projects/rebar/rebar.cmd" command failed. You can recompile this dependency with "mix deps.compile poolboy", update it with "mix deps.update poolboy" or clean it with "mix deps.clean poolboy"

    —
    Reply to this email directly or view it on GitHub
    #81 (comment).

    Onorio Catenacci

    http://onor.io
    http://www.google.com/+OnorioCatenacci

  9. OnorioCatenacci commented on Oct 27, 2015

    @OnorioCatenacci

    Ok--just to insure we're all playing from the same playbook: type rebar
    version and post the message. There are a few different versions of rebar
    available and we can help you better if we can insure we're all working
    from the same version of rebar.

    Also I'd try calling rebar directly (as opposed to calling it from within
    mix) like so: rebar compile poolboy

    From a command prompt within the poolboy directory of course.

    All of this is not to say that mix shouldn't work with this but it's easier
    to isolate the problem if we can find something that does work and then
    compare that to the non-working path.

    Just my suggestions of course.

    On Tue, Oct 27, 2015 at 9:46 AM, Edward J. Stembler <
    notifications@github.com> wrote:

    @OnorioCatenacci https://github.com/OnorioCatenacci Well, I followed
    the instructions on the link you provided
    http://theburningmonk.com/2014/08/getting-started-with-rebar-on-windows/
    on the mailing list.

    In any case, typing rebar was the first thing I did after modify my path,
    and starting a new terminal window. It complains about no parameters and
    displays the usage:

    rebar
    No command to run specified!
    Usage: rebar [-h] [-c] [-v ] [-q ] [-V] [-f]
    ...

    Also, on Windows I can do a where:

    where rebar
    C:\Users\my_user\Projects\rebar\rebar
    C:\Users\my_user\Projects\rebar\rebar.cmd

    —
    Reply to this email directly or view it on GitHub
    #81 (comment).

    Onorio Catenacci

    http://onor.io
    http://www.google.com/+OnorioCatenacci

  10. OnorioCatenacci commented on Oct 27, 2015

    @OnorioCatenacci

    Devin can comment more on this but I believe this would be the queue in
    question:

    http://www.erlang.org/doc/man/queue.html

    One thing though--it looks like the code is thinking Erlang is "pre17"? I
    mean this:

    -ifdef(pre17).
    -type pid_queue() :: queue().
    -else.
    -type pid_queue() :: queue:queue().
    -endif.

    I don't think your version of Erlang is pre17 (I'm assuming that's 16 or
    earlier) in any case so that seems suspect to me. I'd wonder why you're
    getting that.

    I'd also suggest that you check your code path in Erlang. See if you've
    got a queue.beam file under your Erlang folder. On my machine I have
    queue.beam at c:\program files\erl7.1\lib\stdlib-2.6\ebin. Erlang/Rebar
    would be trying to find that queue.beam file (as far as I know).

    Onorio

    On Tue, Oct 27, 2015 at 10:08 AM, Edward J. Stembler <
    notifications@github.com> wrote:

    @OnorioCatenacci https://github.com/OnorioCatenacci Sure. Good
    suggestions. Here's the output:

    rebar version
    rebar 2.6.1 18 20151027_131239 git 2.6.1-10-g992dfac

    C:\Users\my_user\Projects\my_project\deps\poolboy>rebar compile poolboy
    ==> poolboy (compile)
    src/poolboy.erl:17: type queue() undefined
    Compiling src/poolboy.erl failed:
    ERROR: compile failed while processing C:/Users/my_user/Projects/my_project/deps/poolboy: rebar_abort

    I'm not privy to the poolboy source, however, where is queue coming from
    in src/poolboy.erl:16
    https://github.com/devinus/poolboy/blob/master/src/poolboy.erl#L16? Is
    it imported from somewhere?

    —
    Reply to this email directly or view it on GitHub
    #81 (comment).

    Onorio Catenacci

    http://onor.io
    http://www.google.com/+OnorioCatenacci

  11. devinus commented on Oct 27, 2015

    @devinus
    Owner

    @ejstembler You don't have pre1 BD0 7 though, you're on a release of 18. I'm not sure how your release of 18 doesn't have the queue type honestly.

  12. OnorioCatenacci commented on Oct 27, 2015

    @OnorioCatenacci

    Maybe it's a codepath issue? I forget how to check the codepath. But it
    seems as if it were a codepath issue he'd be seeing more issues than just
    poolboy.

    On Tue, Oct 27, 2015 at 12:03 PM, Devin Torres notifications@github.com
    wrote:

    @ejstembler https://github.com/ejstembler You don't have pre17 though,
    you're on a release of 18. I'm not sure how your release of 18 doesn't have
    the queue type honestly.

    —
    Reply to this email directly or view it on GitHub
    #81 (comment).

    Onorio Catenacci

    http://onor.io
    http://www.google.com/+OnorioCatenacci

  13. devinus commented on Oct 27, 2015

    @devinus
    Owner

    @ejstembler I'm not sure how you installed Erlang or Elixir, but it seems messed up.

    1. Install Erlang 18.1 64-bit using the installer here: http://www.erlang.org/download.html
    2. Install Elixir 1.1.1 using the installer here: http://elixir-lang.org/install.html
    Devin@desktop MINGW64 ~/Projects/poolboy (master)
    $ ~/.mix/rebar compile
    ==> poolboy (compile)
    Compiled src/poolboy_sup.erl
    Compiled src/poolboy_worker.erl
    Compiled src/poolboy.erl
    
  14. devinus commented on Oct 27, 2015

    @devinus
    Owner

    @ejstembler Try deleting ~/.mix/rebar and doing mix local.rebar.

    After that, try cloning poolboy itself and then using ~/.mix/rebar compile and report back.

  15. OnorioCatenacci commented on Oct 27, 2015

    @OnorioCatenacci

    rebar itself is an escript. So yes, you'd need a bat or cmd file or
    something of that sort to start rebar via escript. Here's mine:

    "%PROGRAMFILES%/erl7.1/bin/escript.exe"
    /ProgramData/Chocolatey/Lib/Rebar3-beta1.3.0/rebar3 %*

    On Tue, Oct 27, 2015 at 2:08 PM, Edward J. Stembler <
    notifications@github.com> wrote:

    @devinus https://github.com/devinus Well, I think we're getting
    closer...

    C:\Users\my_user.mix>rm rebar

    C:\Users\my_user\Projects\my_project>mix local.rebar

    • creating c:/Users/stemblej/.mix/rebar

    C:\Users\my_user\Projects\my_project\deps>git clone https://github.com/devinus/poolboy.git
    Cloning into 'poolboy'...
    remote: Counting objects: 838, done.
    Receiving objects: 100% (838/838), 1.83 MiB, done.ack-reused 838 eceiving objects: 100% (838/838)

    Resolving deltas: 100% (404/404), done.

    C:\Users\my_user\Projects\my_project\deps\poolboy>c:\Users\my_user.mix\rebar compile
    'c:\Users\my_user.mix\rebar' is not recognized as an internal or external command,
    operable program or batch file.

    For Windows, should there be a corresponding rebar.bat file? Similar to
    how there an iex and ies.bat?

    —
    Reply to this email directly or view it on GitHub
    #81 (comment).

    Onorio Catenacci

    http://onor.io
    http://www.google.com/+OnorioCatenacci

  16. devinus commented on Oct 27, 2015

    @devinus
    Owner

    @josevalim Thoughts?

  17. tymoor commented on Sep 14, 2016

    @tymoor

    Was this ever resolved? I'm getting the same error after installing Elixir and Erlang via the elixir-websetup.exe ... it appears that mix is correctly passing rebar to escript:

    C:\Users\my_user\example>mix deps.compile poolboy
    ==> poolboy (compile)
    src/poolboy.erl:17: type queue() undefined
    Compiling src/poolboy.erl failed:
    ERROR: compile failed while processing c:/Users/my_user/example/deps/poolboy: rebar_abort
    ** (Mix) Could not compile dependency :poolboy, "escript.exe "c:/Users/my_user/.mix/rebar" compile skip_deps=true deps_dir="c:/Users/my_user/example/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile poolboy", update it with "mix deps.update poolboy" or clean it with "mix deps.clean poolboy"
    
    C:\Users\my_user\example>escript.exe "c:\Users\my_user\.mix\rebar" compile skip_deps=true deps_dir="c:\Users\my_user\example\_build\test\lib"
    ==> example (compile)
    
    C:\Users\my_user\example>
    

    It still fails to run (attempts to compile poolboy again) after running the command manually as above.

    C:\Users\my_user\example>escript.exe "c:\Users\my_user\.mix\rebar" compile skip_deps=true deps_dir="c:\Users\my_user\example\_build\test\lib"
    ==> example (compile)
    
    C:\Users\my_user\example>mix test
    ==> poolboy (compile)
    src/poolboy.erl:17: type queue() undefined
    Compiling src/poolboy.erl failed:
    ERROR: compile failed while processing c:/Users/my_user/example/deps/poolboy: rebar_abort
    ** (Mix) Could not compile dependency :poolboy, "escript.exe "c:/Users/my_user/.mix/rebar" compile skip_deps=true deps_dir="c:/Users/my_user/example/_build/test/lib"" command failed. You can recompile this dependency with "mix deps.compile poolboy", update it with "mix deps.update poolboy" or clean it with "mix deps.clean poolboy"
    
    C:\Users\my_user\example>
    
  18. josevalim commented on Sep 14, 2016

    @josevalim
    Contributor

    What is your Windows, Elixir and Erlang versions? I am confident Poolboy
    works on Windows, so we need to identify what is missing in your setup.

    On Wednesday, September 14, 2016, tymoor notifications@github.com wrote:

    Was this ever resolved? I'm getting the same error after installing Elixir
    and Erlang via the elixir-websetup.exe ... it appears that mix is correctly
    passing rebar to escript:

    `C:\Users\my_user\example>mix deps.compile poolboy
    ==> poolboy (compile)
    src/poolboy.erl:17: type queue() undefined
    Compiling src/poolboy.erl failed:
    ERROR: compile failed while processing c:/Users/my_user/example/deps/poolboy:
    rebar_abort
    ** (Mix) Could not compile dependency :poolboy, "escript.exe
    "c:/Users/my_user/.mix/rebar" compile skip_deps=true
    deps_dir="c:/Users/my_user/example/_build/dev/lib"" command failed. You
    can recompile this dependency with "mix deps.compile poolboy", update it
    with "mix deps.update poolboy" or clean it with "mix deps.clean poolboy"

    C:\Users\my_user\example>escript.exe "c:\Users\my_user.mix\rebar" compile
    skip_deps=true deps_dir="c:\Users\my_user\example_build\test\lib"
    ==> example (compile)

    C:\Users\my_user\example>`

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #81 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/AAAlbpbia1-uFQVkdPKhZYQiOdeLymoxks5qp4Z3gaJpZM4GTUrA
    .

    José Valimwww.plataformatec.com.br
    http://www.plataformatec.com.br/Founder and Director of R&D

  19. josevalim commented on Sep 14, 2016

    @josevalim
    Contributor

    Due to the error, it seems your issue is either an old Poolboy version (try
    updating it) or an old Erlang version. It seems tone the former.

    José Valimwww.plataformatec.com.br
    http://www.plataformatec.com.br/Founder and Director of R&D

  20. tymoor commented on Sep 14, 2016

    @tymoor

    Yeah, that was it - when I got to the hex page ( [(https://hex.pm/] ) I just copied the ecto tuple it suggests:

    Using with Elixir

    Simply specify your Mix dependencies as two-item tuples like {:ecto, "~> 0.1.0"} and Elixir will ask if you want to install Hex if you haven't already. After installed, you can run $ mix local to see all available Hex tasks and $ mix help TASK for more information about a specific task.

    into my sample program... that tuple is old, and has a dependency on an old version of poolboy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0