View previous topic :: View next topic |
Author |
Message |
luismarques
Joined: 25 Dec 2006 Posts: 5
|
Posted: Mon Dec 25, 2006 10:38 am Post subject: path problem |
|
|
Hello,
I have a directory structure somewhat like this
Code: |
<dir> build
<dir> doc
<dir> src
<dir> foo
main.d
config.d
bud.exe
|
The following does not work:
Code: |
>bud -odbuild -Tlua src\foo\main.d
src\foo\main.d(3): module config cannot read file 'foo\config.d'
|
But the following works:
Code: |
src> ..\bud -od..\build -T..\foo foo\main.d
|
Perhaps the first case should be tweaked to work? It seems like a bug to me.
Also, I think I should point out: initially I had a batch file that called dmd.exe with the full path, instead of having dmd in the PATH. When I tried bud, it spew "unable to find 'sc.ini'". So I skimmed the docs looking how to configure a sc.ini file. Eventually (by hunch) I fixed the issue by putting dmd.exe in the PATH. Perhaps that message could changed to something like "cannot find compiler 'dmd.exe' in path nor configuration file 'sc.ini'"?
Best regards, keep it up! |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Mon Dec 25, 2006 1:02 pm Post subject: |
|
|
You need to include -Isrc to your command line. |
|
Back to top |
|
|
luismarques
Joined: 25 Dec 2006 Posts: 5
|
Posted: Mon Dec 25, 2006 2:06 pm Post subject: |
|
|
Carlos wrote: | You need to include -Isrc to your command line. |
Thank you, Carlos.
Still, in my view, bud should be able to deduce the correct path without further command line options. Is there really a reason against that?
Best regards and happy xmas. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Mon Dec 25, 2006 7:25 pm Post subject: Re: path problem |
|
|
luismarques wrote: | Hello,
I have a directory structure somewhat like this
Code: |
<dir> build
<dir> doc
<dir> src
<dir> foo
main.d
config.d
bud.exe
|
The following does not work:
Code: |
>bud -odbuild -Tlua src\foo\main.d
src\foo\main.d(3): module config cannot read file 'foo\config.d'
|
But the following works:
Code: |
src> ..\bud -od..\build -T..\foo foo\main.d
|
Perhaps the first case should be tweaked to work? It seems like a bug to me. |
Well I dispute the bug claim as it was never specified to do that so its not failing to meet specifications (i.e. a Bug). The problem is with DMD as imports are never relative to the file doing the importing; they are only relative to entries in the Import Path list (-I). However, I think you are asking for Bud to automatically add certain entries to the import list.
For example, if the command says "src\foo\main.d" then Bud should add "<PWD>\src" and "<PWD>\src\foo" to the Import Path list. (Where <PWD> refers to the current working directory.
Note that Bud already does something like this. If an import statement is "import abc\def\ghi;" then Bud adds "<PWD>\abc" and "<PWD>\abc\def" to the import path list.
I think that this is a good idea so I'll add it to the tool.
luismarques wrote: | Also, I think I should point out: initially I had a batch file that called dmd.exe with the full path, instead of having dmd in the PATH. When I tried bud, it spew "unable to find 'sc.ini'". So I skimmed the docs looking how to configure a sc.ini file. Eventually (by hunch) I fixed the issue by putting dmd.exe in the PATH. Perhaps that message could changed to something like "cannot find compiler 'dmd.exe' in path nor configuration file 'sc.ini'"?
|
Bud actually does check that the compiler exists, however it does that after scanning for the sc.ini file. So I should probably swap the order of scanning. First scan for the compiler then scan for sc.ini. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
|