3

I'm very new to D and DUB. I'm trying to build some examples, which use some 3rd party packages managed by DUB.

The problem is that one package generates some warnings. And it seems, that by default warnings are treated as errors. So, when 3rd party lib generates warnings I cannot build my own example.

As a temporary workaround I just modified the code of the package in the DUB registry to fix the warning. But I IMHO it is not really "clean" solution. I understand, that I can manually clone the package code, fix its code (probably even send a patch or pull request later) and use local package directory. But for small simple tests it is (IMHO) too much overhead.

So, the question is: How can I ignore compiler warnings when building 3rd party packages, which comes as dependencies managed by dub?

Thanks in advance.

For reference:

  • OS: Win 7
  • DMD version: DMD32 D Compiler v2.068.0
  • DUB version: 0.9.23, built on Apr 6 2015
Dmitrii Semikin
  • 2,134
  • 2
  • 20
  • 25
  • 1
    You can use "buildRequirements": ["silenceWarnings"] to ignore warnings in your own package, but I haven't found a way to apply it to a dependency (without messing with its dub.json in the registry). – rcorre Aug 30 '15 at 12:24

2 Answers2

0

The only (and best way) is to contact the author(s) of 3rd party package(s). It does not make sense to silence warnings. In D, warnings means it will does not compile in one of future releases.

Unfortunately, there is no way how to flag package out-of-date. But it will be nice to have this feature. So my advice is to contact the authors of out dated packages, so they can update theirs code (or not) and make request to forum or issue tracker of dub package manager to add some way to put package out of date.

Kozzi11
  • 2,413
  • 12
  • 17
0

similar to the comment from rcorre you can make use of the build requirements section as documented here: https://dub.pm/package-format-json.html#build-requirements

Rather than silence them though you can specify allowWarnings which is much better.

    "buildRequirements": [
        "allowWarnings"
    ],
samael
  • 2,007
  • 1
  • 16
  • 34