diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index a3e721b..e03095d 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -224,6 +224,8 @@ protected final void invokeTool(string[] args, void delegate(int, string) output_callback) { + import std.string; + int status; if (output_callback) { auto result = executeShell(escapeShellCommand(args)); @@ -233,7 +235,12 @@ auto compiler_pid = spawnShell(escapeShellCommand(args)); status = compiler_pid.wait(); } - enforce(status == 0, args[0] ~ " failed with exit code "~to!string(status)); + + version (Posix) if (status == -9) { + throw new Exception(format("%s failed with exit code %s. This may indicate that the process has run out of memory."), + args[0], status); + } + enforce(status == 0, format("%s failed with exit code %s.", args[0], status)); } }