rdmd bug?

spir denis.spir at gmail.com
Mon Dec 20 01:09:20 PST 2010


On Mon, 20 Dec 2010 04:27:33 +0300
Nick Voronin <elfy.nv at gmail.com> wrote:

> On Mon, 20 Dec 2010 01:24:02 +0100
> CrypticMetaphor <CrypticMetaphor88 at gmail.com> wrote:
> 
> > Anyway, the problem is, if I call rdmd from outside the folder in which 
> > the main source resides in, and main includes another file in that 
> > folder, I get an error.
> 
> > // If I'm in a shell, and I do this, I get an error:
> > ...\projectfolder>rdmd src\main.d
> > src\main.d(2): Error: module test is in file 'test.d' which cannot be read
> > import path[0] = C:\D\dmd2\windows\bin\..\..\src\phobos
> > import path[1] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
> 
> > Anyway, I want to be able to compile with rdmd from a different folder, 
> > is this a bug? or should I use a different tool? :-S
> > *aahhh*
> 
> Add -Ifullpath_to_projectfolder\src. It's the way it works IMHO, if you import something it must be relative to search path or to current dir. There may be a better way (replace current dir with the dir where source is, but it will take away control), but this works.
> 
> There is a bug though, I can't make it work with -Irelative_path_to_src. Looks like .deps contain paths relative to where rdmd was ran, while dmd interprets them as paths relative to where .deps file is.

Yes, I think it cannot work, since -I is a option of dmd, not of rdmd. rdmd just passes by options to dmd if I understand correctly. What you want is to influence a feature provided dy rdmd, not dmd, namely automatic inclusion of (non-standard) imports.
But sure, it may be a bug: rdmd should look for imports using pathes relative to the location of the (app) module it is given. Or, for simplicity, we can just state it must be called from this location.

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d-learn mailing list