dub icon indicating copy to clipboard operation
dub copied to clipboard

targetPath ignored when used with `platform` on Windows

Open atilaneves opened this issue 7 years ago • 5 comments

System information

  • dub version: 1.6.0
  • OS Platform and distribution: Windows 10 64-bit
  • compiler version dmd 2.077.1

Bug Description

dub build --arch=x86_mscoff ignores platform in targetPath and puts the binary in the wrong directory.

How to reproduce?

dub.sdl:

name "foo"
targetType "executable"
targetPath "bin\\32" platform="windows-x86_mscoff"
targetPath "bin\\64" platform="windows-x86_64"

souce/app.d:

void main() {}

Expected Behavior

The binary should be in bin\32 when built with --arch=x86_mscoff, not bin\64

atilaneves avatar Feb 13 '18 14:02 atilaneves

Any chance you could attach the output of dub build --arch=x86_mscoff --vverbose?

John-Colvin avatar Feb 13 '18 14:02 John-Colvin

The output is as expected, here's the end of it:

Performing "debug" build using dmd for x86, x86_mscoff.
foo ~master: target for configuration "application" is up to date.
Using existing build in C:\Users\atila\coding\d\experiments\dub_target_path\.dub\build\application-debug-windows-x86.x86_mscoff-dmd_2077-EE8ADD85F4F0CE5D50C99D8A255F6822\.
Copying target from C:\Users\atila\coding\d\experiments\dub_target_path\.dub\build\application-debug-windows-x86.x86_mscoff-dmd_2077-EE8ADD85F4F0CE5D50C99D8A255F6822\foo.exe to C:\Users\atila\coding\d\experiments\dub_target_path\bin\64
To force a rebuild of up-to-date targets, run again with --force.

atilaneves avatar Feb 13 '18 16:02 atilaneves

It's working as specified, but I'm unsure why targetPath doesn't support platform customization. So unless any unsolvable issue comes up, this definitely makes sense as an enhancement.

s-ludwig avatar Feb 16 '18 14:02 s-ludwig

I have same problem on linux with x86-arm platform pair

targetPath "build/arm/bin" platform "arm"
targetPath "build/x86/bin" platform "x86"

always builds to build/x86/bin

dub version

DUB version 1.7.2, built on Feb 15 2018

Quick reading sources point me to packagerecipe.d and BuildSettingsTemplate I think all of those attributes doesn't accept platform. All platform-specificatable fields in BuildSettingsTemplate is AA. Algorithms are corresponds.

deviator avatar Feb 24 '18 23:02 deviator

Same problem 👍🏻

trikko avatar May 06 '24 16:05 trikko