barrel-db / rebar3_elixir_compile Goto Github PK
View Code? Open in Web Editor NEWElixir rebar3 compiler plugin
License: Other
Elixir rebar3 compiler plugin
License: Other
It needs elixir
and hex
installed.
Hi. Any chance to publish an updated version of this plugin to hex.pm? ๐
The readme is not up to date for now and is based on the initial commit.
This plug in appears to pull all the dependencies of a hex project. however unless the are all added to the list of deps
then they are not compiled/included.
I have a small rebar3 project using Ace, an elixir dependency which has further dependencies.
This is the section of my rebar.config
file which should only need to have ace declared https://github.com/CrowdHailer/greetings-ace-raxx-erlang-example/blob/master/rebar.config#L3-L6
Could you please tag commit ref c2a8c9f?
Thank you.
Right now it seems that the elixir applications are discovered from a static folder:
https://github.com/barrel-db/rebar3_elixir/blob/master/src/rebar3_elixir_util.erl#L29
Instead we should use applications listed in deps and check if mix.exs
is present and then compile it using mix until rebar.config
is not present. Thoughts?
Does the current implementation supports release? what happen when we run rebar3 release
? An example should be provided.
the Name
in {elixir, Name, Vsn}
should be a string. Right now an atom is expected.
I have been playing with the example "demo" code from the repo. I wanted to add a sname to the demo Erlang VM. So, created a file called, config/vm.args
in the demo directory which looks like:
-sname demo
And issued the following commands from the demo directory:
docker run --rm -v ${HOME}:${HOME} -w `pwd` -it elixir bash # Elixir (1.6) docker environment
And in docker from demo directory:
mix local.rebar --force
mix local.hex --force
rebar3 compile
ERL_FLAGS=" -args_file config/vm.args" rebar3 shell
I see the following error:
root@b40fb051a6c7:demo# ERL_FLAGS=" -args_file config/vm.args" rebar3 shell
===> Failed creating providers. Run with DEBUG=1 for stacktrace or consult rebar3.crashdump.
On turning DEBUG=1, I see the following message:
===> sh info:
cwd: "/Users/vdasari/Developer/demo"
cmd: elixir -e "IO.puts :code.lib_dir(:elixir)"
===> opts: []
===> Port Cmd: elixir -e "IO.puts :code.lib_dir(:elixir)"
Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof]
===> sh(elixir -e "IO.puts :code.lib_dir(:elixir)")
failed with return code 1 and the following output:
Protocol 'inet_tcp': the name demo@b40fb051a6c7 seems to be in use by another Erlang node
===> throw: rebar_abort [{rebar_utils,debug_and_abort,2,
[{file,
"/usr/src/rebar3-src/_build/default/lib/rebar/src/rebar_utils.erl"},
{line,605}]},
{rebar_utils,sh,2,
[{file,
"/usr/src/rebar3-src/_build/default/lib/rebar/src/rebar_utils.erl"},
{line,197}]},
{rebar3_elixir_compile_util,get_details,1,
[{file,
"/Users/vdasari/Developer/demo/_build/default/plugins/rebar3_elixir_compile/src/rebar3_elixir_compile_util.erl"},
{line,66}]},
{rebar3_elixir_compile,init,1,
[{file,
"/Users/vdasari/Developer/demo/_build/default/plugins/rebar3_elixir_compile/src/rebar3_elixir_compile.erl"},
{line,8}]},
{rebar_state,
'-create_logic_providers/2-fun-0-',2,
[{file,
"/usr/src/rebar3-src/_build/default/lib/rebar/src/rebar_state.erl"},
{line,409}]},
{lists,foldl,3,
[{file,"lists.erl"},{line,1263}]},
{rebar_state,create_logic_providers,2,
[{file,
"/usr/src/rebar3-src/_build/default/lib/rebar/src/rebar_state.erl"},
{line,408}]},
{rebar_plugins,'-handle_plugins/4-fun-0-',4,
[{file,
"/usr/src/rebar3-src/_build/default/lib/rebar/src/rebar_plugins.erl"},
{line,84}]}]
===> Failed creating providers. Run with DEBUG=1 for stacktrace or consult rebar3.crashdump.
I generally use this command ERL_FLAGS=" -args_file config/vm.args" rebar3 shell
to run rebar3 shell for normal Erlang-Rebar projects. I expected to see this working for Elixir imported projects as well. May I know what do I need to do to make this command work.
Trying to depend on extreme
lib with this plugin, it seems like it's not fetching any of the dependencies.
Is this expected behaviour?
E.g. I have to put all of them into my rebar3 config:
{idna, {elixir, "idna", "4.0"}},
{hackney, {elixir, "hackney", "1.6"}},
{httpoison, {elixir, "httpoison", "0.10.0"}},
{gpb, {elixir, "gpb", "3.24"}},
{exprotobuf, {elixir, "exprotobuf", "1.2.1"}}
(not working yet - but I will keep debugging)
Right now rebar3_elixir_util.erl:get_details/1
is opening rebar.config.
Instead we should use the rebar API to get the elixir options so can also have the global options set too.
When I add { rebar3_elixir_compile, ".*", {git, "https://github.com/barrel-db/rebar3_elixir_compile.git", {branch, "master"}}}
, { rebar3_elixir_compile, {git, "https://github.com/barrel-db/rebar3_elixir_compile.git", {branch, "master"}}}
or just rebar3_elixir_compile
to the plugins
of ~/.config/rebar3/rebar.config
.
It always reports .config/rebar3/rebar.config exists but can not be read. Ignoring global config values.
However, If I change to other plugin like rebar3_hex
, rebar_erl_vsn
, all works.
Env
rebar 3.6.1 on Erlang/OTP 21 Erts 10.0
๐
Me again. So, say - is there a way to make this work with an escript/rebar3 escriptize (Dislaimer: I might also be using escript wrong).
I used rebar3 to create an escript project: https://github.com/PragTob/benchee_erlang_try
Now generating the script failed:
tobi@speedy ~/github/benchee_erlang $ ./_build/default/bin/benchee_erlang
escript: exception error: undefined function 'Elixir.Benchee':run/1
in function benchee_erlang:main/1 (/home/tobi/github/benchee_erlang/_build/default/lib/benchee_erlang/src/benchee_erlang.erl, line 16)
in call from escript:run/2 (escript.erl, line 757)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1
in call from init:do_boot/3
Of course, though! Haven't added benchee to the applications. But when I add benchee to the applications this happens:
tobi@speedy ~/github/benchee_erlang $ DEBUG=1 rebar3 escriptize
# lots of stuff that I'll spare you...
===> Building escript...
===> Creating escript file /home/tobi/github/benchee_erlang/_build/default/bin/benchee_erlang
===> processing <<"benchee_erlang">>
===> new deps of <<"benchee_erlang">> found to be [<<"benchee">>]
===> processing <<"benchee">>
===> new deps of <<"benchee">> found to be [<<"elixir">>,<<"logger">>,
<<"deep_merge">>]
===> processing <<"elixir">>
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,error}
===> Stack trace to the error location:
[{rebar_prv_escriptize,find_deps_of_deps,3,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_escriptize.erl"},
{line,246}]},
{rebar_prv_escriptize,find_deps,2,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_escriptize.erl"},
{line,240}]},
{rebar_prv_escriptize,escriptize,2,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_escriptize.erl"},
{line,104}]},
{rebar_prv_escriptize,do,1,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_escriptize.erl"},
{line,80}]},
{rebar_core,do,2,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
{line,153}]},
{rebar3,main,1,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar3.erl"},
{line,66}]},
{escript,run,2,[{file,"escript.erl"},{line,757}]},
{escript,start,1,[{file,"escript.erl"},{line,277}]}]
Seems it doesn't like the transitive elixir dependency there?
Thanks a lot!
This is not a duplicate of #15, in my case I did not define elixir_opts
and got the same exception.
โ DEBUG=1 rebar3 compile
===> Load global config file /Users/slacker/.config/rebar3/rebar.config
===> Not adding provider default auto from module rebar3_auto because it already exists from module rebar3_auto
===> error: {badmatch,error} [{rebar_state,get,2,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_state.erl"},
{line,150}]},
{rebar3_elixir_compile_util,get_details,
1,
[{file,
"/Users/slacker/Programming/irresponsible/sellery/_build/default/plugins/rebar3_elixir_compile/src/rebar3_elixir_compile_util.erl"},
{line,56}]},
{rebar3_elixir_compile,init,1,
[{file,
"/Users/slacker/Programming/irresponsible/sellery/_build/default/plugins/rebar3_elixir_compile/src/rebar3_elixir_compile.erl"},
{line,8}]},
{rebar_state,
'-create_logic_providers/2-fun-0-',2,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_state.erl"},
{line,409}]},
{lists,foldl,3,
[{file,"lists.erl"},{line,1263}]},
{rebar_state,create_logic_providers,2,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_state.erl"},
{line,408}]},
{rebar_plugins,
'-handle_plugins/4-fun-0-',4,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_plugins.erl"},
{line,84}]},
{lists,foldl,3,
[{file,"lists.erl"},{line,1263}]}]
===> Failed creating providers. Run with DEBUG=1 for stacktrace or consult rebar3.crashdump.
โ
I'll be submitting a PR to fix this.
I was unable to compile a simple test:
rebar3 new app testapp
rebar.config
in the testapp folder:{erl_opts, [debug_info]}.
{plugins, [{rebar3_elixir, {git, "[email protected]:barrel-db/rebar3_elixir.git", {branch, "master"}}}]}.
{deps, [{httpoison, {elixir, httpoison, "0.9.0"}}]}.
rebar3 compile
You get the following trace when runn
===> Fetching httpoison ({elixir,httpoison,"0.9.0"})
===> Adding Dir "/tmp/.tmp_dir710327170900"
Dependency httpoison already exists
===> rebar_fetch exception error {badmatch,false} [{rebar3_elixir_util,
get_details,1,
[{file,
"/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_util.erl"},
{line,14}]},
{rebar3_elixir_util,
add_elixir,1,
[{file,
"/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_util.erl"},
{line,6}]},
{rebar3_elixir_resource,
fetch_and_compile,
3,
[{file,
"/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_resource.erl"},
{line,34}]},
{rebar3_elixir_resource,
download,3,
[{file,
"/private/tmp/testapp/_build/default/plugins/rebar3_elixir/src/rebar3_elixir_resource.erl"},
{line,16}]},
{rebar_fetch,
download_source_,3,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_fetch.erl"},
{line,45}]},
{rebar_fetch,
download_source,3,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_fetch.erl"},
{line,29}]},
{rebar_prv_install_deps,
fetch_app,3,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_install_deps.erl"},
{line,357}]},
{rebar_prv_install_deps,
maybe_fetch,5,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_install_deps.erl"},
{line,295}]}]
===> Failed to fetch and copy dep: {elixir,httpoison,"0.9.0"}
๐
Thanks for doing this!
I used it in an example project to add my benchee library. It has only one dependency, however when I install it with this it also installs and fetches all my precious dev dependencies:
tobi@speedy ~/github/benchee_erlang $ rebar3 compile
===> Verifying dependencies...
===> Upgrading benchee ({elixir,"benchee","0.8.0"})
Dependency benchee already exists
Running dependency resolution...
All dependencies up to date
===> App bunt is no longer needed and can be deleted.
===> App credo is no longer needed and can be deleted.
===> App deep_merge is no longer needed and can be deleted.
===> App dialyxir is no longer needed and can be deleted.
===> App earmark is no longer needed and can be deleted.
===> App ex_doc is no longer needed and can be deleted.
===> App fs is no longer needed and can be deleted.
===> App mix_test_watch is no longer needed and can be deleted.
===> Compiling benchee_erlang
===> Adding Elixir Libs
I thought setting the elixir_opts env
to something else might solve it but then the compilation fails altogether.
I'd be happy about any help - thanks! ๐
I am making some changes to an Elixir project to try and make it easier to use in erlang.
I have manage to pull the project from hex but is there any way to declare the source as from gihub.
I can't see how to combine these two lines
{AppName, {git, "https://github.com/user/repo", {branch|tag|ref, "string"}}}
and
{raxx, {elixir, "raxx", "0.15.2"}}
Hi, guys.
Trying to run this on Windows 10, from erlang rebar3 project, with an elixir dependency extreme.
Here is my rebar3.config
:
{erl_opts, [debug_info]}.
{plugins, [
{ rebar3_elixir_compile, ".*", {git, "https://github.com/barrel-db/rebar3_elixir_compile.git", {branch, "master"}}}
]}.
{deps, [
{extreme, {elixir, "extreme", "0.7.0"}}
]}.
{relx, [{release, { beepub, "0.1.0" },
[beepub,
sasl]},
{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}]
}.
{profiles, [{prod, [{relx, [{dev_mode, false},
{include_erts, true}]}]
}]
}.
{provider_hooks, [
{pre, [{compile, {ex, compile}}]}
]}.
{elixir_opts,
[
{env, dev}
]
}.
Here is my attempt at compiling it, with debug turned on:
$ DEBUG=1 rebar3 compile
๏ฟฝ[0;36m===> Load global config file c:/Users/Andriy/.config/rebar3/rebar.config
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex config from module rebar3_hex_config because it already exists from module rebar3_hex_config
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex info from module rebar3_hex_info because it already exists from module rebar3_hex_info
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex docs from module rebar3_hex_docs because it already exists from module rebar3_hex_docs
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
๏ฟฝ[0m๏ฟฝ[0;36m===> Not adding provider hex publish from module rebar3_hex_pkg because it already exists from module rebar3_hex_pkg
๏ฟฝ[0m๏ฟฝ[0;36m===> sh info:
cwd: "d:/Projects/bee-publisher/beepub"
cmd: elixir -e 'IO.puts :code.lib_dir(:elixir)'
๏ฟฝ[0m๏ฟฝ[0;36m===> opts: []
๏ฟฝ[0m๏ฟฝ[0;36m===> Port Cmd: cmd /q /c elixir -e 'IO.puts :code.lib_dir(:elixir)'
Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof]
๏ฟฝ[0m๏ฟฝ[0;36m===> sh(cmd /q /c elixir -e 'IO.puts :code.lib_dir(:elixir)')
failed with return code 255 and the following output:
' was unexpected at this time.
๏ฟฝ[0m๏ฟฝ[0;36m===> throw: rebar_abort [{rebar_utils,debug_and_abort,2,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_utils.erl"},
{line,585}]},
{rebar_utils,sh,2,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_utils.erl"},
{line,182}]},
{rebar3_elixir_compile_util,get_details,1,
[{file,
"d:/Projects/bee-publisher/beepub/_build/default/plugins/rebar3_elixir_compile/src/rebar3_elixir_compile_util.erl"},
{line,66}]},
{rebar3_elixir_compile,init,1,
[{file,
"d:/Projects/bee-publisher/beepub/_build/default/plugins/rebar3_elixir_compile/src/rebar3_elixir_compile.erl"},
{line,8}]},
{rebar_state,
'-create_logic_providers/2-fun-0-',2,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_state.erl"},
{line,409}]},
{lists,foldl,3,
[{file,"lists.erl"},{line,1263}]},
{rebar_state,create_logic_providers,2,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_state.erl"},
{line,408}]},
{rebar_plugins,'-handle_plugins/4-fun-0-',4,
[{file,
"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_plugins.erl"},
{line,84}]}]
๏ฟฝ[0m๏ฟฝ[0;31m===> ๏ฟฝ[1mFailed creating providers. Run with DEBUG=1 for stacktrace or consult rebar3.crashdump.
๏ฟฝ[0m๏ฟฝ[0m
Hi,
We have problems trying to run rebar3 ct
in our project after using your plugin.
I have been testing with the demo and I could reproduce the error there. This is the error I get if I run rebar3 ct
in the demo's folder (from rebar3.crashdump):
Error: function_clause
[{filename,do_flatten,[47,[]],[{file,"filename.erl"},{line,974}]},
{filename,basename,2,[{file,"filename.erl"},{line,234}]},
{rebar_utils,'-update_code/2-fun-0-',2,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_utils.erl"},
{line,724}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
{rebar_prv_common_test,do,2,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_common_test.erl"},
{line,51}]},
{rebar_core,do,2,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
{line,153}]},
{rebar3,main,1,
[{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar3.erl"},
{line,66}]},
{escript,run,2,[{file,"escript.erl"},{line,760}]}]
Digging deeper in our project I saw the problem is with the all_deps
property in the rebar3 state, this is how it looks:
[all_deps,47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,
111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,
107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,
101,102,97,117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
105,98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,
101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,
108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,
95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,117,103,
105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,
110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,
107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,
115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,101,102,97,
117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,
100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,101,114,115,
47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,
101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,
110,47,95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,
117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,
47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,
110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,
47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,
98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,101,
114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,
97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,
117,105,108,100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,
46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,110,47,85,115,101,
114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,
101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,
100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,
103,105,110,115,47,46,46,47,108,105,98,47,100,105,97,108,121,120,105,
114,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
105,98,47,101,97,114,109,97,114,107,47,101,98,105,110,47,85,115,101,114,
115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,
47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,
111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,103,
105,110,115,47,46,46,47,108,105,98,47,98,117,110,116,47,101,98,105,110,
47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,
115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,
104,101,108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,
112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,
111,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
105,98,47,100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,
101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,
97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,
108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,
117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
47,101,98,105,110,
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/goldrush/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/aleppo/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/zipper/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/lager/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/katana_code/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/getopt/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/xref_runner/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/elvis/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/lib/earmark/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/mixer/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/katana_test/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/sheldon/ebin",
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/lib/sheldon/test"]],
where all those integers would make sense if they were in a list.
1> [47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,
1> 111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,
1> 107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,
1> 101,102,97,117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
1> 105,98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,
1> 101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,
1> 108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,
1> 95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,117,103,
1> 105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,
1> 110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,
1> 107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,
1> 115,104,101,108,100,111,110,47,95,98,117,105,108,100,47,100,101,102,97,
1> 117,108,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,
1> 100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,101,114,115,
1> 47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,
1> 101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,
1> 110,47,95,98,117,105,108,100,47,100,101,102,97,117,108,116,47,112,108,
1> 117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
1> 47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,115,
1> 47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,105,
1> 110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,100,
1> 47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,105,
1> 98,47,98,117,110,116,47,101,98,105,110,47,85,115,101,114,115,47,102,101,
1> 114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,
1> 97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,
1> 117,105,108,100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,
1> 46,47,108,105,98,47,99,114,101,100,111,47,101,98,105,110,47,85,115,101,
1> 114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,
1> 101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,
1> 100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,
1> 103,105,110,115,47,46,46,47,108,105,98,47,100,105,97,108,121,120,105,
1> 114,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
1> 115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
1> 105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
1> 100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
1> 105,98,47,101,97,114,109,97,114,107,47,101,98,105,110,47,85,115,101,114,
1> 115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,97,99,101,
1> 47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,108,100,
1> 111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,117,103,
1> 105,110,115,47,46,46,47,108,105,98,47,98,117,110,116,47,101,98,105,110,
1> 47,85,115,101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,
1> 115,112,97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,
1> 104,101,108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,
1> 112,108,117,103,105,110,115,47,46,46,47,108,105,98,47,99,114,101,100,
1> 111,47,101,98,105,110,47,85,115,101,114,115,47,102,101,114,105,103,105,
1> 115,47,119,111,114,107,115,112,97,99,101,47,101,114,108,97,110,103,47,
1> 105,110,97,107,97,47,115,104,101,108,100,111,110,47,95,98,117,105,108,
1> 100,47,116,101,115,116,47,112,108,117,103,105,110,115,47,46,46,47,108,
1> 105,98,47,100,105,97,108,121,120,105,114,47,101,98,105,110,47,85,115,
1> 101,114,115,47,102,101,114,105,103,105,115,47,119,111,114,107,115,112,
1> 97,99,101,47,101,114,108,97,110,103,47,105,110,97,107,97,47,115,104,101,
1> 108,100,111,110,47,95,98,117,105,108,100,47,116,101,115,116,47,112,108,
1> 117,103,105,110,115,47,46,46,47,108,105,98,47,101,97,114,109,97,114,107,
1> 47,101,98,105,110].
"/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/bunt/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/credo/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/dialyxir/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/default/plugins/../lib/earmark/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/bunt/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/credo/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/dialyxir/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/earmark/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/bunt/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/credo/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/dialyxir/ebin/Users/ferigis/workspace/erlang/inaka/sheldon/_build/test/plugins/../lib/earmark/ebin"
we need some examples and a Getting Started
doc
I was trying a modified version of the demo:
diff --git a/examples/demo/rebar.config b/examples/demo/rebar.config
index 7be3b6b..157f6f3 100644
--- a/examples/demo/rebar.config
+++ b/examples/demo/rebar.config
@@ -5,12 +5,13 @@
]}.
{deps, [
- {decimal, {elixir, "decimal" ,"1.1.0"}}
+ {decimal, {elixir, "decimal" ,"1.1.0"}},
+ {httpoison, {elixir, "httpoison", "0.9.0"}}
]}.
{provider_hooks, [{post, [{compile, {ex, compile}}]}]}.
-{elixir_opts,
+{elixir_opts,
[
{env, dev}
]
-}.
\ No newline at end of file
+}.
diff --git a/examples/demo/rebar.lock b/examples/demo/rebar.lock
index c6f33b5..5f31bfb 100644
--- a/examples/demo/rebar.lock
+++ b/examples/demo/rebar.lock
@@ -1 +1,2 @@
-[{<<"decimal">>,{elixir,"decimal","1.1.0"},0}].
+[{<<"decimal">>,{elixir,"decimal","1.1.0"},0},
+ {<<"httpoison">>,{elixir,"httpoison","0.9.0"},0}].
diff --git a/examples/demo/src/demo.app.src b/examples/demo/src/demo.app.src
index 83d4eb4..c024c4e 100644
--- a/examples/demo/src/demo.app.src
+++ b/examples/demo/src/demo.app.src
@@ -7,7 +7,9 @@
[kernel,
stdlib,
crypto,
- elixir
+ elixir,
+ decimal,
+ httpoison
]},
{env,[]},
but the lock file is not updated when doing rebar3 compile, only httpoison is added to it but none of the deps are fetched via mix. More over running the application return the following:
[demo] rebar3 shell 20:58:43 โ master โ โก
===> Compiling rebar3_elixir
===> Verifying dependencies...
===> Upgrading decimal ({elixir,"decimal","1.1.0"})
Dependency decimal already exists
A new Hex version is available (0.13.0), please update with `mix local.hex`
ex_doc is missing its version requirement, use ">= 0.0.0" if it should match any version
earmark is missing its version requirement, use ">= 0.0.0" if it should match any version
Running dependency resolution
All dependencies up to date
A new Hex version is available (0.13.0), please update with `mix local.hex`
Running dependency resolution
All dependencies up to date
===> Upgrading httpoison ({elixir,"httpoison","0.9.0"})
Dependency httpoison already exists
A new Hex version is available (0.13.0), please update with `mix local.hex`
ex_doc is missing its version requirement, use ">= 0.0.0" if it should match any version
earmark is missing its version requirement, use ">= 0.0.0" if it should match any version
Running dependency resolution
All dependencies up to date
A new Hex version is available (0.13.0), please update with `mix local.hex`
Running dependency resolution
All dependencies up to date
===> Compiling demo
===> Adding Elixir Libs
Erlang/OTP 18 [erts-7.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:0] [kernel-poll:false]
Eshell V7.2.1 (abort with ^G)
1> demo_app:decimal_demo_run().
Result is : #{'__struct__' => 'Elixir.Decimal',coef => 11,exp => 0,sign => 1}ok
2> 'Elixir.String':downcase(<<"TEST">>).
<<"test">>
3> application:ensure_all_started(httpoison).
{error,{hackney,{"no such file or directory",
"hackney.app"}}}
4>
=INFO REPORT==== 14-Aug-2016::21:01:13 ===
application: elixir
exited: stopped
type: temporary
=INFO REPORT==== 14-Aug-2016::21:01:13 ===
application: compiler
exited: stopped
type: temporary
4>
So it seems that it doesn't find hackney.
Is it possible to specify git dependency, instead of hex?
Sorry for the wall of text, I'm still new enough at erlang to not know how best to reduce the noise in this issue and make something more concise.
I am using an elixir docker image so I'm pretty sure erlang & elixir are set up correctly.
I've set up mix for the user I'm using and I can put {aws, {elixir, "aws" ,"0.5.0"}}
in my rebar.config
file as a dep
and it fails with {"no such file or directory", "httpoison.app"}
. (This seems like it could be related to #30)
I add a keep adding the libraries it complains about as elixir dependencies and I end up getting a build that works..once.
rebar shell
will run correctly if I first delete rebar.config
, if I don't it fails with Failed to fetch and copy dep: {elixir,"gettext","0.10"}
(which is one of the dependencies I has previous added to the deps section in order to get it to build).
My rebar.config
file can be found below. Any advice is tracking this down would be hugely appreciated.
{erl_opts, [debug_info,
{parse_transform, lager_transform}]}.
{elixir_opts, [{env, dev}]}.
{plugins, [rebar3_run,
{rebar3_elixir_compile, ".*", {git, "https://github.com/barrel-db/rebar3_elixir_compile.git", {branch, "master"}}}]}.
{deps, [% erlang deps
{cowboy, "2.4.0"}
,{hackney, "1.12.1"}
,{jiffy, "0.15.2"}
,{lager, "3.6.2"}
,{pgsql, "26.0.2"}
,{uuid, "1.7.3", {pkg, uuid_erl}}
,{bcrypt, "1.0.2"}
,{episcina, {git, "git://github.com/erlware/episcina.git", "596889c75f52f443bd6f29ce84aded6806c6fa89"}}
% elixir deps
,{aws, {elixir, "aws" ,"0.5.0"}}
% needed to fix missing file issues
,{dialyxir, {elixir, "dialyxir", "0.5.0"}}
,{poison, {elixir, "poison", "3.1"}}
,{timex, {elixir, "timex", "3.1"}}
,{tzdata, {elixir, "tzdata", "0.1.8"}}
,{gettext, {elixir, "gettext", "0.10"}}
,{ex_doc, {elixir, "ex_doc", "0.15.0"}}
,{httpoison, {elixir, "httpoison", "0.11.1"}}
,{combine, {elixir, "combine", "0.10.0"}}
]}.
{relx, [{release, { cowboy_hello_world, "0.1.0" },
[cowboy_hello_world, sasl]},
{sys_config, "./config/sys.dev.config"},
{vm_args, "./config/vm.args"},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}]}.
{dist_node, [
{setcookie, cookie},
{name, '[email protected]'}
]}.
{profiles,
[{prod,
[{relx, [{dev_mode, false},
{sys_config, "./config/sys.prod.config"},
{include_erts, true}]}]}]}.
I know it's probably pointless due to heavy macro usage, however:
{deps, [
{ecto, {elixir, "ecto" ,"2.0.0"}},
{postgrex, {elixir, "postgrex" ,"0.11.2"}}
]}.
$ rebar3 compile
===> Fetching rebar3_elixir ({git,
"https://github.com/barrel-db/rebar3_elixir.git",
{branch,"master"}})
===> Fetching rebar3_hex ({pkg,<<"rebar3_hex">>,<<"2.5.1">>})
===> Downloaded package, caching at /Users/hq1/.cache/rebar3/hex/default/packages/rebar3_hex-2.5.1.tar
===> Compiling rebar3_hex
===> Compiling rebar3_elixir
===> Verifying dependencies...
===> Fetching ecto ({elixir,"ecto","2.0.0"})
Running dependency resolution
Dependency resolution completed
connection: 1.0.4
db_connection: 1.0.0-rc.4
decimal: 1.1.2
earmark: 1.0.1
ex_doc: 0.13.0
inch_ex: 0.5.3
mariaex: 0.7.7
poison: 2.2.0
poolboy: 1.5.1
postgrex: 0.11.2
sbroker: 1.0.0-beta.3
* Getting poolboy (Hex package)
Checking package (https://repo.hex.pm/tarballs/poolboy-1.5.1.tar)
Using locally cached package
* Getting decimal (Hex package)
Checking package (https://repo.hex.pm/tarballs/decimal-1.1.2.tar)
Request failed (:timeout)
Fetch failed. Using locally cached package
* Getting db_connection (Hex package)
Checking package (https://repo.hex.pm/tarballs/db_connection-1.0.0-rc.4.tar)
Request failed (:timeout)
Fetch failed. Using locally cached package
* Getting postgrex (Hex package)
Checking package (https://repo.hex.pm/tarballs/postgrex-0.11.2.tar)
Using locally cached package
* Getting mariaex (Hex package)
Checking package (https://repo.hex.pm/tarballs/mariaex-0.7.7.tar)
Request failed (:timeout)
Fetch failed. Using locally cached package
* Getting sbroker (Hex package)
Checking package (https://repo.hex.pm/tarballs/sbroker-1.0.0-beta.3.tar)
Using locally cached package
* Getting poison (Hex package)
Checking package (https://repo.hex.pm/tarballs/poison-2.2.0.tar)
Using locally cached package
* Getting ex_doc (Hex package)
Checking package (https://repo.hex.pm/tarballs/ex_doc-0.13.0.tar)
Request failed (:timeout)
Fetch failed. Using locally cached package
* Getting inch_ex (Hex package)
Checking package (https://repo.hex.pm/tarballs/inch_ex-0.5.3.tar)
Using locally cached package
* Getting earmark (Hex package)
Checking package (https://repo.hex.pm/tarballs/earmark-1.0.1.tar)
Using locally cached package
* Getting connection (Hex package)
Checking package (https://repo.hex.pm/tarballs/connection-1.0.4.tar)
Using locally cached package
==> connection
Compiling 1 file (.ex)
Generated connection app
==> poolboy (compile)
Compiled src/poolboy_sup.erl
Compiled src/poolboy_worker.erl
Compiled src/poolboy.erl
==> decimal
Compiling 1 file (.ex)
Generated decimal app
==> poison
Compiling 4 files (.ex)
Generated poison app
===> Compiling sbroker
==> db_connection
Compiling 23 files (.ex)
Generated db_connection app
==> postgrex
Compiling 43 files (.ex)
Generated postgrex app
==> mariaex
Compiling 12 files (.ex)
Generated mariaex app
==> ecto
Compiling 68 files (.ex)
Generated ecto app
===> Failed to fetch and copy dep: {elixir,"ecto","2.0.0"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.