Skip to content

Provider hook for pre not working in rebar when started from Mix #7733

@edescourtis

Description

@edescourtis

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
    Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:10] [hipe] [kernel-poll:false]
    Elixir 1.6.4 (compiled with OTP 19)

  • Operating system:
    LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.4 LTS
    Release: 16.04
    Codename: xenial

Current behaviour

Fails to compile rebar3 dependency. I made a minimal example here .

eric@eric-desktop:~/dev/rebar3_mix_provider_hook_bug_minimal$ mix compile
warning: path "apps/erlang_app_example" is a directory but it has no mix.exs. Mix won't consider this directory as part of your umbrella application. Please add a "mix.exs" or set the ":apps" key in your umbrella configuration with all relevant apps names as atoms
===> Package rebar_erl_vsn-0.2.0 not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Writing registry to /home/eric/.cache/rebar3/hex/default/registry
...
===> Fetching rebar_erl_vsn ({pkg,<<"rebar_erl_vsn">>,<<"0.2.0">>})
===> Downloaded package, caching at /home/eric/.cache/rebar3/hex/default/packages/rebar_erl_vsn-0.2.0.tar
===> Compiling rebar_erl_vsn
===> Compiling erlang_app_example
===> Unable to run pre hooks for 'compile', command 'erl_vsn' not found.
** (Mix) Could not compile dependency :erlang_app_example, "/home/eric/.asdf/installs/elixir/1.6.4/.mix/rebar3 bare compile --paths "/home/eric/dev/rebar3_mix_provider_hook_bug_minimal/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile erlang_app_example", update it with "mix deps.update erlang_app_example" or clean it with "mix deps.clean erlang_app_example"

Compiling the dependency directly seems to work just fine:

eric@eric-desktop:~/dev/rebar3_mix_provider_hook_bug_minimal/apps/erlang_app_example$ rebar3 compile
===> Verifying dependencies...
===> Compiling erlang_app_example

I looked at the rebar_erl_vsn provider hook but I don't see anything wrong or abnormal. Also it seems to work fine in a pure rebar3 project.

Expected behaviour

Compiles correctly.

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