It's DUB's "optional": true broken ?

Andre Pany andre at s-e-a-p.de
Mon Mar 29 19:11:19 UTC 2021


On Sunday, 28 March 2021 at 15:52:43 UTC, Zardoz wrote:
> So, we get this dub.json :
>
> {
>   "name": "example",
>   "configurations": [
>     {
>       "name": "example",
>       "targetType": "library"
>     },
>     {
>       "name": "unittest",
>       "targetType": "library",
>       "importPaths": ["source", "tests"],
>       "sourcePaths": ["source", "tests"],
>       "dependencies": {
>         "silly": "~>1.0.2",
>         "dshould": "~>1.4.3"
>       }
>     }
>   ]
> }
>
> [...]

Assumption: dshould has 2 configurations. In first configuration, 
unit-threaded is marked as optional in second it isn't. Dub 
therefore downloads it per rule (all configurations are 
considered, also the not used).

The author could mark it in all configurations as optional or, 
use sub packages, which is another way to have optional 
dependencies.

Kind regards
Andre


More information about the Digitalmars-d-learn mailing list