dub
dub copied to clipboard
dub fails to build docs if there are ddoc warnings in dependencies' source
trafficstars
System information
- dub version: 1.34.0
- OS Platform and distribution: EndeavourOS/Arch Linux x86_64
- compiler version: dmd 2.105.0
Bug Description
When building a package with -b docs, all of its dependencies are also built this way, and any warnings in them (e.g. parameter mismatches) will halt the process if the failing dependency's dub.sdl doesn't have buildRequirements "allowWarnings". Even if you add it to your own dub.sdl, it will still exit if the dependency at fault doesn't have it too. There is no way for you to build your docs until the dependency fixes its source. Not even DFLAGS=-wi seems to work.
How to reproduce?
- Create a local targetType library dub package (e.g.
a) and do--add-localto add it - Intentionally document a function in it wrong, such as a parameter count mismatch
- Create a second targetType executable dub package (e.g.
b) - Add the library package
aas a dependency tob - Build
bdocs withdub build -b docs - Get
"Error: warnings are treated as errors"due toabad ddoc
Expected Behavior
- One of...
- Dependencies' docs aren't also built? I just want
bdocs - Dependencies' docs warnings are gagged unconditionally
- A configuration
"docs"withbuildRequirements "allowWarnings"in the importing package (e.g.b) applies to dependencies' warnings too. Not ideal though. - ...
Logs
a/dub.sdl:
name "a"
description "A minimal D application."
authors "JR"
copyright "Copyright © 2023, JR"
license "proprietary"
targetType "library"
a/source/lib.d:
module a;
/++
Blah
Params:
foo = foo
bar = bar
+/
void foo(int foo) {}
b/dub.sdl:
name "b"
description "A minimal D application."
authors "JR"
copyright "Copyright © 2023, JR"
license "proprietary"
dependency "a" version="*"
buildRequirements "allowWarnings"
b/source/app.d:
void main() {}
Building b docs:
~/src/tests/b $ dub build -b docs
Starting Performing "docs" build using /usr/bin/dmd for x86_64.
Building a ~master [library]
../a/source/lib.d(10,6): Warning: Ddoc: function declaration has no parameter 'bar'
../a/source/lib.d(10,6): Warning: Ddoc: parameter count mismatch, expected 1, got 2
Error: warnings are treated as errors
Use -wi if you wish to treat warnings only as informational.
Error /usr/bin/dmd failed with exit code 1.