RejectedSoftware Forums

Sign up

Behavior of 1.0.0 and dub --single

Hi,

I noticed the behavior for dub --single changed. In the past the executable was created within the same folder as the source file. Now it is created in a temp folder. Even with dub build --single and specifying the targetPath "$PACKAGE_DIR" in the sdl, the executable is created in temp folder.

This is an issue for me. I have created for cloud foundry a buildpack. A buildpack is a collection of scripts. One script downloads dmd/dub and compiles the source code. Another script executes the executable.
I have a logic to detect dub.json/dub.sdl does not exist. In this case the d file is compiled with dub build --single.

It was straight forward to write a cloud application with the old behavior. But now it seems even impossible to specify that the executable should be built within the same directory with --single.

Is there a way to build the get the old behavior back?

Kind regards
André

Re: Behavior of 1.0.0 and dub --single

I hoped dub describe --single app.d returns the path to the executable in the temp folder
but no chance:

"targetPath": "",
"targetName": "app",
"targetFileName": "app.exe",

This information is not consistent.

The new behavior of creating the executable in a temp folder, without providing information where it was created or to influence this behavior, makes the --single functionality almost unusable for me ):

Kind regards
André

Re: Behavior of 1.0.0 and dub --single

On Thu, 13 Oct 2016 07:56:59 GMT, Andre Pany wrote:

I hoped dub describe --single app.d returns the path to the executable in the temp folder
but no chance:

"targetPath": "",
"targetName": "app",
"targetFileName": "app.exe",

This information is not consistent.

The new behavior of creating the executable in a temp folder, without providing information where it was created or to influence this behavior, makes the --single functionality almost unusable for me ):

Kind regards
André

I suggest following enhancement.

1) Add the parameter --temp-build to "build" too. By default this parameter has the value true. If I want to build the executable not in a temporary directory I write following command: dub build --single app.d --temp-build=false

or

2) To be consistent with dub describe: Add the --temp-build parameter to dub build but set the default value to false.

Kind regards
André

Re: Behavior of 1.0.0 and dub --single

On Wed, 12 Oct 2016 16:18:51 GMT, Andre Pany wrote:

Hi,

I noticed the behavior for dub --single changed. In the past the executable was created within the same folder as the source file. Now it is created in a temp folder. Even with dub build --single and specifying the targetPath "$PACKAGE_DIR" in the sdl, the executable is created in temp folder.

This is an issue for me. I have created for cloud foundry a buildpack. A buildpack is a collection of scripts. One script downloads dmd/dub and compiles the source code. Another script executes the executable.
I have a logic to detect dub.json/dub.sdl does not exist. In this case the d file is compiled with dub build --single.

It was straight forward to write a cloud application with the old behavior. But now it seems even impossible to specify that the executable should be built within the same directory with --single.

Is there a way to build the get the old behavior back?

Kind regards
André

Right now, --temp-build is only issued for the short syntax dub file.d, but dub --single file.d should build in the current directory. Did you test with the latest beta/master?

Re: Behavior of 1.0.0 and dub --single

Right now, --temp-build is only issued for the short syntax dub file.d, but dub --single file.d should build in the current directory. Did you test with the latest beta/master?

I tested it with the windows zip version 1.0.0 from http://code.dlang.org/download. This version builds the executable in a temp folder. I will try the latest git sources and will let you know the result.
Kind regards
Andre

Re: Behavior of 1.0.0 and dub --single

On Fri, 14 Oct 2016 21:36:42 GMT, Andre Pany wrote:

Right now, --temp-build is only issued for the short syntax dub file.d, but dub --single file.d should build in the current directory. Did you test with the latest beta/master?

I tested it with the windows zip version 1.0.0 from http://code.dlang.org/download. This version builds the executable in a temp folder. I will try the latest git sources and will let you know the result.
Kind regards
Andre

I tested git master. With dub build --single and dub --single, the executable is build wihtin the source directory, as expected. I will close the git issue which I have created.

Kind regards
André

Re: Behavior of 1.0.0 and dub --single

On 10/12/2016 12:18 PM, Andre Pany wrote:

Hi,

I noticed the behavior for dub --single changed. In the past the executable was created within the same folder as the source file. Now it is created in a temp folder. Even with dub build --single and specifying the targetPath "$PACKAGE_DIR" in the sdl, the executable is created in temp folder.

This is an issue for me. I have created for cloud foundry a buildpack. A buildpack is a collection of scripts. One script downloads dmd/dub and compiles the source code. Another script executes the executable.
I have a logic to detect dub.json/dub.sdl does not exist. In this case the d file is compiled with dub build --single.

It was straight forward to write a cloud application with the old behavior. But now it seems even impossible to specify that the executable should be built within the same directory with --single.

Is there a way to build the get the old behavior back?

Kind regards
André

Related:
https://github.com/dlang/dub/issues/907

Summary: I really think targetPath should never be ignored, regardless
of how dub is invoked.