vibe-d / vibe.d Goto Github PK
View Code? Open in Web Editor NEWOfficial vibe.d development
License: MIT License
Official vibe.d development
License: MIT License
Diet template currently has layout/extends support, and that's one of the two directions diet template relations. The other is template inclusion. Issue #32 addresses this.
My proposal is to support embeded template support, which I call a diet function
def css(filename)
link(rel="stylesheet", type="text/css", href="/css/#{filename}.css")
Then in the same diet template, we could call this diet function
block head append
call css("bootstrap")
And this would have the same effect with:
block head append
link(rel="stylesheet", type="text/css", href="/css/bootstrap.css")
In this way user can declare their own functions to alleviate template writing.
we can call a diet function defined in another diet template:
call another_template.css("bootstrap")
In child templates, we can call diet functions defined in its parent with
call super.css("bootstrap")
if we call the render
function, then it's then same as including another template
call another_template.render(args...)
same as
call another_template(args...)
In conclusion, diet function introduces three keywords: def
, call
, super
, and its functionality would be a super set of simple template inclusion mechanizm. With diet functions, it's easy for a developer to define his own set of utility functions, and call them where ever they want.
The syntax is not important, in Play!framework (a web framework in Scala), they use @
symbol to do both def
and call
, and even evaluation
e.g.
definition
@hello(name: String) {
<p>Hello @name </p>
}
calling
...
@hello("david")
...
calling another template's function
...
@another_template.hello("david")
...
Every Play template is a class. So they are just another way to define and call methods.
P.S. I took a look at diet template's code, and there are a bunch of d templates and CTFE code, which is beyond my ability (I'm a D newbie). Can you explain how Diet template is designed? maybe in a blog if you have time. When I'm much better at D coding, I will try to help :) I really am wishing vibe.d goes successful.
I imagined that a diet template is compiled into a class, with a render method. And layout extends are implemented by subclasses, whose render method calls super's render method. template inclusion would be implemented by calling render method in another template's class. Is this comprehension correct ?
Using the "Example of a simple HTTP server" example from the vibe.d homepage, and compiling (Win, DMD 2.059) with this:
>rdmd -I[path-to-vibe.d]\source [path-to-vibe.d]\lib\win-i386\event2.lib [path-to-vibe.d]\vibe.d\lib\win-i386\eay.lib [path-to-vibe.d]\lib\win-i386\ssl.lib app.d
I get this:
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-app.d-3A45E6B90D932E97B6FB3AF37F8FC3CE\app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE.obj(app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE)
Error 42: Symbol Undefined _setsockopt@20
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-app.d-3A45E6B90D932E97B6FB3AF37F8FC3CE\app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE.obj(app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE)
Error 42: Symbol Undefined _WSAStartup@8
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-app.d-3A45E6B90D932E97B6FB3AF37F8FC3CE\app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE.obj(app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE)
Error 42: Symbol Undefined _shutdown@8
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-app.d-3A45E6B90D932E97B6FB3AF37F8FC3CE\app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE.obj(app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE)
Error 42: Symbol Undefined _socket@12
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-app.d-3A45E6B90D932E97B6FB3AF37F8FC3CE\app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE.obj(app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE)
Error 42: Symbol Undefined _accept@12
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-app.d-3A45E6B90D932E97B6FB3AF37F8FC3CE\app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE.obj(app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE)
Error 42: Symbol Undefined _bind@12
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-app.d-3A45E6B90D932E97B6FB3AF37F8FC3CE\app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE.obj(app-d-3A45E6B90D932E97B6FB3AF37F8FC3CE)
Error 42: Symbol Undefined _listen@8
--- errorlevel 7
For page not found, exception is set to null. Would it make more sense if this would be set as some HttpException?
I actually think HttpServerErrorInfo could be an exception: HttpException, containing the http errorcode and exception chaining. That way, you could throw HttpException with regular http codes from you code, and handle them in the same way in the errorhandler. Of course.. This could be done using injectors, but it would be nice to have all error handling in the same place.
When a connection hasn't been used in a while, this message appears:
[7F3C31AC6F00:7F3C31ACAC80 WRN] Handling of connection failed: Operating on closed TCPConnection.
Is this really a warning? What is vibe trying to do here?
All parameters to vibe is sent to the application, and there's no way to send parameters to rdmd.
See 0909d39#commitcomment-1277583
First trying Ctrl-C, then TERM:
^C[7F2BA5523F00:00000000 INF] Received signal 2. Shutting down.
[7F2BA5523F00:00000000 INF] Received signal 15. Shutting down.
Using vibe and dmd trunk on linux64 (kubuntu)
Trying to close a TcpConnection from another fiber than created is throws an error. This makes caching TcpConnections hard as I have no way of closing them when the application shuts down.
TcpConnection[Fiber] connections;
static ~this() {
foreach(fiber, cn; connections)
cn.close(); // owned by a different fiber
}
use the
li: a(href="/") home
syntax
I don't know who's reading the forums, so I'll crosspost here.
http://news.rejectedsoftware.com/thread/op.we5x1fmxx8p62v@simendsjo-desktop
Includes a crude prototype.
The following code does not compile:
Bson myBson = ...; //Something valid
auto varBson = Variant(myBson); // Throws error
/usr/include/d/std/variant.d(385): Error: cannot implicitly convert expression ((*zis).opDispatch()) of type Bson to string
/usr/include/d/std/variant.d(543): Error: template instance std.variant.VariantN!(32LU).VariantN.handler!(Bson) error instantiating
/usr/include/d/std/variant.d(493): instantiated from here: opAssign!(Bson)
Does VPM even exist yet? I haven't seen reference to it anywhere else.
Not sure if this has been addressed already, but the homepage should be made public on github so we can create pull requests
ab -n 10000 -c 1000 http://127.0.0.1:8080/ <=== _OK_ (localhost)
ab -n 10000 -c 1000 http://192.168.2.3:8080/ <=== _EXCEPTION!!!_
_Nginx reverse proxy:
ab -n 10000 -c 1000 http://192.168.2.3/ <=== _EXCEPTION!!!
ab -n 10000 -c 1000 http://127.0.0.1/ <=== _EXCEPTION!!!_
No problem with node.js, tornado or g-wan.
root@ubuntu:/home/ubuntu12/vibe.d/bin# ./run_example.sh simplehttp
[B71F3F80:00000000 WRN] Failed to parse config file /etc/vibe/vibe.conf: /etc/vibe/vibe.conf: No such file or directory
[B71F3F80:00000000 INF] Listening on 0.0.0.0 port 8080 succeeded
[B71F3F80:00000000 ERR] Error binding listening socket
[B71F3F80:00000000 INF] Listening on :: port 8080 failed
[B71F3F80:00000000 INF] Running event loop...
[B71F3F80:00000000 trc] accept
[B71F3F80:00000000 trc] accepted 10
[B71F3F80:00000000 dbg] Creating new fiber...
[B71F3F80:00000000 dbg] initial task call
[B71F3F80:B71F8C80 trc] entering task.
[B71F3F80:B71F8C80 dbg] start task (fd 10).
[B71F3F80:B71F8C80 trc] reading request..
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] yield
[B71F3F80:00000000 dbg] run task out
[B71F3F80:00000000 trc] accept
[B71F3F80:00000000 trc] accepted -1
[B71F3F80:00000000 trc] handled incoming connections...
[B71F3F80:00000000 trc] socket 10 write event (false)!
[B71F3F80:B71F8C80 trc] resume
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] yield
[B71F3F80:00000000 trc] socket 10 read event!
[B71F3F80:B71F8C80 trc] resume
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (14)
[B71F3F80:B71F8C80 trc] req: GET / HTTP/1.1
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (24)
[B71F3F80:B71F8C80 trc] hdr: Host: 192.168.1.3:8080
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (22)
[B71F3F80:B71F8C80 trc] hdr: Connection: keep-alive
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (114)
[B71F3F80:B71F8C80 trc] hdr: User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (71)
[B71F3F80:B71F8C80 trc] hdr: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (34)
[B71F3F80:B71F8C80 trc] hdr: Accept-Encoding: gzip,deflate,sdch
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (31)
[B71F3F80:B71F8C80 trc] hdr: Accept-Language: en-US,en;q=0.8
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (46)
[B71F3F80:B71F8C80 trc] hdr: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (0)
[B71F3F80:B71F8C80 trc] Got request header.
[B71F3F80:B71F8C80 trc] handle request (body 0)
[B71F3F80:B71F8C80 trc] evbuffer_add (fd 10): 140 B
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] evbuffer_add (fd 10): 13 B
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] reading request..
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] yield
[B71F3F80:00000000 trc] socket 10 write event (false)!
[B71F3F80:B71F8C80 trc] resume
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] yield
[B71F3F80:00000000 dbg] Socket event on fd 10: 65
[B71F3F80:00000000 dbg] Remote host on fd 10 timed out.
[B71F3F80:00000000 trc] resuming corresponding task...
[B71F3F80:B71F8C80 trc] resume
[B71F3F80:B71F8C80 dbg] Exception while parsing request: object.Exception@../source/vibe/core/drivers/libevent2_tcp.d(287): Operating on closed TCPConnection.
----------------
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(pure @safe bool std.exception.enforce!(bool, "../source/vibe/core/drivers/libevent2_tcp.d", 287).enforce(bool, lazy const(char)[])+0x2f) [0x80fb1fb]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(ubyte[] vibe.core.drivers.libevent2_tcp.Libevent2TcpConnection.readLine(uint, immutable(char)[])+0xaf) [0x80fa4e3]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(ubyte[] vibe.stream.stream.LimitedInputStream.readLine(uint, immutable(char)[])+0x69) [0x80e13a5]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(vibe.http.server.HttpServerRequest vibe.http.server.parseRequest(vibe.core.driver.TcpConnection)+0x5a) [0x80feb2a]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.http.server.handleHttpConnection(vibe.core.driver.TcpConnection, vibe.http.server.HTTPServerListener)+0x2a8) [0x80fdd08]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.http.server.listenHttpPlain(vibe.http.server.HttpServerSettings, void delegate(vibe.http.server.HttpServerRequest, vibe.http.server.HttpServerResponse)).void __lambda17(vibe.core.driver.TcpConnection)+0x27) [0x80fc7e3]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(extern (C) void vibe.core.drivers.libevent2_tcp.onConnect(int, short, void*).void delegate() client_task(vibe.core.drivers.libevent2_tcp.TcpContext*, vibe.core.drivers.libevent2_tcp.TcpContext*).void __lambda16()+0x8f) [0x80fadb7]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.core.core.defaultFiberFunc()+0x70) [0x80e3154]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void core.thread.Fiber.run()+0x19) [0x8146b39]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(fiber_entryPoint+0x49) [0x8146ad9]
[(nil)]
[B71F3F80:B71F8C80 WRN] Handling of connection failed: Operating on closed TCPConnection.
[B71F3F80:B71F8C80 dbg] object.Exception@../source/vibe/core/drivers/libevent2_tcp.d(287): Operating on closed TCPConnection.
----------------
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(pure @safe bool std.exception.enforce!(bool, "../source/vibe/core/drivers/libevent2_tcp.d", 287).enforce(bool, lazy const(char)[])+0x2f) [0x80fb1fb]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.core.drivers.libevent2_tcp.Libevent2TcpConnection.write(const(ubyte[]), bool)+0x43) [0x80fa71f]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.stream.stream.OutputStream.write(const(char[]), bool)+0x3f) [0x80e0ebf]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.http.server.HttpServerResponse.writeHeader()+0x128) [0x80fd7b0]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(@property vibe.stream.stream.OutputStream vibe.http.server.HttpServerResponse.bodyWriter()+0x1d3) [0x80fd0e3]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.http.server.handleHttpConnection(vibe.core.driver.TcpConnection, vibe.http.server.HTTPServerListener).void errorOut(int, immutable(char)[], immutable(char)[])+0x148) [0x80fea68]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.http.server.handleHttpConnection(vibe.core.driver.TcpConnection, vibe.http.server.HTTPServerListener)+0xddc) [0x80fe83c]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.http.server.listenHttpPlain(vibe.http.server.HttpServerSettings, void delegate(vibe.http.server.HttpServerRequest, vibe.http.server.HttpServerResponse)).void __lambda17(vibe.core.driver.TcpConnection)+0x27) [0x80fc7e3]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(extern (C) void vibe.core.drivers.libevent2_tcp.onConnect(int, short, void*).void delegate() client_task(vibe.core.drivers.libevent2_tcp.TcpContext*, vibe.core.drivers.libevent2_tcp.TcpContext*).void __lambda16()+0x8f) [0x80fadb7]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void vibe.core.core.defaultFiberFunc()+0x70) [0x80e3154]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(void core.thread.Fiber.run()+0x19) [0x8146b39]
/tmp/.rdmd-0/home/ubuntu12/vibe.d/bin/../source/examples/simplehttp.d.52821A90AD271535875DEF3D72F9A9E9(fiber_entryPoint+0x49) [0x8146ad9]
[(nil)]
[B71F3F80:B71F8C80 dbg] task finished.
[B71F3F80:B71F8C80 trc] exiting task.
[B71F3F80:B71F8C80 trc] yield
[B71F3F80:00000000 trc] accept
[B71F3F80:00000000 trc] accepted 10
[B71F3F80:00000000 dbg] initial task call
[B71F3F80:B71F8C80 trc] resume
[B71F3F80:B71F8C80 trc] entering task.
[B71F3F80:B71F8C80 dbg] start task (fd 10).
[B71F3F80:B71F8C80 trc] reading request..
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] yield
[B71F3F80:00000000 dbg] run task out
[B71F3F80:00000000 trc] accept
[B71F3F80:00000000 trc] accepted -1
[B71F3F80:00000000 trc] handled incoming connections...
[B71F3F80:00000000 trc] socket 10 read event!
[B71F3F80:B71F8C80 trc] resume
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (25)
[B71F3F80:B71F8C80 trc] req: GET /favicon.ico HTTP/1.1
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (24)
[B71F3F80:B71F8C80 trc] hdr: Host: 192.168.1.3:8080
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (22)
[B71F3F80:B71F8C80 trc] hdr: Connection: keep-alive
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (11)
[B71F3F80:B71F8C80 trc] hdr: Accept: */*
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (114)
[B71F3F80:B71F8C80 trc] hdr: User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (34)
[B71F3F80:B71F8C80 trc] hdr: Accept-Encoding: gzip,deflate,sdch
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (31)
[B71F3F80:B71F8C80 trc] hdr: Accept-Language: en-US,en;q=0.8
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (46)
[B71F3F80:B71F8C80 trc] hdr: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] TCPConnection.readline return data (0)
[B71F3F80:B71F8C80 trc] Got request header.
[B71F3F80:B71F8C80 trc] handle request (body 0)
[B71F3F80:B71F8C80 trc] evbuffer_add (fd 10): 140 B
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] evbuffer_add (fd 10): 13 B
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] bufferevent_flush
[B71F3F80:B71F8C80 trc] reading request..
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] yield
[B71F3F80:00000000 trc] socket 10 write event (false)!
[B71F3F80:B71F8C80 trc] resume
[B71F3F80:B71F8C80 trc] evbuffer_readln (fd 10)
[B71F3F80:B71F8C80 trc] yield
I get a segfault while compiling a diet template:
Compiling diet template 'user.details.dt'...
Segmentation fault
bin/vibe now creates an executable called vpm. Trying to run this directly in order to debug is a little unintuitive.. I can make it check for modules, but not run the application. Any tips on how I can debug this?
vibe.d master (cloned from github)
ubuntu 12.04 64bit
getting this when starting vibe:
tomek@tomek-U36SD:~/d_apps/hellovibe$ vibe
[7FE56073AF00:00000000 INF] Updating application in '/home/tomek/d_apps/hellovibe'
[7FE56073AF00:00000000 WRN] There was no 'package.json' found for the application in '/home/tomek/d_apps/hellovibe'.
[7FE56073AF00:00000000 INF] You are up to date
object.Exception@/opt/vibe.d/bin/../source/vibe/core/drivers/threadedfile.d(79): Failed to open 'deps.txt' for reading.
----------------
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(vibe.core.driver.FileStream vibe.core.drivers.libevent2.Libevent2Driver.openFile(immutable(char)[], vibe.core.driver.FileMode)+0x6a) [0x51cfe2]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(vibe.core.driver.FileStream vibe.core.file.openFile(immutable(char)[], vibe.core.driver.FileMode)+0x31) [0x505e89]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(void vibe.vpm.vpm.Vpm.createDepsTxt()+0x89) [0x50e9ed]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(void vpm._staticCtor1()+0x160) [0x4b9ec0]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(void vpm.__modctor()+0x9) [0x4e1d81]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(extern (C) void rt.minfo.rt_moduleTlsCtor().void runModuleFuncs!(rt_moduleTlsCtor11__lambda232).runModuleFuncs(object.ModuleInfo*[])+0x3c) [0x537734]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(rt_moduleTlsCtor+0x18) [0x53701c]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(extern (C) int rt.dmain2.main(int, char**).void runAll()+0x1d) [0x532b45]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x23) [0x532497]
/tmp/.rdmd-1000/opt/vibe.d/bin/vpm.d.05B4E9898F0B6D9B495DEE2FFE14FE71(main+0xd3) [0x53242f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fe55f11076d]
----------------
Compiling diet template 'index.dt'...
Compiling diet template 'show.dt'...
Compiling diet template 'index.dt'...
Compiling diet template 'show.dt'...
[7FA01BB12F00:00000000 WRN] Failed to parse config file /etc/vibe/vibe.conf: /etc/vibe/vibe.conf: No such file or directory
[7FA01BB12F00:00000000 INF] Listening on 0.0.0.0 port 8080 succeeded
[7FA01BB12F00:00000000 ERR] Error binding listening socket
[7FA01BB12F00:00000000 INF] Listening on :: port 8080 failed
[7FA01BB12F00:00000000 INF] Running event loop...
While the application seems to work, two weird issues creep out:
<!DOCTYPE html>
<html></html>
<div>head</div>
<div>title Example page</div>
<div>body</div>
<div>block body</div>
instead of, well, "Example page" being in the title tag etc.
void show(HttpServerRequest req, HttpServerResponse res)
{
auto output = res.bodyWriter();
parseDietFile!("show.dt", req)(output);
}
Were the Deimos headers for OpenSSL/libevent/libev [1] not used on purpose, e.g. in order to avoid an external dependency or because they were buggy, or were they just not available when you needed them?
The main reason why I'm asking is that HtoD-generated bindings usually contain a few inaccuracies, e.g. C long
being translated to D long
, which of course fails on x86_64/LP64.
[1] The former two of which I happen to have contributed, but that's not the point here. ;)
I have some (old) code to parse and format http headers. It uses the ragel (http://www.complang.org/ragel/) parser generator to generate the parsers.
I originally wanted to post this for inclusion into phobos, however Andrei made it pretty clear that he doesn't want code in phobos which depends on external tools. So I currently have no real use for this code, if it's useful for vibe.d I'd be happy to contribute it.
Source code:
https://gist.github.com/2516504#file_http.rl.d
Compilable source code (generated by ragel, compile with deprecated code enabled)
https://gist.github.com/2516504#file_http.d
Documentation:
http://dl.dropbox.com/u/24218791/d/src/http.html
(the interesting part is canParseHeader
, isHeader
, canFormatHeader
, formatHeader
, formatHeaderValue
, parseHeader
, parseHeaderValue
)
Some refactoring is probably necessary, but I first want to know if there's some interest in this code.
It tries to bind to the same port twice..?
[7FA48783CF00:00000000 WRN] Failed to parse config file /etc/vibe/vibe.conf: /etc/vibe/vibe.conf: No such file or directory
[7FA48783CF00:00000000 INF] Listening on 0.0.0.0 port 8080 succeeded
[7FA48783CF00:00000000 ERR] Error binding listening socket
[7FA48783CF00:00000000 INF] Listening on :: port 8080 failed
[7FA48783CF00:00000000 INF] Running event loop...
I was doing some testing and forgot to start the mongo db on my local machine, rather than getting a useful message, I was presented with an error something along the lines of "socket error 33". This is very unhelpful.
If I get around to it, I will add something to the mongo code to check the connection, but "socket error 33" is not a helpful diagnostic.
It just hangs. I was able to connect before the library was integrated to vibe, so I guess the problem might be there.
I don't know vibe yet - anything in particular you want me to investigate?
writeln("connecting");
auto cn = new Connection("localhost", "user", "password", "vibetest");
writeln("connected");
(gdb) r
Starting program: /home/simendsjo/code/tmp/vibetest/app
[Thread debugging using libthread_db enabled]
[7FFFF7EC8F00:00000000 WRN] Failed to parse config file /etc/vibe/vibe.conf: /etc/vibe/vibe.conf: No such file or directory
[7FFFF7EC8F00:00000000 INF] Listening on 0.0.0.0 port 8080 succeeded
[7FFFF7EC8F00:00000000 ERR] Error binding listening socket
[7FFFF7EC8F00:00000000 INF] Listening on :: port 8080 failed
[7FFFF7EC8F00:00000000 INF] Running event loop...
connecting
^C
Program received signal SIGINT, Interrupt.
0x00007ffff6a29bd3 in __epoll_wait_nocancel () at ../sysdeps/unix/syscall-template.S:82
82 ../sysdeps/unix/syscall-template.S: No such file or directory.
in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0 0x00007ffff6a29bd3 in __epoll_wait_nocancel () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007ffff7bb98e7 in ?? () from /usr/lib/libevent-2.0.so.5
#2 0x00007ffff7ba4c44 in event_base_loop () from /usr/lib/libevent-2.0.so.5
#3 0x00000000004e9952 in vibe.core.drivers.libevent2.Libevent2Driver.runEventLoop() (this=0x7ffff7ecafc0)
at ../../vibe/vibe.d/bin/../source/vibe/core/drivers/libevent2.d:57
#4 0x00000000004ce530 in vibe.core.core.start() () at ../../vibe/vibe.d/bin/../source/vibe/core/core.d:42
#5 0x00000000004fbf64 in D main (args=...) at ../../vibe/vibe.d/bin/../source/vibe/appmain.d:38
#6 0x0000000000557b73 in rt.dmain2.main() ()
#7 0x0000000000822010 in ?? ()
#8 0x00007ffff7ecaf00 in ?? ()
#9 0x00007fffffffdf50 in ?? ()
#10 0x00007fffffffde20 in ?? ()
#11 0x00000000005574f3 in rt.dmain2.main() ()
#12 0x0000000000000001 in ?? ()
#13 0x0000000000000025 in ?? ()
#14 0x0000000000822020 in ?? ()
#15 0x00007fffffffdf50 in ?? ()
#16 0x00007fffffffdc60 in ?? ()
#17 0x0000000000000000 in ?? ()
I can't find a way to write <script>
javascript code in diet template, they all seem to be escaped somehow.
Scalate (Jade with Scala) supports <script>
javascript code by a :javascript
filter, as shown in this page
http://scalate.fusesource.org/documentation/jade.html
:javascript if (foo) { bar() }
Will that be supported soon? or else how can I write javascript code in the templates?
When trying to urlEncode a perfectly reasonable string containing newlines (%0a), they are encoded as %a which is incorrect and isn't properly parsed by other clients.
This is also affecting tabs. Other non-printables are probably unlikely to be used in URL encoding.
In my case I was trying to encode a multi-line string to place in a fragment for a link to translate.google.com. When properly encoded it happily accepts these strings.
I suppose the problem is here:
https://github.com/rejectedsoftware/vibe.d/blob/c8a03f93639ada7a307ea7dd3db0db909275a646/source/vibe/textfilter/urlencode.d#L44
-[Unknown]
If I fetch some rows from a database in a handler, the site slows to a crawl as all requests are blocked while fetching and processing the rows. How am I supposed to write code like this without blocking all requests?
void somepage(...)
{
foreach(row; db.getRows())
process();
render!(page);
}
I tried running a couple of concurrent requests using ab
, and it sometimes fails.
The line that breaks is this one: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/drivers/libevent2_tcp.d#L360
assert(client_ctx) fails after connectionCallback() is called in the line above.
Hi everyone!
I just tested vibe.d vs nodejs and got pity results...
I wrote (Ctrl+C) two simples apps:
(Vibe.d)
void handleRequest(HttpServerRequest req, HttpServerResponse res)
{ res.writeBody(cast(ubyte[])"Hello, World!", "text/plain");}
static this()
{ setLogLevel(LogLevel.Trace);
auto settings = new HttpServerSettings;
settings.port = 8080;
listenHttp(settings, &handleRequest);}
And nodejs
var sys = require('sys'),
http = require('http');
http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('
Hello World
');Results(nodejs):
Concurrency Level: 1000
Time taken for tests: 16.212 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 8100000 bytes
HTML transferred: 1800000 bytes
Requests per second: 6168.42 #/sec
Time per request: 162.116 ms
Time per request: 0.162 [ms](mean, across all concurrent requests)
Transfer rate: 487.93 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 97 640.7 0 9028
Processing: 0 23 50.2 20 9831
Waiting: 0 22 50.2 20 9831
Total: 1 120 648.4 21 9831
I understand that vibe is very young project , but my I did something wrong?
Why is 'index.dt' compiled twice?
$ ./vibe
[7F909F498F00:00000000 INF] Updating application in '/home/simendsjo/code/tmp/vibetest'
[7F909F498F00:00000000 INF] You are up to date
Compiling diet template 'index.dt'...
Compiling diet template 'index.dt'...
[7FB038528F00:00000000 WRN] Failed to parse config file /etc/vibe/vibe.conf: /etc/vibe/vibe.conf: No such file or directory
[7FB038528F00:00000000 INF] Listening on 0.0.0.0 port 8080 succeeded
[7FB038528F00:00000000 ERR] Error binding listening socket
[7FB038528F00:00000000 INF] Listening on :: port 8080 failed
[7FB038528F00:00000000 INF] Running event loop...
If you repeatedly delete the modules/xyz directory for some package and then call vibe, it will freeze at some point, not event closing when Ctrl+C is pressed. This probably needs some log debugging.
If I run vibe twice in a row, the second time I get this error:
object.Exception@/home/matt/code/vibe.d/bin/../source/vibe/core/drivers/threadedfile.d(79): Failed to open 'deps.txt' for writing.
----------------
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(vibe.core.driver.FileStream vibe.core.drivers.libevent2.Libevent2Driver.openFile(immutable(char)[], vibe.core.driver.FileMode)+0x6a) [0x528fce]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(vibe.core.driver.FileStream vibe.core.file.openFile(immutable(char)[], vibe.core.driver.FileMode)+0x31) [0x5410d1]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(void vibe.vpm.vpm.Vpm.createDepsTxt()+0x89) [0x51e27d]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(void vpm._staticCtor1()+0x160) [0x4d1d68]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(void vpm.__modctor()+0x9) [0x4fa071]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(extern (C) void rt.minfo.rt_moduleTlsCtor().void runModuleFuncs!(rt_moduleTlsCtor11__lambda232).runModuleFuncs(object.ModuleInfo*[])+0x3c) [0x5507b0]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(rt_moduleTlsCtor+0x18) [0x550098]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(extern (C) int rt.dmain2.main(int, char**).void runAll()+0x1d) [0x54bbc1]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x23) [0x54b513]
/tmp/.rdmd-1000/home/matt/code/vibe.d/bin/vpm.d.228FB9D98FA72CFF8B934DD31B954B79(main+0xd3) [0x54b4ab]
/lib/libc.so.6(__libc_start_main+0xf5) [0x7f416d150455]
The file deps.txt has this weird mode: -r-xr-Sr--
If it was created with a normal -rw-r--r-- mode, it would be able to write it the second time as well.
Remove the ./install.sh parts as long as there is no install.sh.
The main header should be "vibe.d" and ther should be a short introductory paragraph before the index.
Index could also be removed.
The rest of the website is in English, can the contact page be translated?
If I launch "vibe" directly, without going through a symbolic link, this happens:
$ vibe
dirname: missing operand
Try `dirname --help' for more information.
sh: cannot create /vpm.d.deps: Permission denied
Failed: 'dmd' '-g' '-w' '-property' '-I/../source' '-L-levent' '-L-levent_openssl' '-L-lssl' '-L-lcrypto' '-Jviews' '-Isource' '-v' '-o-' '/vpm.d' '-I/'
source/app.d(1): Error: module d is in file 'vibe/d.d' which cannot be read
import path[0] = /../source
import path[1] = source
import path[2] = source
import path[3] = /home/simendsjo/.dvm/compilers/dmd-2.059/bin/../src/phobos
import path[4] = /home/simendsjo/.dvm/compilers/dmd-2.059/bin/../src/druntime/import
Failed: 'dmd' '-g' '-w' '-property' '-I/../source' '-L-levent' '-L-levent_openssl' '-L-lssl' '-L-lcrypto' '-Jviews' '-Isource' '-v' '-o-' 'source/app.d' '-Isource'
res.render!("index.dt")(req); // doesn't work
/* instead, one below does work: */
auto output = res.bodyWriter();
parseDietFile!("index.dt", req)(output);
also
listenHttp(settings, ); // should be:
listenHttp(settings, &index);
./vibe
[7F6ECE470F00:00000000 INF] Updating application in '/home/simendsjo/code/tmp/vibetest2'
[7F6ECE470F00:00000000 ERR] Trying to get package metadata failed, exception: [email protected](528): Assertion failure
----------------
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(_d_assertm+0x2a) [0x56dc62]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D() [0x59a291]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(void[] std.zlib.UnCompress.flush().void __require()+0x26) [0x59b0de]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(void[] std.zlib.UnCompress.flush()+0x16) [0x59aec6]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(void vibe.stream.zlib.ZlibInputStream.readChunk()+0x133) [0x508dff]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(void vibe.stream.zlib.ZlibInputStream.read(ubyte[])+0x14d) [0x508cc1]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(ubyte[] vibe.stream.stream.readAll(vibe.stream.stream.InputStream, ulong)+0x110) [0x54ebb4]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(vibe.data.json.Json vibe.vpm.registry.RegistryPS.metadata(const(immutable(char)[]))+0x278) [0x506598]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(vibe.data.json.Json vibe.vpm.registry.RegistryPS.bestPackage(const(immutable(char)[]), const(vibe.vpm.dependency.Dependency))+0x27) [0x506727]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(vibe.data.json.Json vibe.vpm.registry.RegistryPS.packageJson(const(immutable(char)[]), const(vibe.vpm.dependency.Dependency))+0x62) [0x506306]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(_D4vibe3vpm3vpm11Application7actionsMxFC4vibe3vpm15packagesupplier15PackageSupplieriZAS4vibe3vpm3vpm6Action17__foreachbody3053MFKAyaKS4vibe3vpm10dependency19RequestedDependencyZi+0x108) [0x544964]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(_aaApply2+0x62) [0x56cdde]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(const(vibe.vpm.vpm.Action[] function(vibe.vpm.packagesupplier.PackageSupplier, int)) vibe.vpm.vpm.Application.actions+0x1ba) [0x544526]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(bool vibe.vpm.vpm.Vpm.update(int)+0x63) [0x54662b]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(_Dmain+0x471) [0x4e69dd]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(extern (C) int rt.dmain2.main(int, char**).void runMain()+0x17) [0x56e50f]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x23) [0x56de8f]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(extern (C) int rt.dmain2.main(int, char**).void runAll()+0x3d) [0x56e55d]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x23) [0x56de8f]
/tmp/.rdmd-1000/tmp/vpm.d.76976170AC35F5295A68BD603250DC1D(main+0xd3) [0x56de27]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f6ecd2c130d]
[7F6ECE470F00:00000000 WRN] Could not resolve dependencies
[7F6ECE470F00:00000000 ERR] The dependency graph could not be filled.
[7F6ECE470F00:00000000 INF] The following changes could be performed:
[7F6ECE470F00:00000000 INF] Failure: mysql-native, version >=0.0.1
linux64:
./vibe
../../vibe/vibe.d/bin/../source/vibe/core/drivers/libevent2.d(59): Error: undefined identifier evthread_use_posix_threads
Topic says it all really.
$ ./run_example.sh daytime
/usr/bin/ld: cannot find -levent_pthreads
collect2: ld returned 1 exit status
--- errorlevel 1
I have the event-devel package installed, but it doesn't seem to have an event_pthreads
library.
$ ls /usr/lib64 | grep event
libevent-1.4.so.2
libevent-1.4.so.2.1.3
libevent.a
libevent_core-1.4.so.2
libevent_core-1.4.so.2.1.3
libevent_core.a
libevent_core.so
libevent_extra-1.4.so.2
libevent_extra-1.4.so.2.1.3
libevent_extra.a
libevent_extra.so
libevent.so
libxcb-event.so.1
libxcb-event.so.1.0.0
I can't find much on the intertubes about the library, either. Is it a version thing? The package I have installed is libevent-devel-1.4.13-1.el6 (x86_64)
.
This is on CentOS 6.2 AMD64. Thanks!
I don't know who's reading the forums, so I'll crosspost here.
http://news.rejectedsoftware.com/thread/op.we5x1fmxx8p62v@simendsjo-desktop
Includes a crude prototype.
After installation:
I have a next errors:
...
C:\Users...AppData\Local\Temp.rdmd\source\vibe.cmd is not recognized as an internal or external command,
operable program or batch file.
Well, there is error with working sources under 2 different machines with Win 7 x86 and Win 2003 server x86.
Thanks!
I don't see any notes it todo.txt to support MySQL, SQLite or PostgreSQL. Given these are well known, and still widely popular, I think it makes sense to include them. At least MySQL and SQLite.
This is not really an "issue" but it is just something that I would be really great to have in Vibe.d. It is a great way to encrypt sensitive information, I noticed that there are support for md5.
Cheers!
On windows, when I put vibe's bin dir in my PATH and run "vibe" I just get this:
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url4Path14toNativeStringMxFZAya
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4core4file8openFileFAyaE4vibe4core6driver8FileModeZC4vibe4core6driver10FileStream
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe6stream6stream12OutputStream11__InterfaceZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe6stream6stream12OutputStream5writeMFxAabZv
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe3vpm8registry10RegistryPS6__ctorMFS4vibe4inet3url3UrlZC4vibe3vpm8registry10RegistryPS
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url3Url5parseFAyaZS4vibe4inet3url3Url
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe3vpm3vpm3Vpm6__ctorMFS4vibe4inet3url4PathC4vibe3vpm15packagesupplier15PackageSupplierZC4vibe3vpm3vpm3Vpm
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4core3log11setLogLevelFNbE4vibe4core3log8LogLevelZv
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url4Path6__initZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url4Path6__ctorMFAyaZS4vibe4inet3url4Path
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe3vpm8registry10RegistryPS7__ClassZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe3vpm3vpm3Vpm7__ClassZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4core3log10s_minLevelE4vibe4core3log8LogLevel
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url3Url8toStringMxFZAya
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url8__assertFiZv
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url9PathEntry11__xopEqualsFxPvxPvZb
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url9PathEntry8toStringMxFZAya
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url9PathEntry5opCmpMxFKxS4vibe4inet3url9PathEntryZi
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url7__arrayZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url4Path8absoluteMxFNdZb
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url4Path8toStringMxFbZAya
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4inet3url12__ModuleInfoZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4vibe12__ModuleInfoZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe3vpm3vpm12__ModuleInfoZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4core4file12__ModuleInfoZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe3vpm8registry12__ModuleInfoZ
C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\rdmd-vpm.d-146A64229ADA97795C1C597898480C31\vpm.obj(vpm)
Error 42: Symbol Undefined _D4vibe4core3log12__ModuleInfoZ
--- errorlevel 27
'C:\DOCUME~1\NICKSA~1\LOCALS~1\Temp\.rdmd\source\vibe.cmd' is not recognized as an internal or external command,
operable program or batch file.
I'm using DMD 2.059
TODO:
The <dt>
items at http://vibed.org/features (»Native machine code« section) are currently completely unstyled, making the list unattractive to read. Maybe just set it in italics or something like that?
I cloned master and tried the examples as follows:
$ cd examples/http_static_server
$ ../../bin/vibe
Then I send a request with Keep-Alive using telnet:
$ telnet localhost 8080
GET / HTTP/1.1
Host: localhost:8080
Keep-Alive: 300
Connection: keep-alive
HTTP/1.1 400 Bad Request
Content-Type: text/plain
Transfer-Encoding: chunked
97a
400 - Bad Request
Invalid request format.
Internal error information:
[email protected](149): Assertion failure
When I remove Keep-Alive: 300
and Connection: keep-alive
it works. But Connection: keep-alive
is sent by almost all browsers. Thus, it makes vibe.d practically useless when using with a browser.
I'm running Linux. Can somebody reproduce the issue?
Using Windows and DMD 2.058, the following examples do not compile.
JSON
redis
mongodb
daytime
info
Similar problems with Debian DMD 2.058 AMD64.
When using soft tab (2 spaces as a tab) with index.jd, like:
extends layout.jd block body h1 Example page - Home p Hello, World!
vibe complains about
diet.d(137): Error: "Error in template index.jd line 3: Inside an extension template, only 'block' tags are allowed at root level.(diet.d:169)"
I think its because diet does not recognize soft tab as an indent and regards h1 Example ...
as a new block, hence the error.
Should that be supported? I found that jade-lang.org are using soft tab in there examples
It references vibelog, but this is my package.json:
{
"name": "vibetest",
"version": "0.0.1",
"author": "simendsjo",
"dependencies": {
"mysql-native": ">=0.0.1"
}
}
First time running
$ ./vibe
[7F0B8C308F00:00000000 INF] Updating application in '/home/simendsjo/code/tmp/vibetest'
[7F0B8C308F00:00000000 INF] The following changes could be performed:
[7F0B8C308F00:00000000 INF] Installupdate: mysql-native, version >=0.0.1
[7F0B8C308F00:00000000 INF] Installing mysql-native...
[7F0B8C308F00:00000000 INF] mysql-native has been installed with version 0.0.1
[7F0B8C308F00:00000000 INF] There are still some actions to perform:
[7F0B8C308F00:00000000 INF] Uninstall: vibelog, ==0.0.1
[7F0B8C308F00:00000000 INF] InstallUpdate: mysql-native, >=0.0.1
And if I run it again:
$ ./vibe
[7FB755C8EF00:00000000 INF] Updating application in '/home/simendsjo/code/tmp/vibetest'
[7FB755C8EF00:00000000 INF] The following changes could be performed:
[7FB755C8EF00:00000000 INF] Uninstall: vibelog, version ==0.0.1
[7FB755C8EF00:00000000 INF] Installupdate: mysql-native, version >=0.0.1
[7FB755C8EF00:00000000 INF] Uninstalling vibelog
object.Exception@../../vibe/vibe.d/bin/../source/vibe/vpm/vpm.d(501): Uninstall failed, no journal found for 'vibelog'. Please uninstall manually.
/tmp/.rdmd-1000/home/simendsjo/code/tmp/vibetest/../../vibe/vibe.d/bin/vpm.d.F62B49216E43CDABBD891C9FA8DD043C(bool vibe.vpm.vpm.Vpm.update(bool)+0x2bf) [0x535313]
/tmp/.rdmd-1000/home/simendsjo/code/tmp/vibetest/../../vibe/vibe.d/bin/vpm.d.F62B49216E43CDABBD891C9FA8DD043C(_Dmain+0x155) [0x4d7805]
/tmp/.rdmd-1000/home/simendsjo/code/tmp/vibetest/../../vibe/vibe.d/bin/vpm.d.F62B49216E43CDABBD891C9FA8DD043C(extern (C) int rt.dmain2.main(int, char**).void runMain()+0x17) [0x55b45f]
/tmp/.rdmd-1000/home/simendsjo/code/tmp/vibetest/../../vibe/vibe.d/bin/vpm.d.F62B49216E43CDABBD891C9FA8DD043C(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x23) [0x55addf]
/tmp/.rdmd-1000/home/simendsjo/code/tmp/vibetest/../../vibe/vibe.d/bin/vpm.d.F62B49216E43CDABBD891C9FA8DD043C(extern (C) int rt.dmain2.main(int, char**).void runAll()+0x3d) [0x55b4ad]
/tmp/.rdmd-1000/home/simendsjo/code/tmp/vibetest/../../vibe/vibe.d/bin/vpm.d.F62B49216E43CDABBD891C9FA8DD043C(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x23) [0x55addf]
/tmp/.rdmd-1000/home/simendsjo/code/tmp/vibetest/../../vibe/vibe.d/bin/vpm.d.F62B49216E43CDABBD891C9FA8DD043C(main+0xd3) [0x55ad77]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fb75472c30d]
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.