synrc / n2o

⭕ N2O: Distributed WebSocket Application Server ISO 20922
https://ws.n2o.dev
Other
1.34k stars 168 forks source link

Samples are not supported on Windows #131

Closed aseidlitz closed 10 years ago

aseidlitz commented 10 years ago

The documentation should probably be updated to warn users that samples don't build on Windows due to unsupported dependencies (fs, sh)

5HT commented 10 years ago

we have problems now. just remove ative, fs and sh and it will helps.

aseidlitz commented 10 years ago

Thanks, works like a charm! I had to remove 'mad' as well as it also depends on 'sh'.

5HT commented 10 years ago

But it's not fixed. We need to fix sh and fs compilation under Windows anyway. Thanks for reporting this bug. I reopen it.

aseidlitz commented 10 years ago

Cool! I was able to build fs after re-enabling win32 support in fs_sup.erl and using inotifywait port as a backend (from https://github.com/thekid/inotify-win). Haven't had a chance to actually try if it works yet.

AstRonin commented 9 years ago

I have same problem with dependency 'sh' when I try run sample on Windows. Erlang/OTP 18.1 I use command from documentation mad deps compile plan repl

==> dependency: "git://github.com/synrc/nitro" tag: {tag,"0.9"}
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/synrc/nitro deps/nitro && cd deps/nitro && git checkout \"0.9\""]},
                          {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)
5HT commented 9 years ago

Just make sure you have /bin/sh executable in your MinGW environment.

AstRonin commented 9 years ago

Please, help me :) I installed MinGW with MSYS. Now I can run 'sh' from command line, but error doesn't disappeared. What I should write more for fix error?

5HT commented 9 years ago

In MinGW shell type in pwd where sh is placed:

$ mkdir -p /bin
$ cp sh /bin/sh
AstRonin commented 9 years ago

done Maybe I some don't understand... I have: C:\msys\1.0\bin\sh C:\msys\1.0\bin\sh.exe and in C:\msys\1.0\bin\bin the same just in case in command line (and msys cmd too) I can run 'sh' but cannot run any variation of bin/sh... mad.bat repeats error...

5HT commented 9 years ago

Definitely you don't understand what you are doing. This is a windows path C:\msys\1.0\bin\sh. Cygwin and MSYS have mount-point of root filesystem. You should ensure that in root folder there is bin folder and sh inside. Just go into cd / and type pwd and ls.

AstRonin commented 9 years ago

Yes, this is it

$ which sh
/bin/sh
5HT commented 9 years ago

Your erlang has another opinion:

escript: exception error: enoent
 called as open_port({spawn_executable,"/bin/sh"},
5HT commented 9 years ago

Just took a Windows machine and everything goes perfect:

Configuration: [{n2o,[{port,8000},
                      {app,review},
                      {upload,"./apps/review/priv/static/"},
                      {search,"/Users/5HT/depot/synrc/synrc.com/apps/*/doc/web/*.htm"},
                      {route,routes},
                      {mq,n2o_mq},
                      {formatter,bert},
                      {log_modules,config},
                      {log_level,config},
                      {log_backend,n2o_log},
                      {session,n2o_session},
                      {origin,<<"*">>},
                      {bridge,n2o_cowboy},
                      {pickler,n2o_pickle},
                      {erroring,n2o_error},
                      {event,pickle}]},
                {kvs,[{dba,store_mnesia},
                      {schema,[kvs_user,kvs_acl,kvs_feed,kvs_subscription]}]}]

Applications: [kernel,stdlib,fs,ranch,crypto,compiler,syntax_tools,mnesia,
               inets,gproc,kvs,cowlib,cowboy,n2o,review,active,erlydtl,jsone,
               mad,nitro,rest,sh]

Eshell V6.2  (abort with ^G)
1> ==> "samples"
1> ==> "c:/msys64/home/Maxim/n2o/samples"
1> ==> "erlydtl"
1> ==> "nitro"
1> ==> "mad"
1> ==> "sh"
1> ==> "fs"
1> ==> "active"
1> ==> "rest"
1> ==> "n2o"
1> ==> "jsone"
1> ==> "cowboy"
1> ==> "cowlib"
1> ==> "ranch"
1> ==> "gproc"
1> ==> "kvs"
1> ==> "c:/msys64/home/Maxim/n2o/samples/apps"
1> ==> "c:/msys64/home/Maxim/n2o/samples/apps/review"
1> Cookie: "document.cookie='site-sid=05198ed85a182a16769fb97359e457fc; path=/; expires=Wed, 17-Nov-2083 16:14:01 GMT';"
1> 
5HT commented 9 years ago

Just make C:\bin\sh.exe

AstRonin commented 9 years ago

Thanks, it works :)