From 2f2c1089391999a3ba5fe9aeab3ca9f43e64439b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 31 May 2015 15:05:55 +0300 Subject: More autopatch fixes Some projects had their modules section filled incorrectly, this has been fixed. Merl (used by erlydtl) had its .app file incorrectly moved to .app.src despite having its own Makefile. This has been fixed. A new g++ warning caused some projects with -Werror to fail to compile, this has been fixed. The include path given in rebar.config is now properly used. The project concuerror has been removed temporarily due to a recent change that broke the auto detection. The projects ircbot, exmpp and tsung have been removed temporarily due to broken modules section and will need a custom patch and/or a PR sent to fix them. --- core/deps.mk | 50 +++++++++++++++++++++++++++++++++++--------------- core/erlc.mk | 6 ++---- packages.v1.tsv | 4 ---- packages.v1.txt | 4 ---- packages.v2.tsv | 6 +----- test/Makefile | 34 +++++++++++++++------------------- 6 files changed, 53 insertions(+), 51 deletions(-) diff --git a/core/deps.mk b/core/deps.mk index d032fbb..5318052 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -66,7 +66,12 @@ define dep_autopatch elif [ 0 != `find $(DEPS_DIR)/$(1)/ -type f -name \*.mk -not -name erlang.mk | xargs grep -ci rebar` ]; then \ $(call dep_autopatch2,$(1)); \ else \ - $(call dep_autopatch_erlang_mk,$(1)); \ + if [ -f $(DEPS_DIR)/$(1)/erlang.mk ]; then \ + $(call erlang,$(call dep_autopatch_appsrc.erl,$(1))); \ + $(call dep_autopatch_erlang_mk,$(1)); \ + else \ + $(call erlang,$(call dep_autopatch_app.erl,$(1))); \ + fi \ fi \ else \ if [ ! -d $(DEPS_DIR)/$(1)/src/ ]; then \ @@ -78,6 +83,7 @@ define dep_autopatch endef define dep_autopatch2 + $(call erlang,$(call dep_autopatch_appsrc.erl,$(1))); \ if [ -f $(DEPS_DIR)/$(1)/rebar.config -o -f $(DEPS_DIR)/$(1)/rebar.config.script ]; then \ $(call dep_autopatch_rebar_utils); \ $(call dep_autopatch_rebar,$(1)); \ @@ -94,20 +100,18 @@ endef ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk rm -f $(DEPS_DIR)/$(1)/erlang.mk; \ - cd $(DEPS_DIR)/$(1)/ && ln -s ../../erlang.mk; \ - $(call erlang,$(call dep_autopatch_appsrc.erl,$(1))) + cd $(DEPS_DIR)/$(1)/ && ln -s ../../erlang.mk endef else define dep_autopatch_erlang_mk - $(call erlang,$(call dep_autopatch_appsrc.erl,$(1))) + echo -n endef endif define dep_autopatch_gen printf "%s\n" \ "ERLC_OPTS = +debug_info" \ - "include ../../erlang.mk" > $(DEPS_DIR)/$(1)/Makefile; \ - $(call erlang,$(call dep_autopatch_appsrc.erl,$(1))) + "include ../../erlang.mk" > $(DEPS_DIR)/$(1)/Makefile endef define dep_autopatch_rebar_utils @@ -133,8 +137,7 @@ define dep_autopatch_rebar if [ -f $(DEPS_DIR)/$(1)/Makefile ]; then \ mv $(DEPS_DIR)/$(1)/Makefile $(DEPS_DIR)/$(1)/Makefile.orig.mk; \ fi; \ - $(call erlang,$(call dep_autopatch_rebar.erl,$(1))); \ - $(call erlang,$(call dep_autopatch_appsrc.erl,$(1))) + $(call erlang,$(call dep_autopatch_rebar.erl,$(1))) endef define dep_autopatch_rebar.erl @@ -174,6 +177,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({i, I}) -> + Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> case rebar_utils:is_arch(Regex) of true -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); @@ -288,7 +293,8 @@ define dep_autopatch_rebar.erl end end(), ShellToMk = fun(V) -> - re:replace(V, "(\\\\$$$$)(\\\\w*)", "\\\\1(\\\\2)", [{return, list}, global]) + re:replace(re:replace(V, "(\\\\$$$$)(\\\\w*)", "\\\\1(\\\\2)", [global]), + "-Werror\\\\b", "", [{return, list}, global]) end, PortSpecs = fun() -> case lists:keyfind(port_specs, 1, Conf) of @@ -427,18 +433,32 @@ define dep_autopatch_rebar.erl halt() endef +define dep_autopatch_app.erl + UpdateModules = fun(App) -> + case filelib:is_regular(App) of + false -> ok; + true -> + {ok, [{application, $(1), L0}]} = file:consult(App), + Mods = filelib:fold_files("$(DEPS_DIR)/$(1)/src", "\\\\.erl$$$$", true, + fun (F, Acc) -> [list_to_atom(filename:rootname(filename:basename(F)))|Acc] end, []), + L = lists:keystore(modules, 1, L0, {modules, Mods}), + ok = file:write_file(App, io_lib:format("~p.~n", [{application, $(1), L}])) + end + end, + UpdateModules("$(DEPS_DIR)/$(1)/ebin/$(1).app"), + halt() +endef + define dep_autopatch_appsrc.erl AppSrcOut = "$(DEPS_DIR)/$(1)/src/$(1).app.src", AppSrcIn = case filelib:is_regular(AppSrcOut) of false -> "$(DEPS_DIR)/$(1)/ebin/$(1).app"; true -> AppSrcOut end, case filelib:is_regular(AppSrcIn) of false -> ok; true -> - fun() -> - {ok, [{application, $(1), L}]} = file:consult(AppSrcIn), - L2 = lists:keystore(modules, 1, L, {modules, []}), - L3 = case lists:keyfind(vsn, 1, L2) of {vsn, git} -> lists:keyreplace(vsn, 1, L2, {vsn, "git"}); _ -> L2 end, - ok = file:write_file(AppSrcOut, io_lib:format("~p.~n", [{application, $(1), L3}])) - end(), + {ok, [{application, $(1), L0}]} = file:consult(AppSrcIn), + L1 = lists:keystore(modules, 1, L0, {modules, []}), + L2 = case lists:keyfind(vsn, 1, L1) of {vsn, git} -> lists:keyreplace(vsn, 1, L1, {vsn, "git"}); _ -> L1 end, + ok = file:write_file(AppSrcOut, io_lib:format("~p.~n", [{application, $(1), L2}])), case AppSrcOut of AppSrcIn -> ok; _ -> ok = file:delete(AppSrcIn) end end, halt() diff --git a/core/erlc.mk b/core/erlc.mk index 18e8814..08f4f27 100644 --- a/core/erlc.mk +++ b/core/erlc.mk @@ -101,12 +101,10 @@ ebin/$(PROJECT).app:: $(shell find mibs -type f -name \*.mib) $(if $(strip $?),$(call compile_mib,$?)) endif -ebin/$(PROJECT).app:: $(shell find src -type f -name \*.erl) \ - $(shell find src -type f -name \*.core) +ebin/$(PROJECT).app:: $(shell find src -type f -name \*.erl -o -name \*.core) $(if $(strip $?),$(call compile_erl,$?)) -ebin/$(PROJECT).app:: $(shell find src -type f -name \*.xrl) \ - $(shell find src -type f -name \*.yrl) +ebin/$(PROJECT).app:: $(shell find src -type f -name \*.xrl -o -name \*.yrl) $(if $(strip $?),$(call compile_xyrl,$?)) endif diff --git a/packages.v1.tsv b/packages.v1.tsv index 428fa3d..6f191cf 100644 --- a/packages.v1.tsv +++ b/packages.v1.tsv @@ -30,7 +30,6 @@ chronos https://github.com/lehoff/chronos https://github.com/lehoff/chronos Time classifier https://github.com/inaka/classifier https://github.com/inaka/classifier An Erlang Bayesian Filter and Text Classifier clique https://github.com/basho/clique https://github.com/basho/clique CLI Framework for Erlang cluster_info https://github.com/basho/cluster_info https://github.com/basho/cluster_info Fork of Hibari's nifty cluster_info OTP app -concuerror https://github.com/parapluu/Concuerror http://www.concuerror.com/ Concuerror is a systematic testing tool for concurrent Erlang programs confetti https://github.com/jtendo/confetti https://github.com/jtendo/confetti Erlang configuration provider / application:get_env/2 on steroids couchbeam https://github.com/benoitc/couchbeam https://github.com/benoitc/couchbeam Apache CouchDB client in Erlang couch https://github.com/benoitc/opencouch https://github.com/benoitc/opencouch A embeddable document oriented database compatible with Apache CouchDB @@ -129,7 +128,6 @@ eunit https://github.com/richcarl/eunit https://github.com/richcarl/eunit The EU euthanasia https://github.com/doubleyou/euthanasia https://github.com/doubleyou/euthanasia Merciful killer for your Erlang processes exec https://github.com/saleyn/erlexec http://saleyn.github.com/erlexec Execute and control OS processes from Erlang/OTP. exml https://github.com/paulgray/exml https://github.com/paulgray/exml XML parsing library in Erlang -exmpp https://github.com/processone/exmpp https://github.com/processone/exmpp Erlang XMPP library exometer https://github.com/Feuerlabs/exometer https://github.com/Feuerlabs/exometer Basic measurement objects and probe behavior exs1024 https://github.com/jj1bdx/exs1024 https://github.com/jj1bdx/exs1024 Xorshift1024star pseudo random number generator for Erlang. exs64 https://github.com/jj1bdx/exs64 https://github.com/jj1bdx/exs64 Xorshift64star pseudo random number generator for Erlang. @@ -172,7 +170,6 @@ hyper https://github.com/GameAnalytics/hyper https://github.com/GameAnalytics/hy ibrowse https://github.com/cmullaparthi/ibrowse https://github.com/cmullaparthi/ibrowse Erlang HTTP client ierlang https://github.com/robbielynch/ierlang https://github.com/robbielynch/ierlang An Erlang language kernel for IPython. iota https://github.com/jpgneves/iota https://github.com/jpgneves/iota iota (Inter-dependency Objective Testing Apparatus) - a tool to enforce clean separation of responsibilities in Erlang code -ircbot https://github.com/gdamjan/erlang-irc-bot https://github.com/gdamjan/erlang-irc-bot A simple extendable irc bot in Erlang ircd https://github.com/tonyg/erlang-ircd https://github.com/tonyg/erlang-ircd A pluggable IRC daemon application/library for Erlang. irc_lib https://github.com/OtpChatBot/irc_lib https://github.com/OtpChatBot/irc_lib Erlang irc client library iris https://github.com/project-iris/iris-erl https://github.com/project-iris/iris-erl Iris Erlang binding @@ -356,7 +353,6 @@ trane https://github.com/massemanet/trane https://github.com/massemanet/trane SA transit https://github.com/isaiah/transit-erlang https://github.com/isaiah/transit-erlang transit format for erlang trie https://github.com/okeuday/trie https://github.com/okeuday/trie Erlang Trie Implementation triq https://github.com/krestenkrab/triq https://github.com/krestenkrab/triq Trifork QuickCheck -tsung https://github.com/processone/tsung https://github.com/processone/tsung Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc. tunctl https://github.com/msantos/tunctl https://github.com/msantos/tunctl Erlang TUN/TAP interface twerl https://github.com/lucaspiller/twerl https://github.com/lucaspiller/twerl Erlang client for the Twitter Streaming API twitter_erlang https://github.com/ngerakines/erlang_twitter https://github.com/ngerakines/erlang_twitter An Erlang twitter client diff --git a/packages.v1.txt b/packages.v1.txt index 428fa3d..6f191cf 100644 --- a/packages.v1.txt +++ b/packages.v1.txt @@ -30,7 +30,6 @@ chronos https://github.com/lehoff/chronos https://github.com/lehoff/chronos Time classifier https://github.com/inaka/classifier https://github.com/inaka/classifier An Erlang Bayesian Filter and Text Classifier clique https://github.com/basho/clique https://github.com/basho/clique CLI Framework for Erlang cluster_info https://github.com/basho/cluster_info https://github.com/basho/cluster_info Fork of Hibari's nifty cluster_info OTP app -concuerror https://github.com/parapluu/Concuerror http://www.concuerror.com/ Concuerror is a systematic testing tool for concurrent Erlang programs confetti https://github.com/jtendo/confetti https://github.com/jtendo/confetti Erlang configuration provider / application:get_env/2 on steroids couchbeam https://github.com/benoitc/couchbeam https://github.com/benoitc/couchbeam Apache CouchDB client in Erlang couch https://github.com/benoitc/opencouch https://github.com/benoitc/opencouch A embeddable document oriented database compatible with Apache CouchDB @@ -129,7 +128,6 @@ eunit https://github.com/richcarl/eunit https://github.com/richcarl/eunit The EU euthanasia https://github.com/doubleyou/euthanasia https://github.com/doubleyou/euthanasia Merciful killer for your Erlang processes exec https://github.com/saleyn/erlexec http://saleyn.github.com/erlexec Execute and control OS processes from Erlang/OTP. exml https://github.com/paulgray/exml https://github.com/paulgray/exml XML parsing library in Erlang -exmpp https://github.com/processone/exmpp https://github.com/processone/exmpp Erlang XMPP library exometer https://github.com/Feuerlabs/exometer https://github.com/Feuerlabs/exometer Basic measurement objects and probe behavior exs1024 https://github.com/jj1bdx/exs1024 https://github.com/jj1bdx/exs1024 Xorshift1024star pseudo random number generator for Erlang. exs64 https://github.com/jj1bdx/exs64 https://github.com/jj1bdx/exs64 Xorshift64star pseudo random number generator for Erlang. @@ -172,7 +170,6 @@ hyper https://github.com/GameAnalytics/hyper https://github.com/GameAnalytics/hy ibrowse https://github.com/cmullaparthi/ibrowse https://github.com/cmullaparthi/ibrowse Erlang HTTP client ierlang https://github.com/robbielynch/ierlang https://github.com/robbielynch/ierlang An Erlang language kernel for IPython. iota https://github.com/jpgneves/iota https://github.com/jpgneves/iota iota (Inter-dependency Objective Testing Apparatus) - a tool to enforce clean separation of responsibilities in Erlang code -ircbot https://github.com/gdamjan/erlang-irc-bot https://github.com/gdamjan/erlang-irc-bot A simple extendable irc bot in Erlang ircd https://github.com/tonyg/erlang-ircd https://github.com/tonyg/erlang-ircd A pluggable IRC daemon application/library for Erlang. irc_lib https://github.com/OtpChatBot/irc_lib https://github.com/OtpChatBot/irc_lib Erlang irc client library iris https://github.com/project-iris/iris-erl https://github.com/project-iris/iris-erl Iris Erlang binding @@ -356,7 +353,6 @@ trane https://github.com/massemanet/trane https://github.com/massemanet/trane SA transit https://github.com/isaiah/transit-erlang https://github.com/isaiah/transit-erlang transit format for erlang trie https://github.com/okeuday/trie https://github.com/okeuday/trie Erlang Trie Implementation triq https://github.com/krestenkrab/triq https://github.com/krestenkrab/triq Trifork QuickCheck -tsung https://github.com/processone/tsung https://github.com/processone/tsung Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc. tunctl https://github.com/msantos/tunctl https://github.com/msantos/tunctl Erlang TUN/TAP interface twerl https://github.com/lucaspiller/twerl https://github.com/lucaspiller/twerl Erlang client for the Twitter Streaming API twitter_erlang https://github.com/ngerakines/erlang_twitter https://github.com/ngerakines/erlang_twitter An Erlang twitter client diff --git a/packages.v2.tsv b/packages.v2.tsv index 473df31..3da0696 100644 --- a/packages.v2.tsv +++ b/packages.v2.tsv @@ -30,7 +30,6 @@ chronos git https://github.com/lehoff/chronos master https://github.com/lehoff/c classifier git https://github.com/inaka/classifier master https://github.com/inaka/classifier An Erlang Bayesian Filter and Text Classifier clique git https://github.com/basho/clique develop https://github.com/basho/clique CLI Framework for Erlang cluster_info git https://github.com/basho/cluster_info master https://github.com/basho/cluster_info Fork of Hibari's nifty cluster_info OTP app -concuerror git https://github.com/parapluu/Concuerror master http://www.concuerror.com/ Concuerror is a systematic testing tool for concurrent Erlang programs confetti git https://github.com/jtendo/confetti master https://github.com/jtendo/confetti Erlang configuration provider / application:get_env/2 on steroids couchbeam git https://github.com/benoitc/couchbeam master https://github.com/benoitc/couchbeam Apache CouchDB client in Erlang couch git https://github.com/benoitc/opencouch master https://github.com/benoitc/opencouch A embeddable document oriented database compatible with Apache CouchDB @@ -129,7 +128,6 @@ eunit git https://github.com/richcarl/eunit master https://github.com/richcarl/e euthanasia git https://github.com/doubleyou/euthanasia master https://github.com/doubleyou/euthanasia Merciful killer for your Erlang processes exec git https://github.com/saleyn/erlexec master http://saleyn.github.com/erlexec Execute and control OS processes from Erlang/OTP. exml git https://github.com/paulgray/exml master https://github.com/paulgray/exml XML parsing library in Erlang -exmpp git https://github.com/processone/exmpp master https://github.com/processone/exmpp Erlang XMPP library exometer git https://github.com/Feuerlabs/exometer 1.2 https://github.com/Feuerlabs/exometer Basic measurement objects and probe behavior exs1024 git https://github.com/jj1bdx/exs1024 master https://github.com/jj1bdx/exs1024 Xorshift1024star pseudo random number generator for Erlang. exs64 git https://github.com/jj1bdx/exs64 master https://github.com/jj1bdx/exs64 Xorshift64star pseudo random number generator for Erlang. @@ -172,7 +170,6 @@ hyper git https://github.com/GameAnalytics/hyper master https://github.com/GameA ibrowse git https://github.com/cmullaparthi/ibrowse v4.1.1 https://github.com/cmullaparthi/ibrowse Erlang HTTP client ierlang git https://github.com/robbielynch/ierlang master https://github.com/robbielynch/ierlang An Erlang language kernel for IPython. iota git https://github.com/jpgneves/iota master https://github.com/jpgneves/iota iota (Inter-dependency Objective Testing Apparatus) - a tool to enforce clean separation of responsibilities in Erlang code -ircbot git https://github.com/gdamjan/erlang-irc-bot master https://github.com/gdamjan/erlang-irc-bot A simple extendable irc bot in Erlang ircd git https://github.com/tonyg/erlang-ircd master https://github.com/tonyg/erlang-ircd A pluggable IRC daemon application/library for Erlang. irc_lib git https://github.com/OtpChatBot/irc_lib master https://github.com/OtpChatBot/irc_lib Erlang irc client library iris git https://github.com/project-iris/iris-erl master https://github.com/project-iris/iris-erl Iris Erlang binding @@ -216,7 +213,7 @@ locks git https://github.com/uwiger/locks master https://github.com/uwiger/locks log4erl git https://github.com/ahmednawras/log4erl master https://github.com/ahmednawras/log4erl A logger for erlang in the spirit of Log4J. lol git https://github.com/b0oh/lol master https://github.com/b0oh/lol Lisp on erLang, and programming is fun again lucid git https://github.com/tatsuhiro-t/lucid master https://github.com/tatsuhiro-t/lucid HTTP/2 server written in Erlang -luerl git https://github.com/rvirding/luerl master https://github.com/rvirding/luerl Lua in Erlang +luerl git https://github.com/rvirding/luerl develop https://github.com/rvirding/luerl Lua in Erlang luwak git https://github.com/basho/luwak master https://github.com/basho/luwak Large-object storage interface for Riak mad git https://github.com/synrc/mad master https://github.com/synrc/mad Small and Fast Rebar Replacement mavg git https://github.com/EchoTeam/mavg master https://github.com/EchoTeam/mavg Erlang :: Exponential moving average library @@ -356,7 +353,6 @@ trane git https://github.com/massemanet/trane master https://github.com/masseman transit git https://github.com/isaiah/transit-erlang master https://github.com/isaiah/transit-erlang transit format for erlang trie git https://github.com/okeuday/trie master https://github.com/okeuday/trie Erlang Trie Implementation triq git https://github.com/krestenkrab/triq master https://github.com/krestenkrab/triq Trifork QuickCheck -tsung git https://github.com/processone/tsung master https://github.com/processone/tsung Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc. tunctl git https://github.com/msantos/tunctl master https://github.com/msantos/tunctl Erlang TUN/TAP interface twerl git https://github.com/lucaspiller/twerl oauth https://github.com/lucaspiller/twerl Erlang client for the Twitter Streaming API twitter_erlang git https://github.com/ngerakines/erlang_twitter master https://github.com/ngerakines/erlang_twitter An Erlang twitter client diff --git a/test/Makefile b/test/Makefile index dcc51b5..e31e531 100644 --- a/test/Makefile +++ b/test/Makefile @@ -240,25 +240,21 @@ pkg-$(1): pkg-$(1)-clean pkg-$(1)-app1 else \ if [ `find -type f -name erl_crash.dump` ]; then exit 33; fi \ fi - @if [ "$(1)" = "tsung" ]; then \ - echo "Skipping module loading check for package $(1)..."; \ - else \ - erl +A0 -noinput -boot start_clean -pa app1/deps/*/ebin -eval " \ - Apps = [list_to_atom(App) || \"app1/deps/\" ++ App <- filelib:wildcard(\"app1/deps/*\")], \ - [begin \ - io:format(\"Loading application ~p~n\", [App]), \ - case application:load(App) of \ - {error, _} -> ok; \ - ok -> \ - {ok, Mods} = application:get_key(App, modules), \ - [try io:format(\" Loading module ~p~n\", [Mod]), \ - {module, Mod} = code:load_file(Mod) \ - catch C:R -> timer:sleep(500), erlang:C(R) \ - end || Mod <- Mods] \ - end \ - end || App <- Apps], \ - halt()."; \ - fi + erl +A0 -noinput -boot start_clean -pa app1/deps/*/ebin -eval " \ + Apps = [list_to_atom(App) || \"app1/deps/\" ++ App <- filelib:wildcard(\"app1/deps/*\")], \ + [begin \ + io:format(\"Loading application ~p~n\", [App]), \ + case application:load(App) of \ + {error, _} -> ok; \ + ok -> \ + {ok, Mods} = application:get_key(App, modules), \ + [try io:format(\" Loading module ~p~n\", [Mod]), \ + {module, Mod} = code:load_file(Mod) \ + catch C:R -> timer:sleep(500), erlang:C(R) \ + end || Mod <- Mods] \ + end \ + end || App <- Apps], \ + halt()." endef $(foreach pkg,$(shell awk '{print $$1}' ../packages.v2.tsv),$(eval $(call pkg_test_target,$(pkg)))) -- cgit v1.2.3