Dub build failure

jerome jegaultier at gmail.com
Sun Oct 4 22:27:50 UTC 2020

On Sunday, 4 October 2020 at 20:25:48 UTC, Andre Pany wrote:
> On Sunday, 4 October 2020 at 18:45:34 UTC, jerome wrote:
>> I am trying to compile a simple lib, and a simple demo using 
>> this lib.
>> [...]
> If I am not wrong there is following issue: in D a package is a 
> folder. Having the package.d file as child of folder source is 
> not correct. Moving the file package.d into folder 
> source/dterrent/ should solve the issue.
> Kind regards
> Andre

Hi Andre,

your solution solved the problem. Thanks.

Reading again the error message, with the solution at hand, I 
think your answer may be completed. I explain:
The message was:

source/app.d(9,8): Error: module dterrent is in file 'dterrent.d' 
which cannot be read

I think dub looked for a dterrent.d file in registered paths. 
Then it also looked for a dterrent directory in paths, possibly 
verifying that a package.d file was present in that directory. 
Finding neither nor, it concluded that the module should have 
been in an eponymous dterrent.d file somewhere, and displayed 
that ambiguous error message.

So it seems that dub does not parse any file looking for the line 
"module dterrent;" as I thought. It just looks for a file or 
directory named dterrent(.d) Maybe it also verify that an 
eponymous folder has a package.d, in this case we can say "a 
folder must have a normative package.d file".

Thanks again for your fast answer.

More information about the Digitalmars-d-learn mailing list