synrc / mad Goto Github PK
View Code? Open in Web Editor NEW⚡ MAD: Managing Application Dependencies LING/UNIX
Home Page: https://mad.n2o.dev
License: Other
⚡ MAD: Managing Application Dependencies LING/UNIX
Home Page: https://mad.n2o.dev
License: Other
Trying to build this with latest SW incl Xcode on Mac
After cloning and then try to make it, it fails:
make
echo "-define(VERSION,"git describe --tags
")." > include/mad.hrl
erlc -o ebin deps/ling/bc/.erl || true
deps/ling/bc/.erl: no such file or directory
./mad cle dep com str bun mad
OK
==> dependency: "git://github.com/synrc/sh" tag: {branch,"master"}
==> "sh"
cc -c -Wno-deprecated-declarations -g -Wall -fPIC -MMD -I/Users/etxemag/Library/Application Support/ErlangInstaller/21.0/lib/erl_interface-3.10.3/include -I/Users/etxemag/Library/Application Support/ErlangInstaller/21.0/erts-10.0/include /Users/etxemag/Projects/test/mad/deps/sh/c_src/fdlink.c -o /Users/etxemag/Projects/test/mad/deps/sh/c_src/fdlink.o
Port Compilation Error:[{error,<<"clang: error: no such file or directory: 'Support/ErlangInstaller/21.0/lib/erl_interface-3.10.3/include'\nclang: error: no such file or directory: 'Support/ErlangInstaller/21.0/erts-10.0/include'\n">>}]
ERROR
OK
OK
sh
make: *** [Makefile:4: default] Error 1
And found it in commit history. Is that mean mqtt skeleton is deprecated? Or is there any alternative solution to init n2p mqtt app?
In the README.md file, there are a few clarifications that would be helpful.
The mad release command requires relx to be in one's $PATH.
The command to invoke the console appears to be:
$ _rel/sample/bin/sample console
As an aside, how to check if the sample application and release is working properly?
Thanks.
./mad up
****
==> up: "deps/sh"
==> up: "deps/syn"
==> up: "."
fatal: Not a git repository (or any of the parent directories): .git
escript: exception error: no function clause matching lists:flatten({error,unknown}) (lists.erl, line 616)
in function mad:main/1 (/Users/5HT/depot/synrc/mad/src/mad.erl, line 17)
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
Currently, we have this:
$ mad stop
ERROR
Not Implemented.
It would be nice to have such functionality.
When trying to compile the sample application of n2o, there's a compilation error.
This was because mad compilation needc gcc, which wasn't installed.
A warning message should be shown when gcc isn't detected in stead of a more cryptic compilation error to be helpfull.
It would be a killer feature if you could bundle beam emulator into bundle. This would allow writing small cli tools for systems where erlang is not installed. Crate for ruby could be used to get general idea of the feature. In order to avoid modification of erts source you would probably want to overide entrypoint to build static beam emulator which you can link with loader. Magic to start erl
from C is in erl_start
/erl_init
from erl_init.c.
It would be nice to have dev-dependencies, which would load with mad, but not included in releases. At least for beam
releases.
options from top-level rebar.config
are ignored when traversing dependencies
e.g.:
{sub_dirs, ["apps/lib", "apps/tsung", "apps/tsung_controller", "apps/tsung_recorder"]}.
{erl_opts, [{i, "include"}]}.
(playground: https://github.com/proger/tsung/tree/madtsung)
Please do provide PFX merging of private and public keys after enrollment from https://ca.n2o.space/man/ecc.htm and https://ca.n2o.space/man/rsa.htm CLIENT PFX
sections as a post processing.
Hi all! )))
I try to run commands:
$ mad app sample
$ cd sample
$ mad deps compile plan bundle web_app
But it returns displays error:
bash-3.2# mad deps compile plan bundle web_app
==> dependency: "git://github.com/evanmiller/erlydtl" tag: {tag,"0.8.0"}
Fetch Error: xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
ERROR: "xcrun: error: active developer path (\"/Applications/Xcode.app/Contents/Developer\") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)\n"
escript: exception error: no function clause matching lists:flatten({return,
{return,
{return,
[{error,
"xcrun: error: active developer path (\"/Applications/Xcode.app/Contents/Developer\") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)\n"}]}}}) (lists.erl, line 616)
in function mad:main/1 (/Users/5HT/depot/synrc/mad/src/mad.erl, line 17)
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
What could be the problem?
mac os 10.11.6 (15G1004) xcode 7.3.1 and 8
:~/repo/mad$ make
echo "-define(VERSION,\"`git describe --tags`\")." > include/mad.hrl
erlc -o ebin deps/ling/bc/*.erl || true
deps/ling/bc/*.erl: no such file or directory
./mad cle dep com str bun mad
escript: exception error: undefined function mad:main/1
in function escript:run/2 (escript.erl, line 759)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1
in call from init:do_boot/3
Makefile:2: recipe for target 'default' failed
make: *** [default] Error 127
run on Ubuntu 18.04 x64, OTP 20
=ERROR REPORT==== 2-Nov-2014::15:56:29 ===
Error in process <0.95.0> on node '[email protected]' with exit value: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.935>,ranch_tcp,keepalive,<0.95.0>,<<3 bytes>>,'HTTP/1.1',{{127,0,0,1},64817},<<9 bytes>>,un
defined,8000,<<1 byte>>,undefined,<<0 bytes>>,...
=ERROR REPORT==== 2-Nov-2014::15:56:29 ===
Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.95.0> exit with reason: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.935>,ranch_tcp,keepalive,<0.95.0>,<<"GET">>,'H
TTP/1.1',{{127,0,0,1},64817},<<"localhost">>,undefined,8000,<<"/">>,undefined,<<>>,[],[],[{<<"host">>,<<"localhost:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10
_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"__ngDebug=true; XSRF-TOKEN=AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user%
22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22AGDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V67skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2dc62e0f7bb3205950140260092a24b46056f283df1937e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh
4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g55fca0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2*Vw7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}],[{<<"content-length">>,0},{<<"expect">>,undefined},{<<"content-length">>,0},{<<"transf
er-encoding">>,[<<"identity">>]},{<<"connection">>,[<<"keep-alive">>]}],undefined,[],done,undefined,<<>>,false,waiting,[],<<>>,undefined},index,[],{{<<"sMMRqoBML/IlKwKIltjAzA==">>,<<"auth">>},<<"/">>,{1414,936589,583645},{86400,{{2014,11,3},{13,56,29}}},new},[],[],[]}],[]},{wf_context,'-fold/3-fun-0-',3,[{file,"/User
s/henry/code/temp/test-mad/test/deps/n2o/src/wf_context.erl"},{line,31}]},{lists,foldl,3,[{file,"lists.erl"},{line,1261}]},{n2o_document,run,1,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/endpoints/n2o_document.erl"},{line,13}]},{n2o_cowboy,handle,2,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/s
rc/endpoints/cowboy/n2o_cowboy.erl"},{line,13}]},{cowboy_handler,handler_handle,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_handler.erl"},{line,118}]},{cowboy_protocol,execute,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]},{req,[{socket,#P
ort<0.935>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.95.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},64817}},{host,<<"localhost">>},{host_info,undefined},{port,8000},{path,<<"/">>},{path_info,undefined},{qs,<<>>},{qs_vals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"localhost:8000">
},{<<"connection">>,<<"keep-alive">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,defla
te,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"_ngDebug=true; XSRF-TOKEN=AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user%22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22AGDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V6
7skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2dc62e0f7bb3205950140260092a24b46056f283df1937e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g55fca0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2*V
w7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}]},{p_headers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,undefined},{buffer,<<>>},{resp_compress,false},{resp_state,waiting},{resp_headers,[]},{resp
body,<<>>},{onresponse,undefined}]},{state,{state,undefined,undefined}}],[{cowboy_protocol,execute,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]}
=ERROR REPORT==== 2-Nov-2014::15:56:30 ===
Error in process <0.97.0> on node '[email protected]' with exit value: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.1167>,ranch_tcp,keepalive,<0.97.0>,<<3 bytes>>,'HTTP/1.1',{{127,0,0,1},64820},<<9 bytes>>,u
ndefined,8000,<<12 bytes>>,undefined,<<0 bytes>>,...
=ERROR REPORT==== 2-Nov-2014::15:56:30 ===
Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.97.0> exit with reason: {[{reason,undef},{mfa,{n2o_cowboy,handle,2}},{stacktrace,[{routes,init,[[],{cx,[{query,n2o_query},{session,n2o_session},{route,routes}],[],{http_req,#Port<0.1167>,ranch_tcp,keepalive,<0.97.0>,<<"GET">>,'
HTTP/1.1',{{127,0,0,1},64820},<<"localhost">>,undefined,8000,<<"/favicon.ico">>,undefined,<<>>,[],[],[{<<"host">>,<<"localhost:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"accept">>,<<"/">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2
125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"__ngDebug=true; XSRF-TOKEN=AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user%22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22A
GDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V67skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2dc62e0f7bb3205950140260092a24b46056f283df1937e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g55fc
a0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2_Vw7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}],[{<<"content-length">>,0},{<<"expect">>,undefined},{<<"content-length">>,0},{<<"transfer-encoding">>,[<<"identity">>]},{<<"connection">>,[<<"keep
-alive">>]}],undefined,[],done,undefined,<<>>,false,waiting,[],<<>>,undefined},index,[],{{<<"SL6iLWZN0eDCFpDXC+qRfA==">>,<<"auth">>},<<"/">>,{1414,936590,81838},{86400,{{2014,11,3},{13,56,30}}},new},[],[],[]}],[]},{wf_context,'-fold/3-fun-0-',3,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/wf_context.erl"
},{line,31}]},{lists,foldl,3,[{file,"lists.erl"},{line,1261}]},{n2o_document,run,1,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/endpoints/n2o_document.erl"},{line,13}]},{n2o_cowboy,handle,2,[{file,"/Users/henry/code/temp/test-mad/test/deps/n2o/src/endpoints/cowboy/n2o_cowboy.erl"},{line,13}]},{cowboy_han
dler,handler_handle,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_handler.erl"},{line,118}]},{cowboy_protocol,execute,4,[{file,"/Users/henry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]},{req,[{socket,#Port<0.1167>},{transport,ranch_tcp},{connection,keepalive},{p
id,<0.97.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},64820}},{host,<<"localhost">>},{host_info,undefined},{port,8000},{path,<<"/favicon.ico">>},{path_info,undefined},{qs,<<>>},{qs_vals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"localhost:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"accep
t">>,<<"/">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8,pt;q=0.6,he;q=0.4">>},{<<"cookie">>,<<"__ngDebug=true; XSRF-TOKEN=
AGDTI-f9Qg8mGdRGKNApIDFe; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%22user%22%3A%225447aa01e4b03389d7e2685f%22%7D%2C%22_csrf%22%3A%22AGDTI-f9Qg8mGdRGKNApIDFe%22%7D.pXxiRVJMcR5rixo2BXKFgmd6jlgV18V67skG2PpVDko; crumb=blufAx7zaJthdXeUtPNn42SOLp_WVZkEdkOLoSLYKMI; yar=Fe26.2__dc62e0f7bb3205950140260092a24b46056f283df19
37e5c91d1f69535d68b64_rpewoTJa9GxbTY5U450uSA_F1_TDh1k8XG9UxYnIqiU5Al0ey4ITQRVh4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g__55fca0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2_Vw7DtNzeKXoM7YPuDGdYS9M6yEePIxUEB9jDcbG3AiY; n2o-sid=yV1vJInUbc0d4/P2ZQic+g==; n2o-name=ilgin_ayhan1500001">>}]},{p_head
ers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,undefined},{buffer,<<>>},{resp_compress,false},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]},{state,{state,undefined,undefined}}],[{cowboy_protocol,execute,4,[{file,"/Users/hen
ry/code/temp/test-mad/test/deps/cowboy/src/cowboy_protocol.erl"},{line,529}]}]}
/deps/*/rebar.config has priority over /rebar.config
example:
here is output of ./mad sh
on change of a yecc
source file:
[{yecc,file,["/home/user/github/groupoid/exe/src/macro_parser.yrl"],[]},
{mad_yecc,compile,5,
[{file,"/home/user/github/groupoid/exe/deps/mad/src/compile/mad_yecc.erl"},
{line,11}]},
{mad_compile,compile_files,5,
[{file,"/home/user/github/groupoid/exe/deps/mad/src/compile/mad_compile.erl"},
{line,79}]},
{mad_compile,dep,4,
[{file,"/home/user/github/groupoid/exe/deps/mad/src/compile/mad_compile.erl"},
{line,68}]},
{active,compile,2,
[{file,"/home/user/github/groupoid/exe/deps/active/src/active.erl"},
{line,88}]},
{active,handle_info,2,
[{file,"/home/user/github/groupoid/exe/deps/active/src/active.erl"},
{line,27}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,601}]},
Catch: error:undefe_msg,5,[{file,"gen_server.erl"},{line,667}]}]
however ./mad com
works fine in this case.
Local Configuration:
Running Make yields:
C:\Data\SW-Development\mad>escript.exe mad cle dep com bun mad
OK
==> dependency: "git://github.com/synrc/sh" tag: {tag,"2.11"}
escript: exception error: enoent
in function open_port/2
called as open_port({spawn_executable,false},
[stream,stderr_to_stdout,binary,exit_status,
{args,["-c",
"git clone git://github.com/synrc/sh deps/sh && cd deps/sh && git checkout "2.11""]},
{cd,"."},
{env,[]}])
in call from sh:run/5 (/Users/maxim/depot/o/o7/mad/deps/sh/src/sh.erl, line 43)
in call from mad_git:fetch_dep/9 (/Users/maxim/depot/o/o7/mad/src/mad_git.erl, line 78)
in call from mad_git:fetch/4 (/Users/maxim/depot/o/o7/mad/src/mad_git.erl, line 27)
in call from mad:'-main/1-fun-3-'/2 (/Users/maxim/depot/o/o7/mad/src/mad.erl, line 24)
in call from lists:foldl/3 (lists.erl, line 1263)
in call from mad:main/1 (/Users/maxim/depot/o/o7/mad/src/mad.erl, line 21)
cannot figure out how to solve it.
help appreciated.
D:\AppsDev\Erlang\n2o\myapps>mad deps
==> dependency: "git://github.com/evanmiller/erlydtl" tag: {tag,"0.8.0"}
escript: exception error: enoent
in function open_port/2
called as open_port({spawn_executable,"/bin/sh"},
[stream,stderr_to_stdout,binary,exit_status,
{args,["-c",
"git clone git://github.com/evanmiller/erlydtl deps/erlydtl && cd deps/erlydtl && git checkout "0.8.0""]},
{cd,"."},
{env,[]}])
in call from sh:run/5 (/Users/5HT/depot/synrc/mad/deps/sh/src/sh.erl, line 42)
in call from mad_git:fetch_dep/8 (/Users/5HT/depot/synrc/mad/src/sources/mad_git.erl, line 58)
in call from mad_git:fetch/4 (/Users/5HT/depot/synrc/mad/src/sources/mad_git.erl, line 26)
in call from mad:'-main/1-fun-3-'/3 (/Users/5HT/depot/synrc/mad/src/mad.erl, line 19)
in call from lists:foldl/3 (lists.erl, line 1262)
in call from mad:main/1 (/Users/5HT/depot/synrc/mad/src/mad.erl, line 18)
AFAIK, it is not possible to start node with the given name. Even if I set
-name mynode@127.0.0.1
in vm.args
, I get nonode@nohost
Hi! I like mad as a replacement for rebar.
I see however that it's still meant to be used as a script, while I would like to be able to use it from the Erlang shell -- it would not shut down after running and the errors/warnings/progress messages would be returned or sent to a listener process as Erlang messages.
Do you have any plans for supporting something like that?
там не було конфліктів, гітхаб пише що все ок, конфлікти відсутні
зробив і залив скриншот-пруф --
https://github.com/221V/mad/blob/branch2/screenshot.png
I guess the issue is somewhere along the lines of rewrite_leaders but who knows.
Reproduce:
mad app sample
cd sample
mad dep com pla rep
1> logger:notice(#{lol=>wtf}).
¯\_(ツ)_/¯
rebar3 seems to employ some extra hacks
Just to make sure: does mad support rebar.config.scripts?
I tried to run mad in windows with many combinations of its commands and I have never been able to write any erlang term in its repl prompt. It only shows various outputs but never accepts any input from the keyboard unless you press Ctrl+C which terminates mad repl.
Another relative thing is that default backend logger "n2o_log" doesn't work in windows (doesn't log out anything). However, "n2o_io" works just fine, so maybe this is not an issue.
Reading from file in bundle «filesystem» corrupts UTF-8 symbols: for example, «Юникод» is converted to «Ð®Ð½Ð¸ÐºÐ¾Ð´» while the same string from the local file is read ok. To reproduce bundle must be runned outside build directory, because an external file can override file in bundle.
While it seems that when a source file is modified, mad is sensing it and is doing the compilation:
1> ==> "sample"
1> ==> "d:/AppsDev/Erlang/n2o/myapps"
1> ==> "d:/AppsDev/Erlang/n2o/myapps/apps"
1> ==> "d:/AppsDev/Erlang/n2o/myapps/apps/sample"
1> Compiling d/apps/sample/src/index.erl
1> ==> "sample"
1> ==> "d:/AppsDev/Erlang/n2o/myapps"
1> ==> "d:/AppsDev/Erlang/n2o/myapps/apps"
1> ==> "d:/AppsDev/Erlang/n2o/myapps/apps/sample"
1>
it actually doesn't load the new changed code. For example, if you have a page, say index and you change anything in index.erl ( e.g. some text in the body of a button in fun/0 body() ) and you press refresh (F5) in the browser you still get the old page.
The only solution in order to get the new page is to press Ctrl+C for repl termination and run "mad plan repl" again.
currently mad
simply logs all errors mixed with warnings and exists with 0
Hello, I have built mad from source (latest commit 4c8f604)
and I am trying to experiment with a sample app as instructed:
$ mad app "sample"
$ cd sample/
$ mad deps compile plan bundle "web_app"
But I am getting this:
DTL Compiling /home/takeshi/tmp/learn/mad/sample/apps/n2o_sample/priv/templates/index.html
escript: exception error: undefined function erlydtl_beam_compiler:is_up_to_date/2
in function erlydtl_compiler:parse_template/2 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 378)
in call from erlydtl_compiler:do_compile/1 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 474)
in call from erlydtl_compiler:compile/1 (/home/takeshi/tmp/learn/mad/sample/deps/erlydtl/src/erlydtl_compiler.erl, line 206)
in call from lists:foreach/2 (lists.erl, line 1336)
in call from mad_compile:dep/4 (/home/takeshi/src/git/mad/src/mad_compile.erl, line 49)
in call from mad_compile:deps/4 (/home/takeshi/src/git/mad/src/mad_compile.erl, line 11)
I can see this is because erlydtl_beam_compiler.beam is not being generated:
takeshi:sample$ find . -name 'erlydtl_beam_compiler.*'
./deps/erlydtl/src/erlydtl_beam_compiler.erl
But if i run make inside folder erlydtl, it gets created:
takeshi:sample$ cd deps/erlydtl/
takeshi:erlydtl$ make
... ABRIDGED ...
takeshi:erlydtl$ cd -
/home/takeshi/tmp/learn/mad/sample
takeshi:sample$ find . -name 'erlydtl_beam_compiler.*'
./deps/erlydtl/src/erlydtl_beam_compiler.erl
./deps/erlydtl/ebin/erlydtl_beam_compiler.beam
After that, I can start the app.
But when I access http://localhost:8000
I get this in the erlang repl:
=ERROR REPORT==== 6-Dec-2014::20:48:56 ===
Error in process <0.97.0> with exit value: {[{reason,undef},{mfa,{n2o_cowboy,init,2}},{stacktrace,[{n2o_cowboy,init,[{http_req,#Port<0.16780>,ranch_tcp,keepalive,<0.97.0>,<<3 bytes>>,'HTTP/1.1',{{127,0,0,1},57061},<<9 bytes>>,undefined,8000,<<1 byte>>,undefined,<<0 bytes>>,[],[{<<4 bytes>>,<<14 bytes>>},{<<10 bytes>>,<<76 bytes>>},{<<6 bytes>>,<<63 bytes>>},{<<15 bytes>>,<<14 bytes>>},{<<15 bytes>>,<<13 bytes>>},{<<6 bytes>>,<<65 bytes>>},{<<10 bytes>>,<<10 bytes>>}],[],waiting,<<0 bytes>>,undefined,false,waiting...
=ERROR REPORT==== 6-Dec-2014::20:48:56 ===
Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.97.0> exit with reason: {[{reason,undef},{mfa,{n2o_cowboy,init,2}},{stacktrace,[{n2o_cowboy,init,[{http_req,#Port<0.16780>,ranch_tcp,keepalive,<0.97.0>,<<"GET">>,'HTTP/1.1',{{127,0,0,1},57061},<<"localhost">>,undefined,8000,<<"/">>,undefined,<<>>,[],[{<<"host">>,<<"localhost:8000">>},{<<"user-agent">>,<<"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8">>},{<<"accept-language">>,<<"en-US,en;q=0.5">>},{<<"accept-encoding">>,<<"gzip, deflate">>},{<<"cookie">>,<<"ga=GA1.1.1057982470.1417221669; n2o-sid=SZCGG+LCc1OhIFziVocJLQ==">>},{<<"connection">>,<<"keep-alive">>}],[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},[]],[]},{cowboy_handler,execute,2,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_handler.erl"},{line,39}]},{cowboy_protocol,execute,4,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_protocol.erl"},{line,428}]}]},{req,[{socket,#Port<0.16780>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.97.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},57061}},{host,<<"localhost">>},{host_info,undefined},{port,8000},{path,<<"/">>},{path_info,undefined},{qs,<<>>},{bindings,[]},{headers,[{<<"host">>,<<"localhost:8000">>},{<<"user-agent">>,<<"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8">>},{<<"accept-language">>,<<"en-US,en;q=0.5">>},{<<"accept-encoding">>,<<"gzip, deflate">>},{<<"cookie">>,<<"_ga=GA1.1.1057982470.1417221669; n2o-sid=SZCGG+LCc1OhIFziVocJLQ==">>},{<<"connection">>,<<"keep-alive">>}]},{meta,[]},{body_state,waiting},{buffer,<<>>},{multipart,undefined},{resp_compress,false},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]},{opts,[]}],[{cowboy_protocol,execute,4,[{file,"/home/takeshi/tmp/learn/mad/sample/deps/cowboy/src/cowboy_protocol.erl"},{line,428}]}]}
Thank you for your work.
I am using the synrc products since few weeks now and i suddenly ran into that problem.
Here is the output on mad compile:
escript: exception error: no function clause matching
mad_dtl:'-compile_erlydtl_files/1-fun-2-'({ok,hta_view}) (/home/chazam/dev/mad/src/compile /mad_dtl.erl, line 58)
Because i have changed the erlydtl tag from 0.8.0 to 0.12.1, i have tried to change the 58th line from
lists:any(fun({error,_}) -> true; (ok) -> false end,[Compile(F) || F <- Files]).
to
lists:any(fun({error,_}) -> true; ({ok,_}) -> false end,[Compile(F) || F <- Files]).
mad goes through the compile process now but fails on repl. Here is the scattered output i get from the console:
[{mad_dtl,'-compile_erlydtl_files/1-fun-2-',[ok],[{file,"/home/chazam/dev/mad/src/compile/mad_dtl.erl"},{line,58}]},{lists,any,2,[{file,"lists.erl"},{line,1225}]},{mad_compile,dep,4,[{file,"/home/chazam/dev/mad/src/compile/mad_compile.erl"},{line,69}]}, {mad_compile,deps,4,[{file,"/home/chazam/dev/mad/src/compile/mad_compile.erl"},
{line,20}]},{active,compile,2,
[{file,"/tmp/hm_web/deps/active/src/active.erl"},{line,92}]},
{active,handle_cast,2,[{file,"/tmp/hm_web/deps/active/src/active.erl"},{line,17}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,601}]},
Catch: error:function_clause {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,667}]}]
https://gist.github.com/m-2k/64c927d29d336cf6d0ed
Initializing EMBED.FS:escript: exception error: no match of right hand side value {error,enoent}
in function mad_ling:embed_fs/2 (/Users/5HT/depot/synrc/mad/src/mad_ling.erl, line 71)
in call from mad_ling:add_apps/0 (/Users/5HT/depot/synrc/mad/src/mad_ling.erl, line 61)
in call from mad_ling:main/1 (/Users/5HT/depot/synrc/mad/src/mad_ling.erl, line 16)
in call from lists:foldl/3 (lists.erl, line 1261)
in call from mad:main/1 (/Users/5HT/depot/synrc/mad/src/mad.erl, line 22)
in call from escript:run/2 (escript.erl, line 752)
in call from escript:start/1 (escript.erl, line 276)
in call from init:start_it/1
For example, consider the following repository: https://github.com/basho/riak-erlang-client
$ mad deps compile
will give
~/riak-erlang-client/src/riakc_flag.erl:32: behaviour riakc_datatype undefined
Anyway to fix this?
Those files also should be included: *.o, *.so
Here's a sample that shows examples of them:
https://github.com/rebar/rebar/blob/master/rebar.config.sample
Experimenting with n2o. Had some emacs leftover files. Made mad abort with error below. Is there a way to make mad ignore these?
escript: exception error: no function clause matching mad_compile:module("erl#") (/Users/5HT/synrc/mad/src/mad_compile.erl, line 56)
in function mad_compile:'-compile_fun/3-fun-0-'/4 (/Users/5HT/synrc/mad/src/mad_compile.erl, line 54)
in call from lists:foreach/2 (lists.erl, line 1336)
in call from mad_compile:dep/4 (/Users/5HT/synrc/mad/src/mad_compile.erl, line 45)
in call from mad_compile:deps/4 (/Users/5HT/synrc/mad/src/mad_compile.erl, line 11)
in call from lists:foreach/2 (lists.erl, line 1336)
The example in README.md is not working.
From Git blame, it appears the commit e8b7d58 for adding kjell support is to blame.
$ make
$ mad app "sample"
$ ./mad app "sample"
$ cd sample/
$ ../mad deps compile plan bundle "web_app"
$ ./web_app
escript: exception error: undefined function mad_repl:main/1
in function escript:run/2 (escript.erl, line 752)
in call from escript:start/1 (escript.erl, line 276)
in call from init:start_it/1
in call from init:start_em/1
I tried with Erlang/OTP 17.4
$ erl --version
Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.3 (abort with ^G)
1>
./mad cle
removes full ebin
directory (with .app
file)
in ./mad rep
mode
rebar.config:
{deps,
[{brod, ".*", {git, "git://github.com/klarna/brod.git", {tag, "3.7.5"}}}]}.
dep/com log:
~/xient% mad dep
==> dependency: "git://github.com/klarna/brod.git" tag: {tag,"3.7.5"}
==> dependency: "https://github.com/klarna/supervisor3.git" tag: {tag,"1.1.8"}
==> dependency: "https://github.com/klarna/kafka_protocol.git" tag: {tag,
"2.2.7"}
==> dependency: "https://github.com/zmstone/snappyer" tag: {tag,"1.2.4"}
==> dependency: "https://github.com/zmstone/crc32cer" tag: {tag,"0.1.3"}
~/xient% mad com
==> "brod"
==> "supervisor3"
==> "kafka_protocol"
==> "snappyer"
==> "crc32cer"
Line 24: warning {undefined_behaviour,brod_group_member} in "/deps/brod/src/brod_cg_commits.erl"
Line 840: warning {unused_var,'State'} in "/deps/brod/src/brod_group_coordinator.erl"
==> "/Users/proger/xient"
OK
The nif had to be compiled manually:
~/xient% (cd deps/crc32cer/; mad com)
DEPEND crc32cer.d
C crc32c.c
C crc32c_nif.c
LD crc32cer.so
==> "/Users/proger/xient/deps/crc32cer"
OK
Observed on c0fc30.
Just Do It
vm.args ignored for ./mad rep
, ./application start
etc
5ht, plz
nifs inside a dependency are not compiled.
I have all applications my project depends on, in apps
directory. So I keep all libs in freeze. I have to specify in rebar.config
every single sub dir to get it working:
{lib_dirs,["apps"]}.
{sub_dirs,["apps/cowlib","apps/cowboy","apps/ranch","apps/gproc","apps/kvs","apps/jsone","apps/nitro","apps/gen_smtp","apps/n2o",
"apps/sh","apps/mad","apps/fs","apps/active", "apps/svg"]}.
Can this be avoided?
Old mad:
1> mad_repl:load_file(".applist").
{ok,<<"[kernel,stdlib,fs,ranch,asn1,cryp...
New mad:
1> mad_repl:load_file(".applist").
{error,etsfs}
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.