A couple of days ago I updated my HTTPoison dep to 0.11.0, and I’m now struggling to get my lib to compile on my other machine. I have done a fresh clone from GitHub to ensure I was starting from scratch and I’m having no luck.
This is the output I am receiving.
$ mix compile
===> Package certifi-0.7.0 not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :hackney, "escript.exe "m:/.mix/rebar3" bare compile
--paths "<project_path>/cashier/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency
with "mix deps.compile hackney", update it with "mix deps.update hackney" or clean it with "mix deps.clean hackney"
In essence, make sure Elixir is upgraded to 1.4.1 or higher, if you have a defined applications list in your mix.exs file then make sure that :hackney is in it, and of course delete your _build directory.
And although you did not say, I’m guessing you have a mac as that seems to be a common theme amongst this issue? ^.^
Also this is my output with DEBUG=1 (I should have pasted that originally!), which looks the same as others I have seen reported that your suggestions fixed.
$ mix compile
===> Expanded command sequence to be run: []
===> Expanded command sequence to be run: [{default,app_discovery},
{bare,compile}]
===> Error loading package registry: {read_error,
{file_error,
"m:/.cache/rebar3/hex/default/registry",
enoent}}
===> Package certifi-0.7.0 not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Fetching registry from "https://repo.hex.pm:443/registry.ets.gz?"
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,
{error,{rebar_prv_update,package_index_download}}}
===> Stack trace to the error location:
[{rebar_packages,handle_missing_package,3,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_packages.erl"},
{line,85}]},
{rebar_app_utils,update_source,3,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_utils.erl"},
{line,198}]},
{rebar_app_utils,dep_to_app,7,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_utils.erl"},
{line,169}]},
{rebar_app_utils,'-parse_deps/6-lc$^0/1-0-',6,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_utils.erl"},
{line,98}]},
{rebar_app_discover,'-do/2-fun-0-',3,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_discover.erl"},
{line,31}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1262}]},
{rebar_app_discover,do,2,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_app_discover.erl"},
{line,27}]},
{rebar_prv_app_discovery,do,1,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_app_discovery.erl"},
{line,38}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :hackney, "escript.exe "m:/.mix/rebar3" bare compile
--paths "<project path>/cashier/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with
"mix deps.compile hackney", update it with "mix deps.update hackney" or clean it with "mix deps.clean hackney"
And you’ve already done mix local.rebar to make sure your local rebar install is updated too?
I’m unsure what else off-hand then, I use httpoison at work but I’ve not yet updated it, let me clone your https://github.com/swelham/cashier.git repo and see what happens (using Windows 10), mix deps.get works, now doing mix compile and successful. For comparison, my two rebar versions are:
Just to make things really confusing, my laptop at home is also running version 18 and works just fine. I think I might just go for a reinstall of Elixir/Erlang on the other machine and if that resolves it.
I have update erlang and uninstalled the older version, I have deleted both ~/.mix and ~/.hex, reinstalled elixir and subsequently hex and rebar, deleted and then cloned repo and this project still will not compile on this machine
Short of throwing it out of the window, I am completely lost on how to sort this.
Yes and I am using the http_proxy/https_proxy variables. I assume the proxy isn’t an issue as this was working just a few days ago, plus I assume mix.deps wouldn’t work if the proxy settings were wrong.
Under “For those behind proxy servers” section, there is a detail explanation for issue with rebar3 behind proxy.
I follow the steps to sort out the user profile location and setup the rebar.config and get pass the issue with compile hackney.