RejectedSoftware Forums

Sign up

Can't get targetPath to work on win32

Using DUB version v0.9.19.

I've tried using this package:

{
	"description": "dchip",
	"targetName": "dchip",
	"authors": [
		"Andrej Mitrovic"
	],
	"version": "~master",
	"homepage": "https://github.com/AndrejMitrovic/dchip",
	"name": "dchip",
	"copyright": "Copyright © 2013, Andrej Mitrovic",
	"targetType": "staticLibrary",
	"sourcePaths": [
		"src"
	],
	"configurations": [
		{
			"name": "demo",
			"targetType": "executable",
			"targetName": "example-app",
			"sourcePaths": [
				"tests/demo",
				"tests/lib"
			],
            "importPaths": [
				"tests/lib"
			],
            "versions": [
				"CHIP_ALLOW_PRIVATE_ACCESS"
			],
            "libs": [
                "tests/lib/glfw3_implib"
            ],
            "targetPath" : "demo_app"
		},
	]
}

And then I've tried running with:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Error: C:\dev\projects\dchip\demo_app: The system cannot find the file specified.

Then I've tried using an absolute path:

"targetPath" : "C:\demo_app"

Called it again:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Error: Trying to append absolute path.

And then I just tried using the defaults, so I removed targetPath and built:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Running C:\Users\ADMINI~1\AppData\Local\Temp\dub\2055224000\example-app.exe...
Error: Program exited with code -1073741515

Run 'dub help' for usage information.

So I want to inspect what went wrong with the executable, but then I see dub has actually deleted it. Why would it remove the generated exe if it failed to run properly? I can't inspect it if it's gone.

Re: Can't get targetPath to work on win32

Am 03.11.2013 02:31, schrieb Andrej Mitrovic:

Using DUB version v0.9.19.

I've tried using this package:

...

And then I've tried running with:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Error: C:\dev\projects\dchip\demo_app: The system cannot find the file specified.

Then I've tried using an absolute path:

"targetPath" : "C:\demo_app"

Called it again:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Error: Trying to append absolute path.

And then I just tried using the defaults, so I removed targetPath and built:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Running C:\Users\ADMINI~1\AppData\Local\Temp\dub\2055224000\example-app.exe...
Error: Program exited with code -1073741515

Run 'dub help' for usage information.

So I want to inspect what went wrong with the executable, but then I see dub has actually deleted it. Why would it remove the generated exe if it failed to run properly? I can't inspect it if it's gone.

Both of the first two work fine when I try with git master. However, the
behavior for "dub" or "dub run" is currently to ignore "targetPath" and
instead use a temporary directory. This is subject to change (see
#82), but currently
"dub build && demo_app/example-app" needs to be used instead.

BTW (assuming that the package.json doesn't have more configurations),
you don't need to explicitly select the configuration as long as it is
the first in the list that matches the current platform.

Re: Can't get targetPath to work on win32

On Sun, 03 Nov 2013 13:06:10 +0100, Sönke Ludwig wrote:

Am 03.11.2013 02:31, schrieb Andrej Mitrovic:

Using DUB version v0.9.19.

I've tried using this package:

...

And then I've tried running with:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Error: C:\dev\projects\dchip\demo_app: The system cannot find the file specified.

Then I've tried using an absolute path:

"targetPath" : "C:\demo_app"

Called it again:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Error: Trying to append absolute path.

And then I just tried using the defaults, so I removed targetPath and built:

C:\dev\projects\dchip>dub --config=demo
Checking dependencies in 'C:\dev\projects\dchip'
Building configuration "demo", build type debug
Compiling...
DMD v2.064 DEBUG
Linking...
DMD v2.064 DEBUG
Running C:\Users\ADMINI~1\AppData\Local\Temp\dub\2055224000\example-app.exe...
Error: Program exited with code -1073741515

Run 'dub help' for usage information.

So I want to inspect what went wrong with the executable, but then I see dub has actually deleted it. Why would it remove the generated exe if it failed to run properly? I can't inspect it if it's gone.

Both of the first two work fine when I try with git master. However, the
behavior for "dub" or "dub run" is currently to ignore "targetPath" and
instead use a temporary directory. This is subject to change (see
#82), but currently
"dub build && demo_app/example-app" needs to be used instead.

BTW (assuming that the package.json doesn't have more configurations),
you don't need to explicitly select the configuration as long as it is
the first in the list that matches the current platform.

The last issue is fixed now: 7a66361

Re: Can't get targetPath to work on win32

On Sun, 03 Nov 2013 13:35:11 GMT, Sönke Ludwig wrote:

The last issue is fixed now: 7a66361

Thanks!

I'll try to build dub from master and report back.

Re: Can't get targetPath to work on win32

On Sun, 03 Nov 2013 17:36:30 GMT, Andrej Mitrovic wrote:

On Sun, 03 Nov 2013 13:35:11 GMT, Sönke Ludwig wrote:

The last issue is fixed now: 7a66361

Thanks!

I'll try to build dub from master and report back.

Ok, running without targetPath behaves properly now. I get a proper diagnostic with what went wrong at runtime (it was a missing DLL, since I didn't have the DLL in PATH but rather in a specific subfolder, but that's why I needed targetPath).

However using targetPath still fails with:

Error: C:\dev\projects\dchip\bin\demo_app: The system cannot find the file specified.

This is the package file:

{
    "description": "dchip is a D2 port of the Chipmunk2D physics library.",
    "targetName": "dchip",
    "authors": [
        "Andrej Mitrovic"
    ],
    "license": "MIT",
    "version": "~master",
    "homepage": "https://github.com/AndrejMitrovic/dchip",
    "name": "dchip",
    "copyright": "Copyright © 2013, Andrej Mitrovic",
    "targetType": "staticLibrary",
    "sourcePaths": [
        "src"
    ],

    "configurations": [
        {
            "name": "demo",
            "targetType": "executable",
            "targetName": "example-app",
            "sourcePaths": [
                "tests/demo",
                "tests/lib"
            ],
            "importPaths": [
                "tests/lib"
            ],
            "versions": [
                "CHIP_ALLOW_PRIVATE_ACCESS"
            ],
            "libs": [
                "tests/lib/glfw3_implib"
            ],
            "targetPath" : "bin/demo_app",
            "copyFiles-windows-x86": ["tests/bin/glfw3.dll"],
        },
    ]
}

Using: DUB version v0.9.19-35-g7a66361

Re: Can't get targetPath to work on win32

On Sun, 03 Nov 2013 19:22:59 GMT, Andrej Mitrovic wrote:

snip

When I use:

"targetPath" : "tests/bin"

It will succeed building the app and it will output it to:

C:\dev\projects\dchip\tests\bin\demo_dub.exe

But for some reason it fails to spawn it:

Error: Failed to spawn new process (The system cannot find the file specified.)

Re: Can't get targetPath to work on win32

On Sun, 03 Nov 2013 19:41:30 GMT, Andrej Mitrovic wrote:

On Sun, 03 Nov 2013 19:22:59 GMT, Andrej Mitrovic wrote:

snip

When I use:

"targetPath" : "tests/bin"

It will succeed building the app and it will output it to:

C:\dev\projects\dchip\tests\bin\demo_dub.exe

But for some reason it fails to spawn it:

Error: Failed to spawn new process (The system cannot find the file specified.)

It was a bad interaction with the new "workingDirectory" field, which defaults to "targetPath" - it tried to run "bin\demo_dub.exe" after having already chdir'ed to "bin\". The path is now properly computed relative to the "workingDirectory" (9c55893).