how to specify a default configuration in a library's dub.json? (i.e if the use doesn't not have subConfigurations)

mw mingwu at gmail.com
Wed May 26 22:24:40 UTC 2021


On Wednesday, 26 May 2021 at 00:25:17 UTC, Mike Parker wrote:
> On Wednesday, 26 May 2021 at 00:19:23 UTC, mw wrote:
>> Hi,
>>
>> I just did a build fix, and added two configurations to 
>> thrift's dub.json (whose   "targetType": "library")
>>
>> https://github.com/apache/thrift/pull/2397/files
>>
>> I want to know how to specify a default configuration in the 
>> library's dub.json? (i.e if the use doesn't not have 
>> subConfigurations).
>>
>> Then the existing library user does not have to change his 
>> app's dub.json when he do `dub upgrade`.
>>
>> Thanks.
>
> The first configuration in the file is the default.


Hi,

I'm having trouble with this PR right now.

     
https://github.com/apache/thrift/pull/2397#issuecomment-849103620
     """
     src/thrift/internal/ssl.d(100): Error: static assert:  "Must 
have version either use_openssl_1_0_x or use_openssl_1_1_x 
defined, e.g.
     	"subConfigurations": {
     		"apache-thrift": "use_openssl_1_0"
     	}"
     Makefile:1292: recipe for target 'libthriftd-ssl.a' failed
     make[4]: *** [libthriftd-ssl.a] Error 1
     make[4]: *** Waiting for unfinished jobs....
     make[4]: Leaving directory '/thrift/src/lib/d'
     Makefile:895: recipe for target 'all-recursive' failed
     """

The default configuration is not picked up in the build process,

https://github.com/apache/thrift/pull/2397/files#diff-1b617af56e869773e32ce59329f25b2db5d8b3c5151519919c7c10266b4d78fcR15

     ```
       "configurations": [
         {
           "name": "use_openssl_1_0",
           "versions": ["use_openssl_1_0_x"],
           "dependencies": {
             "openssl": {
               "version": "~>1.1.6"
             }
           }
         },
     ```

i.e. the version use_openssl_1_0_x is not defined.

Anyone know how I can fix this?


BTW, is the version string quote causing the problem: 
"use_openssl_1_0_x" is defined as a version string in the 
dub.json, but in the code:

https://github.com/apache/thrift/pull/2397/files#diff-731671345667ab400d85c10e38fb33ed0c39b1e4d6b38456949284e4e1f47b66R93

I'm checking it as:

     ```
       version(use_openssl_1_0_x) {  // without the quote "", 
should I have string quote here?
       }
     ```


Thanks!


More information about the Digitalmars-d-learn mailing list