www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dub should be more command-line oriented

reply =?UTF-8?B?THXDrXM=?= Marques <luis luismarques.eu> writes:
I often feel that dub relies too much on dub.[json|sdl] and too 
little on command-line switches. Here's the latest example:

1) Write code
2) Start refactoring code
3) Compile and run to check the partially implemented change
4) dub gives a warning; the warning is expected due to the 
incomplete change; I don't care about it right now, I just want 
to check that something related to that change works
5) Because of the warning, dub doesn't even finish building the 
project
6) I want to force dub to build it, but there's no switch for that
7) I have to go check the docs for what is the dub.json setting 
that allows warnings (it's "buildRequirements": ["allowWarnings"])
8) I change dub.json
9) I compile it again

universe 1:
10) I finish the refactoring
11) I forget to remove the new setting

universe 2:
10) I remove "allowWarnings" immediately
11) while trying to do another intermediate testing step, I get 
another warning
12) goto 7 or 8
Jan 10
next sibling parent Joakim <dlang joakim.fea.st> writes:
On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
 I often feel that dub relies too much on dub.[json|sdl] and too 
 little on command-line switches. Here's the latest example:

 [...]
You're welcome to submit a pull for a command-line flag or a new build mode or however you best envision this fixed: https://github.com/dlang/dub/pulls
Jan 10
prev sibling next sibling parent Computermatronic <computermatronic gmail.com> writes:
On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
 I often feel that dub relies too much on dub.[json|sdl] and too 
 little on command-line switches. Here's the latest example:

 [...]
You could just make a refactoring configuration and use the --config flag to specify it when necessary. (see: https://code.dlang.org/package-format?lang=json#configurations)
Jan 10
prev sibling next sibling parent JN <666total wp.pl> writes:
On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
 universe 1:
 10) I finish the refactoring
 11) I forget to remove the new setting

 universe 2:
 10) I remove "allowWarnings" immediately
 11) while trying to do another intermediate testing step, I get 
 another warning
 12) goto 7 or 8
universe 3: a newcomer to the project wants to build it with as little effort as possible: 1) git clone from github 2) dub build - fails 3) read through readme to find some special commandline switches that need to be added / find some shell script (Linux only) hidden in build directory 4) finally build the project I think files have the advantage of explicitly specifying the dependencies. Relying on commandline switches is more risky and often such switches land in platform-specific shell scripts which are harder to maintain.
Jan 11
prev sibling parent reply Seb <seb wilzba.ch> writes:
On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
 I often feel that dub relies too much on dub.[json|sdl] and too 
 little on command-line switches. Here's the latest example:

 1) Write code
 2) Start refactoring code
 3) Compile and run to check the partially implemented change
 4) dub gives a warning; the warning is expected due to the 
 incomplete change; I don't care about it right now, I just want 
 to check that something related to that change works
 5) Because of the warning, dub doesn't even finish building the 
 project
 6) I want to force dub to build it, but there's no switch for 
 that
 7) I have to go check the docs for what is the dub.json setting 
 that allows warnings (it's "buildRequirements": 
 ["allowWarnings"])
 8) I change dub.json
 9) I compile it again

 universe 1:
 10) I finish the refactoring
 11) I forget to remove the new setting

 universe 2:
 10) I remove "allowWarnings" immediately
 11) while trying to do another intermediate testing step, I get 
 another warning
 12) goto 7 or 8
It's not well documented, but you can always overwrite DUB with DFLAGS: DFLAGS="-dw" dub It will give you a warning though, but it's justified as you might have `DFLAGS` set accidentally.
Jan 11
parent timotheecour <timothee.cour2 gmail.com> writes:
On Thursday, 11 January 2018 at 15:37:20 UTC, Seb wrote:
 On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques
 It's not well documented, but you can always overwrite DUB with 
 DFLAGS:

 DFLAGS="-dw" dub

 It will give you a warning though, but it's justified as you 
 might have `DFLAGS` set accidentally.
does that really work? DFLAGS="-wi" dub build --vverbose dmd -c ... -wi -w ... => -wi is overridden
Feb 12