-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems compiling (warnings_as_errors) #23
Comments
Hi @Iulian7, Aside from fixing mix, the alternative is making all the dependencies compile w/o warning in Erlang 20. Which probably will eventually happen, but if you like to speed it up I suggest making PR's towards the dependencies in question. From we can do inside this repository, is only updating to newer versions of dependencies as they come along. |
Oh I forgot to say, I'm not yet on Erlang 20 so I don't know what problems will arise from it. |
I also realise the cuttlefish fork https://github.com/Kyorai/cuttlefish which fixes the I am running
It is worth noting that More details about the environment (as per
Also, if I simply run
Any ideas what might be going on or how this can be addressed? |
@Iulian7 have you asked the mix folks about it? It seems the package itself compiles fine but only files when compiled with mix instead rebar. My knowledge about mix ends about at knowing what it rougly is, I could imagine it calls some old version of rebar3 perhaps? Or uses an outdated plugin. I am really not sure here. |
@Licenser Thanks for the pointers. It turns out the rebar3 version mix was using was slightly older. I fixed this but it was not the problem. I will write to the Elixir/mix guys and see if I get anything. |
Awesome, if there is anything we can do let us know! |
I did some more experimentation. For some of these I had to remove Configuration 1 (compiles):
Configuration 2 (does not work):
Basically it works with the initial I find the whole thing extremely strange to say the least and I would like to find out what exactly is going on. I compared the cuttlefish 2.0.11 rebar.config
cuttlefish 2.0.12 rebar.config
There are some things that differ in these configurations. As I am not that familiar with Erlang I can't really say what implications these would have. Perhaps some more seasoned Erlang devs can comment on this. |
OK, the problem is with the post provider_hooks. If I comment out I think this is related: erlang/rebar3#1560 Does anyone think this is an issue that needs to be taken up to the main Elixir guys? Or is something else going on here? |
To compile riak on erlang 20: Add this to mix.exs. {:riak_core, github: "Kyorai/riak_core", branch: "fifo-merge"}, Modify rebar.conf in poolboy to remove warnings as errors: {erl_opts, [debug_info,
{platform_define, "^[0-9]+", namespaced_types}]}.
{eunit_opts, [verbose]}.
{cover_enabled, true}. Modify rebar.conf in cuttlefish to remove warnings as errors and provider_hooks: {minimum_otp_vsn, "R16"}.
{erl_opts, [{parse_transform, lager_transform},
debug_info,
warn_untyped_record]}.
{deps, [getopt, lager]}.
{escript_emu_args, "%%! -escript main cuttlefish_escript -smp disable +A 0\n"}.
{escript_incl_apps, [goldrush, getopt, lager, cuttlefish]}.
{escript_main_app, cuttlefish}.
{eunit_opts, [verbose]}.
{cover_enabled, true}.
{profiles, [{dev, [{deps, [neotoma]},
{plugins, [rebar3_neotoma_plugin]}]}]}. Modify rebar.conf in riak_ensemble to remove warnings as errors:
Modify rebar.conf in riak_core to remove warnings as errors: {erl_first_files, ["src/gen_nb_server.erl", "src/riak_core_gen_server.erl",
"src/riak_core_stat_xform"]}.
%{cover_enabled, true}.
{erl_opts, [{parse_transform, lager_transform},
debug_info, {platform_define, "^[0-9]+", namespaced_types},
{platform_define, "18", old_rand},
{platform_define, "17", old_rand},
{platform_define, "^R15", old_hash}]}.
{edoc_opts, [{preprocess, true}]}.
{eunit_opts, [verbose]}.
{xref_checks, []}.
{xref_queries, [{"(XC - UC) || (XU - X - B - \"(cluster_info|dtrace)\" : Mod)", []}]}.
{deps, [
%% Stuff we need to work with rebar3
{goldrush, "~>0.1.8"},
{cuttlefish, "~>2.0.12"},
{clique, "~>0.3.9"},
%% We now include folsom
folsom,
%% Normal deps
{lager, "~>3.2.4"},
{poolboy, "0.8.2", {pkg, basho_poolboy}},
{basho_stats, "~>1.0.3"},
{riak_sysmon, "~>2.1.3"},
{riak_ensemble, "~>2.4.0", {pkg, riak_ensemble_ng}},
{pbkdf2, "~>2.0.0"},
{blume, "~>0.1.0"},
{chash, "~>0.1.1"},
{eleveldb, "~>2.2.20"},
%%{eleveldb, {git, "https://github.com/project-fifo/eleveldb.git", {branch, "hex-2.2.19-diayzer"}}},
{exometer_core, "~>1.0.0", {pkg, basho_exometer_core}}
]}.
%%-------------------------------------------------------------------
%% Profiles
%%-------------------------------------------------------------------
{profiles,
[{test, [{deps,
[{mustache, ".*", {git, "https://github.com/mojombo/mustache.erl.git", {tag, "v0.1.1"}}}]}]},
{docs, [{deps, [{edown, "0.7.0"}]}]},
{eqc, [{erl_opts, [{d, 'TEST'}]}, {deps, [meck]}, {plugins, [rebar_eqc]}]},
{prod, [{relx, [{dev_mode, false}]}]},
{lint,
[{plugins,
[{rebar3_lint,
{git, "https://github.com/project-fifo/rebar3_lint.git",
{tag, "0.1.4"}}}]}]}
]}.
{overrides,
[
%% R19
{override, pooler,
[{erl_opts,
[{platform_define, "^[0-9]+", namespaced_types},
debug_info,
inline]}]},
%% Normal
{override, setup, [{post_hooks, []}]},
{override, eleveldb,
[{pre_hooks, [{compile, "c_src/build_deps.sh get-deps"},
{compile, "c_src/build_deps.sh"}]},
{post_hooks, [{clean, "c_src/build_deps.sh clean"}]},
{plugins,
[pc]},
{provider_hooks,
[{post,
[{compile, {pc, compile}},
{clean, {pc, clean}}]}]}]}]}. Make sure you have I was unable to start riak though. |
Copying https://github.com/basho/riak_core/blob/develop/priv/riak_core.schema into priv/ I was able to get riak to run. The other riak_core.schema didn't work. |
@fire what branch was that on? master or fifo-merge? If it's the fifo branch what was the error prompted? Also, I think we really need a decent solution to deal with warn_on_errors, disabling them in all projects doesn't seem like a good solution :( of cause making them all error free would be the best :P |
@Licenser I'm trying it now with Erlang 20, and I have these errors:
(I'm overriding erl_opts to work around them) |
removing warnings as errors is only a short-term remedy, those warnings will pop up as real errors eventually. Sadly I'm a bit preoccupied with other things at the moment and don't have an erlang 20 installed, so unless someone wants to step up and properly fix the warnings and make a PR it will have to wait a bit until I get some air. |
I would be happy to help in upgrading and giving back to this awesome community! |
Just a thought - but rebar3 now has the means to override properties in all child projects - would be ideal if mix could do the same - will create an issue and link back to this. |
@bieniusa sorry for the wrong link, I see you found it already and thanks for updating poolboy!!! |
since @bieniusa was so kind to get the erlang 20 ball rolling I added a https://github.com/Kyorai/riak_core/tree/erl20 branch to track it :) |
See #33 |
* Test with several slave nodes in a cluster (configured in config/test.exs). To prevent running RiakCore on the master node (harmless, but clutters the logs), invoke with `mix test --no-start` * Fixed a few warnings * Updated riak_core.schema Notes: * Running this project on Elixir 1.6.5 with Erlang 20.3.6. I had to comment out "warnings_as_errors" in `deps/riak_ensemble/rebar.config` and in `deps/riak_core/rebar.config` * This project uses riak_core_ng v3.0.9. Later riak_core_ng commits introduced gen_fsm_compat, which fails with newer Elixir+rebar3 because of "missing erl_vsn" issue: rebar_erl_vsn is a pre-compile hook in rebar.config of gen_fsm_compat and few other projects. Error seems to be caused by Mix not handling rebar3 hooks properly. See elixir-lang/elixir#7733 and Kyorai/riak_core#23 This issue is not specific to erl_vsn: for example, the forked https://github.com/gpad/cuttlefish (see mix.exs) differs from the official version only by rebar.config commenting out: % {provider_hooks, [{post, [{compile, {default, escriptize}}]}]}.
I am compiling on macOS Sierra, rebar 3.4.1 on Erlang/OTP 20 Erts 9.0 and Elixir 1.4.5.
I managed to compile but only after overriding some dependencies in
mix.exs
and manually removingwarnings_as_errors
from somerebar.config
files (e.g. cuttlefish and a few others).The relevant part of my
mix.exs
looks like this:The warning I am getting from
cuttlefish
for example isexport_all flag enabled - all functions will be exported
. There are also quite a lot of deprication warnings (e.g.the 'random' module is deprecated; use the 'rand' module instead
frombasho_stats
).Are these problems due to an incompatibility with Erlang 20 or is there something else I should be doing? Editing the rebar config files of dependencies seems kind of wrong.
basho/cuttlefish#234
The text was updated successfully, but these errors were encountered: