RejectedSoftware Forums

Sign up

Build error with DUB.

Hi Guys,

I am getting an error that doesn't make any sense to me...

HRA\adamw@INVICTUS:~/Projects/Adappt/Sources/Adappt> dub build --force
Package memutils can be upgraded from 0.3.7 to 0.3.8.
Use "dub upgrade" to perform those changes.
Building vibe-d 0.7.23 configuration "libevent", build type debug.
Running dmd...
Building derelict-util 2.0.0 configuration "library", build type debug.
Running dmd...
Building derelict-pq 1.0.1 configuration "library", build type debug.
Running dmd...
Building dpq2 0.1.7 configuration "static", build type debug.
Running dmd...
Building adappt source ~master configuration "application", build type debug.
Compiling using dmd...
Linking...
Error: cannot read file source.d
FAIL .dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/ adappt source executable
Error executing command build:
dmd failed with exit code 1.

The only file I have in the source directory is app.d and all it contains is the following:

import vibe.d;

shared static this()
{
	auto router = new URLRouter();
	auto settings = new HTTPServerSettings();
	settings.port = 8080;
	settings.bindAddresses = ["::1", "127.0.0.1"];
	listenHTTP(settings, router);
}

void hello(HTTPServerRequest req, HTTPServerResponse res)
{
	res.writeBody("Hello, World!");
}

This appears to have started when I did a git init in the same folder as the dub.json file.

Thanks guys!

Re: Build error with DUB.

Am 10.06.2015 um 07:31 schrieb Adam Wilson:

Hi Guys,

I am getting an error that doesn't make any sense to me...

(...)
Error: cannot read file source.d
FAIL .dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/ adappt source executable
Error executing command build:
dmd failed with exit code 1.

The only file I have in the source directory is app.d and all it contains is the following:
(...)

This appears to have started when I did a git init in the same folder as the dub.json file.

Thanks guys!

Can you post the output of dub build -v (the part where the compiler
is invoked)? Maybe it's an issue with spaces inside of a path or similar.

Re: Build error with DUB.

On Wed, 10 Jun 2015 12:54:55 +0200, Sönke Ludwig wrote:

Am 10.06.2015 um 07:31 schrieb Adam Wilson:

Hi Guys,

I am getting an error that doesn't make any sense to me...

(...)
Error: cannot read file source.d
FAIL .dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/ adappt source executable
Error executing command build:
dmd failed with exit code 1.

The only file I have in the source directory is app.d and all it contains is the following:
(...)

This appears to have started when I did a git init in the same folder as the dub.json file.

Thanks guys!

Can you post the output of dub build -v (the part where the compiler
is invoked)? Maybe it's an issue with spaces inside of a path or similar.

Ok here it is:

Building adappt source ~master configuration "application", build type debug.
Using pkg-config to resolve library flags for libevent, libeventpthreads, libssl, libcrypto, libpq.
Using direct -l... flags for dl.
Compiling using dmd...
dmd -c -of.dub/build/application-debug-linux.posix-x86
64-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source.o -debug -g -w -version=VibeDefaultMain -version=VibeLibeventDriver -version=Haveadapptsource -version=Havevibed -version=Havelibevent -version=Haveopenssl -version=Havedpq2 -version=Havederelictpq -version=Havederelictutil -Isource/ -I../../../../.dub/packages/vibe-d-0.7.23/source/ -I../../../../.dub/packages/libevent-2.0.12.0.16 -I../../../../.dub/packages/openssl-1.1.41.0.1g -I../../../../.dub/packages/dpq2-0.1.7/src/ -I../../../../.dub/packages/derelict-pq-1.0.1/source/ -I../../../../.dub/packages/derelict-util-2.0.0/source/ -Jviews source/app.d ../../../../.dub/packages/vibe-d-0.7.23/source/vibe/appmain.d
Linking...
dmd -of.dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source .dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source.o ../../../../.dub/packages/vibe-d-0.7.23/libvibe-d.a ../../../../.dub/packages/dpq2-0.1.7/bin/libdpq2.a ../../../../.dub/packages/derelict-pq-1.0.1/lib/libDerelictPQ.a ../../../../.dub/packages/derelict-util-2.0.0/lib/libDerelictUtil.a -L--no-as-needed -L-leventpthreads -L-levent -L-lssl -L-lcrypto -L-lpq -L-ldl -g
Error: cannot read file source.d
FAIL .dub/build/application-debug-linux.posix-x86
64-dmd_2067-5EA8135B71290A4D525ECD952C36A8B0/ adappt source executable
Error executing command build:
dmd failed with exit code 1.

Re: Build error with DUB.

On 06/10/2015 11:48 PM, Adam Wilson wrote:

Ok here it is:

Building adappt source ~master configuration "application", build type debug.
Using pkg-config to resolve library flags for libevent, libeventpthreads, libssl, libcrypto, libpq.
Using direct -l... flags for dl.
Compiling using dmd...
dmd -c -of.dub/build/application-debug-linux.posix-x86
64-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source.o -debug -g -w -version=VibeDefaultMain -version=VibeLibeventDriver -version=Haveadapptsource -version=Havevibed -version=Havelibevent -version=Haveopenssl -version=Havedpq2 -version=Havederelictpq -version=Havederelictutil -Isource/ -I../../../../.dub/packages/vibe-d-0.7.23/source/ -I../../../../.dub/packages/libevent-2.0.12.0.16 -I../../../../.dub/packages/openssl-1.1.41.0.1g -I../../../../.dub/packages/dpq2-0.1.7/src/ -I../../../../.dub/packages/derelict-pq-1.0.1/source/ -I../../../../.dub/packages/derelict-util-2.0.0/source/ -Jviews source/app.d ../../../../.dub/packages/vibe-d-0.7.23/source/vibe/appmain.d
Linking...
dmd -of.dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source .dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source.o ../../../../.dub/packages/vibe-d-0.7.23/libvibe-d.a ../../../../.dub/packages/dpq2-0.1.7/bin/libdpq2.a ../../../../.dub/packages/derelict-pq-1.0.1/lib/libDerelictPQ.a ../../../../.dub/packages/derelict-util-2.0.0/lib/libDerelictUtil.a -L--no-as-needed -L-leventpthreads -L-levent -L-lssl -L-lcrypto -L-lpq -L-ldl -g
Error: cannot read file source.d
FAIL .dub/build/application-debug-linux.posix-x86
64-dmd_2067-5EA8135B71290A4D525ECD952C36A8B0/ adappt source executable
Error executing command build:
dmd failed with exit code 1.

In your dub.json, does your "name" field look like this...

"name": " adappt source"

...?

I think the name field is supposed to be an identifier, so try:

"name": "adappt-source"

Re: Build error with DUB.

On Thu, 11 Jun 2015 16:15:28 -0400, Nick Sabalausky wrote:

On 06/10/2015 11:48 PM, Adam Wilson wrote:

Ok here it is:

Building adappt source ~master configuration "application", build type debug.
Using pkg-config to resolve library flags for libevent, libeventpthreads, libssl, libcrypto, libpq.
Using direct -l... flags for dl.
Compiling using dmd...
dmd -c -of.dub/build/application-debug-linux.posix-x86
64-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source.o -debug -g -w -version=VibeDefaultMain -version=VibeLibeventDriver -version=Haveadapptsource -version=Havevibed -version=Havelibevent -version=Haveopenssl -version=Havedpq2 -version=Havederelictpq -version=Havederelictutil -Isource/ -I../../../../.dub/packages/vibe-d-0.7.23/source/ -I../../../../.dub/packages/libevent-2.0.12.0.16 -I../../../../.dub/packages/openssl-1.1.41.0.1g -I../../../../.dub/packages/dpq2-0.1.7/src/ -I../../../../.dub/packages/derelict-pq-1.0.1/source/ -I../../../../.dub/packages/derelict-util-2.0.0/source/ -Jviews source/app.d ../../../../.dub/packages/vibe-d-0.7.23/source/vibe/appmain.d
Linking...
dmd -of.dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source .dub/build/application-debug-linux.posix-x8664-dmd2067-5EA8135B71290A4D525ECD952C36A8B0/adappt source.o ../../../../.dub/packages/vibe-d-0.7.23/libvibe-d.a ../../../../.dub/packages/dpq2-0.1.7/bin/libdpq2.a ../../../../.dub/packages/derelict-pq-1.0.1/lib/libDerelictPQ.a ../../../../.dub/packages/derelict-util-2.0.0/lib/libDerelictUtil.a -L--no-as-needed -L-leventpthreads -L-levent -L-lssl -L-lcrypto -L-lpq -L-ldl -g
Error: cannot read file source.d
FAIL .dub/build/application-debug-linux.posix-x86
64-dmd_2067-5EA8135B71290A4D525ECD952C36A8B0/ adappt source executable
Error executing command build:
dmd failed with exit code 1.

In your dub.json, does your "name" field look like this...

"name": " adappt source"

...?

I think the name field is supposed to be an identifier, so try:

"name": "adappt-source"

Thanks! That fixed it. I would've never guessed!

Re: Build error with DUB.

On Fri, 12 Jun 2015 05:06:59 GMT, Adam Wilson wrote:

On Thu, 11 Jun 2015 16:15:28 -0400, Nick Sabalausky wrote:

(...)
I think the name field is supposed to be an identifier, so try:

"name": "adappt-source"

Thanks! That fixed it. I would've never guessed!

The current beta already has added a proper warning message with accompanying instructions how to fix it. The bug with spaces in the output name has also been fixed. BTW, if in the future you want to have an executable with spaces in its name, you can use "targetName": "adappt source" while keeping the package name without spaces.