Giter VIP home page Giter VIP logo

mad's Introduction

MAD: Manage Dependencies

Actions Status Build Status Hex pm

A simple rebar-compatible dependency manager and developer tool with plugins for Windows, Linux and Mac.

MAD

Goals

It shall:

  • be compatible with rebar configuration.
  • be as small and fast as possible.

Features

  • Support rebar.config
  • Support OTP releases and directory structure
  • Fast deps resolving and cycles detecting
  • Fast compilation
  • Small codebase: 1K LOC
  • DTL/YECC/LEEX/PORT/SCRIPT/APP/ERL compilation
  • BEAM bundles (single-file escriptized app)
  • BEAM releases (faster and smaller than RELX)
  • Start/Stop/Attach
  • Static files generation with node.js tools

Build

    $ make

And put mad to PATH.

Building OTP Release

Releases are bundles made by release_handler module of sasl applications. It has it own fat bootstripts along with erlang runtime included. This allows you to distribute you applications with copy deploy without Erlang prerequisite.

    $ ./mad app web sample
    $ cd sample
    $ ../mad dep com pla rel

Documentation

If you are new or need to determine whether the MAD architecture and philosophy is a fit for your project

  • Official MAD brochure PDF

Credits

  • Maxim Sokhatsky
  • Sina Samavati
  • Vladimir Kirillov
  • Taras Taraskin

mad's People

Contributors

221v avatar 5ht avatar artemeff avatar arun-babu avatar cystbear avatar dmitryklerik avatar doxtop avatar fxmy avatar homeway avatar kianmeng avatar m-2k avatar mihawk avatar mipaaa avatar mkshar avatar mudyc avatar pal-alex avatar proger avatar rgrinberg avatar rilian avatar seb3s avatar sinasamavati avatar sokal32 avatar sudodoki avatar thecynicalpaul avatar uaduke avatar xafizoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mad's Issues

Problems trying to build and run sample app

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}]}]}

Make on Windows fails

Local Configuration:

  • OS: Windows 10 64 bit
  • OTP 21.2
  • Rebar3

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.

Deps versions inaccuracy

/deps/*/rebar.config has priority over /rebar.config

example:

  1. write to root rebar.config dependence on n2o 2.1
  2. include avz (dependence n2o 1.10)
  3. compile
  4. mad choice n2o 1.10
    .

BUNDLE: fs bug

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}

Wrong encoding when reading file from bundle

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.

can compile with mad, but when loading the new n2o_sample, got an error from http cowboy

=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
4TQtKI58wQW9e2QZS0kSUF0W6vUJmIzmxSiq1hMviJP45LMxhHe8g
55fca0bebc6f2b7dab238d51a82ee8a0af7480dfed3c80d76876d7f028875cc2*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}]}]}

Error on mac os.

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

vm.args Request

Just Do It
vm.args ignored for ./mad rep, ./application start etc
5ht, plz

mad up error

./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

No way to set node name with mad

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

mad fails to get dependencies in windows

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)

mad fails to sync code on the fly in windows

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.

In the README.md, the example for building OTP Release needs clarification.

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.

.erl#-Emacs backup files made mad_compilefiles fail

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)

make failed: deps/ling/bc/*.erl: no such file or directory

:~/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

mad lin error

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 

embedded mode

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?

mad does not run pre_hooks from dependencies

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.

Feature request bundle beam emulator

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.

The example in README.md is not working

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 fails to compile

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.

Discover applications in lib_dirs

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?

Implement stop command

Currently, we have this:

$ mad stop
ERROR
Not Implemented.

It would be nice to have such functionality.

fail to compile dtl

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}]}]

Repl in mad in windows doesn't accept any input apart from Ctrl+C.

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.

Spaces in path names cause errors

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

autorecompile in shell mode fails on `.xrl` , `.yrl` files

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.