dub icon indicating copy to clipboard operation
dub copied to clipboard

debugMode wrongly documented

Open p0nce opened this issue 4 years ago • 2 comments
trafficstars

The build option debugMode is wrongly documented.

https://github.com/dlang/dub/blob/cdf858029d8a6fa9052b49c0f82bb0ed02bf9690/source/dub/compilers/buildsettings.d#L354 It says "Compile in debug mode (enables contracts, -debug)"

But all it does is enabling -debug

and what the debug flag is doing is NOT enabling contracts: https://p0nce.github.io/d-idioms/#So-what-does--debug-do,-exactly?

From DMD command line: "compile in debug code" This is the only thing that -debug does: debug clauses, and debug identifiers.

p0nce avatar Aug 09 '21 22:08 p0nce

Edited with permalink (press y to get it - It also displays code inline).

The way I understand this, the intent is for it to be a "debug mode" (literally). AFAIK, contracts are enabled when debugMode is used, because they are enabled by default. In which case does debugMode not lead to contracts being enabled ?

Geod24 avatar Aug 09 '21 23:08 Geod24

You can have BuildOptions.debugMode and BuildOptions.releaseMode at once, and the second disable the contracts.

p0nce avatar Aug 09 '21 23:08 p0nce