RejectedSoftware Forums

Sign up

Failed DUB build on Ubuntu

I'm using a cloud (AWS) server running Ubuntu 12.04.3 LTS. I installed DUB and DMD using the D apt-get repo. I initialized a vibe.d project and run dub build -v but I get an error. This is the basic default app.d file from when vibe.d is first initializes with dub. Im fairly new to D, but I was able to get this same project running on my Mac 10.9 laptop before I started trying the AWS server. Any Ideas as to what is causing the error?

The full exception is below.

Full exception: object.Exception@source/dub/compilers/dmd.d(173): DMD compile run failed with exit code -9
----------------
dub(pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong)+0x6b) [0x641767]
dub(void dub.compilers.dmd.DmdCompiler.invoke(const(dub.compilers.compiler.BuildSettings), const(dub.compilers.compiler.BuildPlatform))+0x380) [0x5f5d5c]
dub(void dub.generators.build.BuildGenerator.buildWithCompiler(dub.generators.generator.GeneratorSettings, dub.compilers.compiler.BuildSettings)+0x3b7) [0x601d63]
dub(void dub.generators.build.BuildGenerator.performCachedBuild(dub.generators.generator.GeneratorSettings, dub.compilers.compiler.BuildSettings)+0x4ad) [0x5fffd9]
dub(void dub.generators.build.BuildGenerator.generateProject(dub.generators.generator.GeneratorSettings)+0x4f2) [0x5ff926]
dub(void dub.dub.Dub.generateProject(immutable(char)[], dub.generators.generator.GeneratorSettings)+0xa0) [0x5cc3e4]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x1b0e) [0x5c1bca]
dub(_Dmain+0x20) [0x5bfa74]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().void __lambda1()+0x18) [0x696fbc]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x696f16]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x696f7c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x696f16]
dub(_d_run_main+0x1a3) [0x696e97]
dub(main+0x25) [0x5c00b9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fd293cfe76d]
Run 'dub help' for usage information.

Re: Failed DUB build on Ubuntu

On Mon, 03 Feb 2014 05:33:25 GMT, Bear Cherian wrote:

I'm using a cloud (AWS) server running Ubuntu 12.04.3 LTS. I installed DUB and DMD using the D apt-get repo. I initialized a vibe.d project and run dub build -v but I get an error. This is the basic default app.d file from when vibe.d is first initializes with dub. Im fairly new to D, but I was able to get this same project running on my Mac 10.9 laptop before I started trying the AWS server. Any Ideas as to what is causing the error?

The full exception is below.

Full exception: object.Exception@source/dub/compilers/dmd.d(173): DMD compile run failed with exit code -9
----------------
dub(pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong)+0x6b) [0x641767]
dub(void dub.compilers.dmd.DmdCompiler.invoke(const(dub.compilers.compiler.BuildSettings), const(dub.compilers.compiler.BuildPlatform))+0x380) [0x5f5d5c]
dub(void dub.generators.build.BuildGenerator.buildWithCompiler(dub.generators.generator.GeneratorSettings, dub.compilers.compiler.BuildSettings)+0x3b7) [0x601d63]
dub(void dub.generators.build.BuildGenerator.performCachedBuild(dub.generators.generator.GeneratorSettings, dub.compilers.compiler.BuildSettings)+0x4ad) [0x5fffd9]
dub(void dub.generators.build.BuildGenerator.generateProject(dub.generators.generator.GeneratorSettings)+0x4f2) [0x5ff926]
dub(void dub.dub.Dub.generateProject(immutable(char)[], dub.generators.generator.GeneratorSettings)+0xa0) [0x5cc3e4]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x1b0e) [0x5c1bca]
dub(_Dmain+0x20) [0x5bfa74]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().void __lambda1()+0x18) [0x696fbc]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x696f16]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x696f7c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x696f16]
dub(_d_run_main+0x1a3) [0x696e97]
dub(main+0x25) [0x5c00b9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fd293cfe76d]
Run 'dub help' for usage information.

Do you get any additional error messages above the exception message or does it directly follow the "Compiling..." message? The exception itself just states that the compiler binary has returned an error code, but doesn't say what caused it.

There is one issue that sometimes happens for DMD 2.064.2, which I unfortunately never encountered personally (see also https://github.com/rejectedsoftware/vibe.d/issues/458#issuecomment-32257069). If that's the case and time permits for you, the easiest solution would be to either wait for the third DMD 2.065 beta (or the final release), or to build the latest git HEAD of the 2.065 branch by hand. Otherwise I'll see what I can do in terms of a workaround.

Re: Failed DUB build on Ubuntu

OK, i wasn't looking far up enough in the output. It has an error earlier where pkg-config is failing.

Using dub registry url 'http://code.dlang.org/'
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/ubuntu/.dub/packages/local-packages.json
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/ubuntu/.dub/packages/local-packages.json
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/ubuntu/.dub/packages/local-packages.json
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/ubuntu/.dub/packages/local-packages.json
Note: Failed to determine version of package gcapp at (.../.../...). Assuming ~master.
Collecting dependencies for gcapp
Found dependency vibe-d >=0.7.18: true
Collecting dependencies for vibe-d
Found dependency libevent ~master: true
Collecting dependencies for libevent
Found dependency openssl ~master: true
Collecting dependencies for openssl
Found dependency libev ~master: true
Collecting dependencies for libev
Checking dependencies in '(.../.../...)'
Required package 'vibe-d' found with version '0.7.18'
Required package 'libevent' found with version '~master'
Required package 'openssl' found with version '~master'
Required package 'libev' found with version '~master'
Generating using build
Building configuration "application", build type debug
Trying to use pkg-config to resolve library flags for ["event", "event_pthreads", "ssl", "crypto"].
pkg-config failed: pkg-config exited with error code 1
Falling back to direct -lxyz flags.
Compiling...
dmd -of.dub/build/application-debug-x86_64-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709/gcapp -c -of.dub/build/application-debug-x86_64-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709/gcapp.o -debug -g -w -version=Have_gcapp -version=Have_vibe_d -version=VibeLibeventDriver -version=Have_libevent -version=Have_openssl -Isource -I../../../.dub/packages/vibe-d-0.7.18/source -I../../../.dub/packages/libevent-master -I../../../.dub/packages/openssl-master -Jviews source/app.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/utils/validation.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/utils/hashmap.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/utils/string.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/utils/array.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/utils/memory.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/crypto/cryptorand.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/crypto/passwordhash.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/appmain.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/internal/win32.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/internal/meta/uda.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/internal/meta/funcattr.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/internal/meta/all.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/internal/meta/traits.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/internal/meta/codegen.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/internal/meta/typetuple.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/_eventedobject.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/stream.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/file.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/args.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/task.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/sync.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/concurrency.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/log.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/net.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/driver.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/connectionpool.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/core.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/drivers/threadedfile.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/drivers/win32.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/drivers/libevent2_tcp.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/drivers/libev.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/drivers/libevent2.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/core/drivers/winrt.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/db/redis/redis.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/db/mongo/connection.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/db/mongo/database.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/db/mongo/client.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/db/mongo/mongo.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/db/mongo/cursor.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/db/mongo/collection.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/templ/diet.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/templ/utils.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/templ/parsertools.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/inet/webform.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/inet/url.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/inet/path.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/inet/mimetypes.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/inet/message.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/inet/urltransfer.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/d.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/base64.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/zlib.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/ssl.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/wrapper.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/taskpipe.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/operations.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/memory.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/stream/counting.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/textfilter/html.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/textfilter/urlencode.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/textfilter/markdown.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/vibe.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/mail/smtp.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/data/json.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/data/bson.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/data/serialization.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/fileserver.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/rest.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/client.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/dist.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/status.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/common.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/form.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/server.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/log.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/proxy.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/auth/basic_auth.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/router.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/websockets.d ../../../.dub/packages/vibe-d-0.7.18/source/vibe/http/session.d

Re: Failed DUB build on Ubuntu

Am 04.02.2014 05:02, schrieb Bear Cherian:

OK, i wasn't looking far up enough in the output. It has an error earlier where pkg-config is failing.

Trying to use pkg-config to resolve library flags for ["event", "event_pthreads", "ssl", "crypto"].
pkg-config failed: pkg-config exited with error code 1
Falling back to direct -lxyz flags.
Compiling...
(...)

The pkg-config error isn't fatal on its own, there must be something
else coming later. Can you paste the full build output? Ideally on
http://pastebin.com or something similar.

Re: Failed DUB build on Ubuntu

I was able to get this working on a 32-bit Ubuntu 12.0.4 instance, but still having trouble on the 64-bit instance.

dub v0.9.20
dmd v2.064

I installed the following packages - libevent-dev, libssl-dev, libev-dev, libphobos2-dev, dmd, dub

As root, I ran dub init vibedtest vibe.d, cd into vibedtest and run dub build -v.

This is the output on the 64-bit instance - http://pastebin.com/sMtCEqBu. This time no problem with pkg-config, but still issues compiling.

I'm just testing development of an app, so I can work with the 32-bit instance for now. But i would like to move this onto a 64-bit environment eventually.

On Tue, 04 Feb 2014 08:12:37 +0100, Sönke Ludwig wrote:

Am 04.02.2014 05:02, schrieb Bear Cherian:

OK, i wasn't looking far up enough in the output. It has an error earlier where pkg-config is failing.

Trying to use pkg-config to resolve library flags for ["event", "event_pthreads", "ssl", "crypto"].
pkg-config failed: pkg-config exited with error code 1
Falling back to direct -lxyz flags.
Compiling...
(...)

The pkg-config error isn't fatal on its own, there must be something
else coming later. Can you paste the full build output? Ideally on
http://pastebin.com or something similar.

Re: Failed DUB build on Ubuntu

Am 04.02.2014 18:01, schrieb Bear Cherian:

I was able to get this working on a 32-bit Ubuntu 12.0.4 instance, but still having trouble on the 64-bit instance.

dub v0.9.20
dmd v2.064

I installed the following packages - libevent-dev, libssl-dev, libev-dev, libphobos2-dev, dmd, dub

As root, I ran dub init vibedtest vibe.d, cd into vibedtest and run dub build -v.

This is the output on the 64-bit instance - http://pastebin.com/sMtCEqBu. This time no problem with pkg-config, but still issues compiling.

I'm just testing development of an app, so I can work with the 32-bit instance for now. But i would like to move this onto a 64-bit environment eventually.

Oh okay, I start so suspect something. Exit code -9 usually means that
the application (dmd) was killed by signal 9 (SIGKILL). This sometimes
happens when a process uses up too much memory. If this is the case,
you'll have to compile the application on a local Linux/64 computer and
just upload the binary (which often makes sense anyway), or upgrade the
memory of the VM.

You might also have luck with the latest beta version of DUB
(0.9.21-beta.3), which compiles each dependency separately by default
and thus can save a little on the memory usage.

Re: Failed DUB build on Ubuntu

On Tue, 04 Feb 2014 20:03:11 +0100, Sönke Ludwig wrote:

This sometimes
happens when a process uses up too much memory.

I had this problem precisely on a VMWare image of debian when debugging something yesterday, compilation can take 1-2gb of ram for vibenews. dub on linux i386 doesn't show out of memory errors, it just closes the process with Error: <blank> and a SIGKILL

I had to try compiling on windows while the virtual machine was open to see the out of memory error.

I noticed that it takes less memory to compile each project individually than with a single dub command.

Re: Failed DUB build on Ubuntu

On Tue, 04 Feb 2014 19:10:25 GMT, Etienne wrote:

On Tue, 04 Feb 2014 20:03:11 +0100, Sönke Ludwig wrote:

This sometimes
happens when a process uses up too much memory.

I had this problem precisely on a VMWare image of debian when debugging something yesterday, compilation can take 1-2gb of ram for vibenews. dub on linux i386 doesn't show out of memory errors, it just closes the process with Error: <blank> and a SIGKILL

Just to clarify, DUB itself unfortunately doesn't have much control over the DMD process, which consumes the actual memory. It's the OS that kills the process tree as a safety measure (usually based on ulimit settings).

Re: Failed DUB build on Ubuntu

On Wed, 05 Feb 2014 20:42:10 GMT, Sönke Ludwig wrote:

On Tue, 04 Feb 2014 19:10:25 GMT, Etienne wrote:

On Tue, 04 Feb 2014 20:03:11 +0100, Sönke Ludwig wrote:

This sometimes
happens when a process uses up too much memory.

I had this problem precisely on a VMWare image of debian when debugging something yesterday, compilation can take 1-2gb of ram for vibenews. dub on linux i386 doesn't show out of memory errors, it just closes the process with Error: <blank> and a SIGKILL

Just to clarify, DUB itself unfortunately doesn't have much control over the DMD process, which consumes the actual memory. It's the OS that kills the process tree as a safety measure (usually based on ulimit settings).

Just to update, I do believe it is the memory issue. Currently I'm using the free tier of AWS, which is only ~ .6GB of memory. Since this is just only in development, i'm OK working in 32 bit for now. I'll see if I can get some time to test with the new version of dub later.