RejectedSoftware Forums

Sign up

Executing dub without package json or source/app.d results in an exception.

(I apologise to forum users for posting the following to VibeD forum it was
done by mistake)

This happens both with master or v0.9.21. I did not try other versions of
DUB:
(DMD v2.065)

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/dejan/.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/dejan/.dub/packages/local-
packages.json
No package found in current working directory.

Neither a package description file, nor source/app.d was found in
/home/dejan
Please run DUB from the root directory of an existing package, or run
"dub init --help" to get information on creating a new package.

Error executing command run: Failed to load package.

Full exception: object.Exception@source/dub/commandline.d(358): Failed to 
load package.
----------------
dub(pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy 
const(char)[], immutable(char)[], ulong)+0x6b) [0x65bd13]
dub(void dub.commandline.PackageBuildCommand.setupPackage(dub.dub.Dub, 
immutable(char)[])+0x19b) [0x5e5efb]
dub(int dub.commandline.GenerateCommand.execute(dub.dub.Dub, immutable(char)
[][], immutable(char)[][])+0x1d7) [0x5e6aef]
dub(int dub.commandline.BuildCommand.execute(dub.dub.Dub, immutable(char)[]
[], immutable(char)[][])+0x8d) [0x5e72b5]
dub(int dub.commandline.RunCommand.execute(dub.dub.Dub, immutable(char)[][], 
immutable(char)[][])+0x8d) [0x5e7475]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x1259) 
[0x5e4fb1]
dub(_Dmain+0x20) [0x5e3710]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).runAll().void __lambda1()+0x18) [0x6ddbdc]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).tryExec(scope void delegate())+0x2a) [0x6ddb36]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).runAll()+0x30) [0x6ddb9c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).tryExec(scope void delegate())+0x2a) [0x6ddb36]
dub(_d_run_main+0x1a3) [0x6ddab7]
dub(main+0x25) [0x5e3d55]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f43bfe06d65]

http://dejan.lekic.org

Re: Executing dub without package json or source/app.d results in an exception.

On Thu, 06 Mar 2014 14:55:48 +0000, Dejan Lekic wrote:

(I apologise to forum users for posting the following to VibeD forum it was
done by mistake)

This happens both with master or v0.9.21. I did not try other versions of
DUB:
(DMD v2.065)

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/dejan/.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/dejan/.dub/packages/local-
packages.json
No package found in current working directory.

Neither a package description file, nor source/app.d was found in
/home/dejan
Please run DUB from the root directory of an existing package, or run
"dub init --help" to get information on creating a new package.

Error executing command run: Failed to load package.

Full exception: object.Exception@source/dub/commandline.d(358): Failed to 
load package.
----------------
dub(pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy 
const(char)[], immutable(char)[], ulong)+0x6b) [0x65bd13]
dub(void dub.commandline.PackageBuildCommand.setupPackage(dub.dub.Dub, 
immutable(char)[])+0x19b) [0x5e5efb]
dub(int dub.commandline.GenerateCommand.execute(dub.dub.Dub, immutable(char)
[][], immutable(char)[][])+0x1d7) [0x5e6aef]
dub(int dub.commandline.BuildCommand.execute(dub.dub.Dub, immutable(char)[]
[], immutable(char)[][])+0x8d) [0x5e72b5]
dub(int dub.commandline.RunCommand.execute(dub.dub.Dub, immutable(char)[][], 
immutable(char)[][])+0x8d) [0x5e7475]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x1259) 
[0x5e4fb1]
dub(_Dmain+0x20) [0x5e3710]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).runAll().void __lambda1()+0x18) [0x6ddbdc]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).tryExec(scope void delegate())+0x2a) [0x6ddb36]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).runAll()+0x30) [0x6ddb9c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).tryExec(scope void delegate())+0x2a) [0x6ddb36]
dub(_d_run_main+0x1a3) [0x6ddab7]
dub(main+0x25) [0x5e3d55]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f43bfe06d65]

http://dejan.lekic.org

I assume you're trying to compile an application with dub without a package file? I don't know if this is what dub was meant for, maybe you could try running dub init and provide a minimum amount of information for the package manager?

Re: Executing dub without package json or source/app.d results in an exception.

On Fri, 07 Mar 2014 14:36:19 GMT, Etienne wrote:

On Thu, 06 Mar 2014 14:55:48 +0000, Dejan Lekic wrote:

(I apologise to forum users for posting the following to VibeD forum it was
done by mistake)

This happens both with master or v0.9.21. I did not try other versions of
DUB:
(DMD v2.065)

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/dejan/.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/dejan/.dub/packages/local-
packages.json
No package found in current working directory.

Neither a package description file, nor source/app.d was found in
/home/dejan
Please run DUB from the root directory of an existing package, or run
"dub init --help" to get information on creating a new package.

Error executing command run: Failed to load package.

Full exception: object.Exception@source/dub/commandline.d(358): Failed to 
load package.
----------------
dub(pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy 
const(char)[], immutable(char)[], ulong)+0x6b) [0x65bd13]
dub(void dub.commandline.PackageBuildCommand.setupPackage(dub.dub.Dub, 
immutable(char)[])+0x19b) [0x5e5efb]
dub(int dub.commandline.GenerateCommand.execute(dub.dub.Dub, immutable(char)
[][], immutable(char)[][])+0x1d7) [0x5e6aef]
dub(int dub.commandline.BuildCommand.execute(dub.dub.Dub, immutable(char)[]
[], immutable(char)[][])+0x8d) [0x5e72b5]
dub(int dub.commandline.RunCommand.execute(dub.dub.Dub, immutable(char)[][], 
immutable(char)[][])+0x8d) [0x5e7475]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x1259) 
[0x5e4fb1]
dub(_Dmain+0x20) [0x5e3710]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).runAll().void __lambda1()+0x18) [0x6ddbdc]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).tryExec(scope void delegate())+0x2a) [0x6ddb36]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).runAll()+0x30) [0x6ddb9c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[]
[])*).tryExec(scope void delegate())+0x2a) [0x6ddb36]
dub(_d_run_main+0x1a3) [0x6ddab7]
dub(main+0x25) [0x5e3d55]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f43bfe06d65]

http://dejan.lekic.org

I assume you're trying to compile an application with dub without a package file? I don't know if this is what dub was meant for, maybe you could try running dub init and provide a minimum amount of information for the package manager?

Re: Executing dub without package json or source/app.d results in an exception.

I apologise, I clicked on "Post" by mistake... (IMHO it is should be considered a bug to allow user to post a message that is 100% quoted text)

Anyway, what I was saying is simple - dub should not output an exception to the user, but some sane, human-readable message.

Re: Executing dub without package json or source/app.d results in an exception.

On Sun, 09 Mar 2014 15:15:33 GMT, Dejan Lekic wrote:

I apologise, I clicked on "Post" by mistake... (IMHO it is should be considered a bug to allow user to post a message that is 100% quoted text)

Cross-linking ticket: #18

Anyway, what I was saying is simple - dub should not output an exception to the user, but some sane, human-readable message.

Agreed, however, when run without "-v" it just outputs the following for me, without the full exception text:

Neither a package description file, nor source/app.d was found in
C:\Users\sludwig\Develop\_test\nodubpack
Please run DUB from the root directory of an existing package, or run
"dub init --help" to get information on creating a new package.

Error executing command run: Failed to load package.

The last line would be nice to have removed, too, though.