[fpc-pascal] fpc in symlinked directory
Michael Van Canneyt
michael at freepascal.org
Wed Mar 26 18:47:06 CET 2014
On Wed, 26 Mar 2014, Mattias Gaertner wrote:
> Here is a summarize so far:
>
> When the compiler is started in a directory with a symlink, the
> directory is resolved and used for error messages and debug info.
> All other directories are not resolved.
> If you want fpc to use only unresolved paths, you can start fpc in
> a directory without sources. But this requires adapting all relative
> paths, which can not be done automatically in general.
>
> GetCurrentDir always returns the resolved physical file name.
The compiler does not do anything special: it determines its current
working directory using the RTL, meaning it gets the resolved current
working directory.
Additionally, source filenames in debug info are relative to (it seems)
the current working directory.
Meanwhile I tested the IDE, and indeed the paths are passed using full paths.
I am glad this is so, and wonder how long I've been in the dark erroneously :(
In that case, may I suggest to leave the 'Show relative paths' unchecked
by default in the "show options" dialog (or save its state)?
It will then by default match the parameters as they are actually passed to the compiler.
It seems then that the relative filenames in the debug info are the cause of the IDE
opening the same file twice when using symlinks.
Since this is a major annoyance I think this behaviour should become configurable in FPC.
Michael.
More information about the fpc-pascal
mailing list