RejectedSoftware Forums

Sign up

Dub "subConfiguration" dependencies

I'm not sure if there's a better place to ask this, but I ran into something yesterday that I couldn't figure out how to resolve properly and was curious if there was some magic that I'm missing to make it work.

I added the follow dependency to my application:
http://code.dlang.org/packages/jwtd

That library in turn has a series of configurations including one that uses OpenSSL and another that uses Botan. I'm able to select the OpenSSL version via "subConfigurations" properly, but even when I do that Dub seems to pull in Botan as a dependency to my top level project (including putting it in VisualD projects that are generated and so on).

This generally would just be a minor annoyance but in this case Botan fails to build with the standard Windows DMD release, due to running out of memory:
https://github.com/etcimon/botan/blob/master/dmd64buildinstructions.txt

I'd rather not have dependencies on both botan and openssl for no reason so now I have a few options for my application...

a) Compile my own 64-bit DMD. I did this and it isn't terribly hard but it makes the build setup needlessly annoying on different machines. Plus if I configure Vibe to use Botan instead I get crashes currently... haven't had time to track it down but I'm assuming it's a bit less mature in Vibe than the OpenSSL stuff.

b) Pull a specific version of that library and remove the offending botan configs. This is what I'm doing for now but it makes updating the dependency more trouble in the future. Not a big deal for this specific lib but curious in general.

So is there some way to get different behavior in Dub or is this by design? I must admit I'm often somewhat confused about how setting "versions", dependencies, configs and sub-configs all interact with one another.

Cheers!

Re: Dub "subConfiguration" dependencies

Am 11.11.2015 um 15:36 schrieb punkUser:

I'm not sure if there's a better place to ask this, but I ran into something yesterday that I couldn't figure out how to resolve properly and was curious if there was some magic that I'm missing to make it work.

I added the follow dependency to my application:
http://code.dlang.org/packages/jwtd

That library in turn has a series of configurations including one that uses OpenSSL and another that uses Botan. I'm able to select the OpenSSL version via "subConfigurations" properly, but even when I do that Dub seems to pull in Botan as a dependency to my top level project (including putting it in VisualD projects that are generated and so on).

This generally would just be a minor annoyance but in this case Botan fails to build with the standard Windows DMD release, due to running out of memory:
https://github.com/etcimon/botan/blob/master/dmd64buildinstructions.txt

I'd rather not have dependencies on both botan and openssl for no reason so now I have a few options for my application...

a) Compile my own 64-bit DMD. I did this and it isn't terribly hard but it makes the build setup needlessly annoying on different machines. Plus if I configure Vibe to use Botan instead I get crashes currently... haven't had time to track it down but I'm assuming it's a bit less mature in Vibe than the OpenSSL stuff.

b) Pull a specific version of that library and remove the offending botan configs. This is what I'm doing for now but it makes updating the dependency more trouble in the future. Not a big deal for this specific lib but curious in general.

So is there some way to get different behavior in Dub or is this by design? I must admit I'm often somewhat confused about how setting "versions", dependencies, configs and sub-configs all interact with one another.

Cheers!

This is indeed planned to be revised for the next release:
#361

Currently you'll have to dub remove botan to avoid it getting chosen.

Re: Dub "subConfiguration" dependencies

This is indeed planned to be revised for the next release:
#361

Currently you'll have to dub remove botan to avoid it getting chosen.

Ah interesting. I did try removing botan but it would still always get pulled back in by JWT, even though the dependency is part of the subconfiguration:
https://github.com/olehlong/jwtd/blob/master/dub.json

Is that expected? Maybe I did something wrong though so I'll try again tonight.

Cheers!

Re: Dub "subConfiguration" dependencies

Am 12.11.2015 um 15:53 schrieb punkUser:

This is indeed planned to be revised for the next release:
#361

Currently you'll have to dub remove botan to avoid it getting chosen.

Ah interesting. I did try removing botan but it would still always get pulled back in by JWT, even though the dependency is part of the subconfiguration:
https://github.com/olehlong/jwtd/blob/master/dub.json

Is that expected? Maybe I did something wrong though so I'll try again tonight.

Cheers!

Hm, I'll have to verify, but maybe you'll also have to remove it from
dub.selections.json afterwards.