RejectedSoftware Forums

Sign up

Error compiling the example vibe.d minimal server

WARNING: A deprecated branch based version specification is used for the dependency vibe-d. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Target vibe-d ~master is up to date. Use --force to rebuild.
Building cofuar ~master configuration "application", build type debug.

Compiling using dmd...
source/app.d(1): Error: module vibe is in file 'vibe.d' which cannot be read
import path[0] = source/
import path[1] = ../../../root/.dub/packages/vibe-d-master/source/
import path[2] = ../../../root/.dub/packages/libevent-2.0.12.0.16
import path[3] = ../../../root/.dub/packages/openssl-1.1.4
1.0.1g
import path[4] = /usr/include/dmd/phobos
import path[5] = /usr/include/dmd/druntime/import
FAIL .dub/build/application-debug-linux.posix-x8664-dmd2067-EAFA58D80C5C82964BCA12BC4454451D/ demo executable
Error executing command run:
dmd failed with exit code 1.

DUB version 0.9.23, built on Apr 3 2015

DMD64 D Compiler v2.067.1
Copyright (c) 1999-2014 by Digital Mars written by Walter Bright

dub.json:

{

"name": "demo",
"description": "A minimal D application.",
"copyright": "Copyright © 2015, root",
"authors": ["root"],
"dependencies": {
 "vibe-d": {"version": "~master"}
},
"versions": [
 "VibeDefaultMain"
]

}

dub.selecions.json:

{

"fileVersion": 1,
"versions": {
	"memutils": "0.3.8",
	"vibe-d": "0.7.23",
	"libevent": "2.0.1+2.0.16",
	"openssl": "1.1.4+1.0.1g",
	"libev": "5.0.0+4.04",
	"libasync": "0.7.1"
}

}

Re: Error compiling the example vibe.d minimal server

On Tue, 09 Jun 2015 00:29:37 GMT, neo2005th wrote:

source/app.d(1): Error: module vibe is in file 'vibe.d' which cannot be read

please post your app.d
looks like its import statement is wrong

Re: Error compiling the example vibe.d minimal server

On Tue, 09 Jun 2015 00:29:37 GMT, neo2005th wrote:

Compiling using dmd...
source/app.d(1): Error: module vibe is in file 'vibe.d' which cannot be read
import path[0] = source/
import path[1] = ../../../root/.dub/packages/vibe-d-master/source/
import path[2] = ../../../root/.dub/packages/libevent-2.0.12.0.16
import path[3] = ../../../root/.dub/packages/openssl-1.1.4
1.0.1g
import path[4] = /usr/include/dmd/phobos
import path[5] = /usr/include/dmd/druntime/import
FAIL .dub/build/application-debug-linux.posix-x8664-dmd2067-EAFA58D80C5C82964BCA12BC4454451D/ demo executable
Error executing command run:
dmd failed with exit code 1.

I guess you try to import vibe.d.vibe ?
vibe is the package name, so you can either import vibe.d (d is module importing everything, present for convenience), or import specific vibe.XXX, see here: http://vibed.org/api/

Re: Error compiling the example vibe.d minimal server

On Tue, 09 Jun 2015 13:01:06 GMT, Mathias LANG wrote:

On Tue, 09 Jun 2015 00:29:37 GMT, neo2005th wrote:

Compiling using dmd...
source/app.d(1): Error: module vibe is in file 'vibe.d' which cannot be read
import path[0] = source/
import path[1] = ../../../root/.dub/packages/vibe-d-master/source/
import path[2] = ../../../root/.dub/packages/libevent-2.0.12.0.16
import path[3] = ../../../root/.dub/packages/openssl-1.1.4
1.0.1g
import path[4] = /usr/include/dmd/phobos
import path[5] = /usr/include/dmd/druntime/import
FAIL .dub/build/application-debug-linux.posix-x8664-dmd2067-EAFA58D80C5C82964BCA12BC4454451D/ demo executable
Error executing command run:
dmd failed with exit code 1.

I guess you try to import vibe.d.vibe ?
vibe is the package name, so you can either import vibe.d (d is module importing everything, present for convenience), or import specific vibe.XXX, see here: http://vibed.org/api/

This is my app.d, it's exactly the same from the front page of vibed.org

import vibe.d;

shared static this()
{

auto settings = new HTTPServerSettings;
settings.port = 8080;

listenHTTP(settings, &handleRequest);

}

void handleRequest(HTTPServerRequest req,

   HTTPServerResponse res)

{

if (req.path == "/")
	res.writeBody("Hello, World!", "text/plain");

}

Re: Error compiling the example vibe.d minimal server

This is now what i get with: import vibe.d;

Running ./demo
object.Exception@src/rt/minfo.d(162): Aborting: Cycle detected between modules with ctors/dtors:
vibe.http.server -> vibe.http.dist -> vibe.http.server
Error executing command run:
Program exited with code 1

Re: Error compiling the example vibe.d minimal server

On Tue, 09 Jun 2015 22:08:25 GMT, neo2005th wrote:

This is now what i get with: import vibe.d;

Running ./demo
object.Exception@src/rt/minfo.d(162): Aborting: Cycle detected between modules with ctors/dtors:
vibe.http.server -> vibe.http.dist -> vibe.http.server
Error executing command run:
Program exited with code 1

Unless you need ~master, I suggest you edit your 'dub.json' and depend on '0.7.23' instead.
You might have to remove dub.selections.json also.

Re: Error compiling the example vibe.d minimal server

On Wed, 10 Jun 2015 00:08:50 GMT, Mathias LANG wrote:

On Tue, 09 Jun 2015 22:08:25 GMT, neo2005th wrote:

This is now what i get with: import vibe.d;

Running ./demo
object.Exception@src/rt/minfo.d(162): Aborting: Cycle detected between modules with ctors/dtors:
vibe.http.server -> vibe.http.dist -> vibe.http.server
Error executing command run:
Program exited with code 1

Unless you need ~master, I suggest you edit your 'dub.json' and depend on '0.7.23' instead.
You might have to remove dub.selections.json also.

Yes im using 0.7.23 in dub.json, and with:

dub --force --build-mode=singleFile

And deleting dub.selections.json the error message is almost the same:

object.Exception@src/rt/minfo.d(162): Aborting: Cycle detected between modules with ctors/dtors:
vibe.http.dist -> vibe.http.server -> vibe.http.dist
Error executing command run:
Program exited with code 1

:(

Re: Error compiling the example vibe.d minimal server

On Wed, 10 Jun 2015 23:59:57 GMT, neo2005th wrote:

Yes im using 0.7.23 in dub.json, and with:

dub --force --build-mode=singleFile

I'm not sure why people use that build mode. Where did you hear about it? Simply remove this option and run with dub run, you should be good to go.

Re: Error compiling the example vibe.d minimal server

Am 11.06.2015 um 05:03 schrieb Etienne Cimon:

On Wed, 10 Jun 2015 23:59:57 GMT, neo2005th wrote:

Yes im using 0.7.23 in dub.json, and with:

dub --force --build-mode=singleFile

I'm not sure why people use that build mode. Where did you hear about it? Simply remove this option and run with dub run, you should be good to go.

I guess it's because of limited RAM. But I need to have another look at
that cycle. I don't see a justification for it, taking into account that
the vibe.http.dist module doesn't have static initialization at all.

Re: Error compiling the example vibe.d minimal server

Am Thu, 11 Jun 2015 09:01:47 +0200
schrieb Sönke Ludwig sludwig@rejectedsoftware.com:

Am 11.06.2015 um 05:03 schrieb Etienne Cimon:

On Wed, 10 Jun 2015 23:59:57 GMT, neo2005th wrote:

Yes im using 0.7.23 in dub.json, and with:

dub --force --build-mode=singleFile

I'm not sure why people use that build mode. Where did you hear
about it? Simply remove this option and run with dub run, you
should be good to go.

I guess it's because of limited RAM. But I need to have another look
at that cycle. I don't see a justification for it, taking into
account that the vibe.http.dist module doesn't have static
initialization at all.

Most likely a DMD/druntime bug:

https://issues.dlang.org/show_bug.cgi?id=14517

I ran into this in a PR for Phobos [1], and the involved modules don't
contain any static ctors/dtors either.

[1] https://github.com/D-Programming-Language/phobos/pull/3233