On Sun, 03 Feb 2013 10:42:33 +0000
Mark Morgan Lloyd <markmll.laza...@telemetry.co.uk> wrote:

> Mattias Gaertner wrote:
> 
> >>> 1. Why should the compiler report a wrong path?
> >> That's not quite what I said. You pointed out that the IDE was 
> >> converting the relative path to an absolute one which is what the 
> >> compiler sees, the compiler reports an absolute path in any error 
> >> message, and by the time it sees that the IDE's forgotten that it's 
> >> already got the file open.
> > 
> > Sorry. You lost me.
> 
> Well, I obviously accept that I'm Doing It Wrong, and that having 
> symlinked directories in the search path is ill-advised (which to my 
> mind is unfortunate).

Many people use symlinked directories without problems.


> I honestly don't want to bang on about this to the 
> extent that I appear boorish, but I'll try once more in the interest of 
> highlighting something which I think is a problem.
> 
> The project file is /usr/local/src/heavywethers/trunk/heavywethers.lpi 
> and the program file is in the same directory. One of the files it's 
> referencing is dbconfig2.pas (internal name DbConfigCode2), which is in 
> the absolute directory /usr/local/src/inifiles/trunk accessed via a 
> symlinked directory and the project's "Other unit files" setting as 
> ./inifiles/trunk.

I guess you mean "../inifiles/trunk", which resolves
to "/usr/local/src/heavywethers/inifiles/trunk/".

To avoid misunderstanding: When I'm talking about "absolute filename" I
meant everything that starts with a /. No matter if a part contains a
symlink or mount point.

The project (i.e. IDE and compiler)
uses /usr/local/src/heavywethers/inifiles/trunk/dbconfig2.pas.

 
> If I force an error into this file and force all files to be saved, when 
> I run the compilation I see
> 
> [TCompiler.Compile] CmdLine="/usr/local/bin/ppc386-2.6.0  -MObjFPC 
> -Scagi -O1 -g -gl -vewnhi -Se3 -Fi/usr/local/share/lazarus-trunk/ide 
> -Fl/opt/gnome/lib -Fu/usr/local/src/heavywethers/inifiles/trunk
> ..
> Compiling HeavyWethers.lpr
> Compiling /usr/local/src/heavywethers/inifiles/trunk/dbconfigcode2.pas

Good.

 
> but I now have two tabbed panes in my source editor: "DbConfigCode2" and 
> "DbConfigCode2(2)" with the latter focussed.

And that's where you loose me. 
Why should /usr/local/src/inifiles/trunk/dbconfigcode2.pas be open in
the editor? From the project's point of view it is an unrelated file.


> If I fix the error on the 
> focussed pane, force save-all, and hit compile I get an immediate 
> dialogue "Some files have changed on disk:" 
> "/usr/local/src/inifiles/trunk/dbconfigcode2.pas". I can fix that by 
> selecting "Reload from disk" *provided* that I've done manual saves 
> after every change, If I don't force the saves then the most recent 
> edits might be lost.

Well, with some work it is possible to find out if two symlinked files are the 
same under Unix and improve the messages.
It is not possible in general to find duplicates. For example with
network shares or special file systems.

 
> The second tabbed pane should not, to my mind, be opened: the file 
> already exists on the screen, and the only reason that the IDE thinks 
> it's not is that it's not kept track of the fact that it's canonicalised 
> the path when it passed it to the compiler. Also the dialogue should not 
> pop up: all changes have already been flushed to disk but the IDE hasn't 
> adequately realised that.

It must pop up the file given by the compiler. That is the one in the
project and is therefore parsed with the project settings, the other
is not. The two files share only sectors on the disk.

As I wrote:
You can use linked directories, but within a project you can use
only one of them.

Mattias
 

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to