[fpc-pascal] fpc in symlinked directory

Michael Van Canneyt michael at freepascal.org
Wed Mar 26 16:19:53 CET 2014



On Wed, 26 Mar 2014, Mattias Gaertner wrote:

> On Wed, 26 Mar 2014 15:19:29 +0100 (CET)
> Michael Van Canneyt <michael at freepascal.org> wrote:
>
>> [...]
>> I tested, and indeed:
>>
>> # include_directories
>>          .ascii  "../../tmp/link\000"
>>
>> I think this is an error in FPC, because the linker file contains full paths:
>>
>> INPUT(
>> /usr/local/lib/fpc/2.7.1/units/x86_64-linux/rtl/prt0.o
>> /tmp/link/p.o
>> /usr/local/lib/fpc/2.7.1/units/x86_64-linux/rtl/system.o
>> ...
>>
>> The two should at least match; and you will not be surprised to hear that
>> I think the linker file is correct :)
>
> Well, the /tmp/link is a logical, not a physical path. So I'm not yet
> sure, why you think that physical cwd is the "only correct" way, but
> it's ok for all other to be logical. Isn't that inconsistent?

Not in the least:

Like I said, it is the difference between 'where am i' and 'how do I get here'.

CWD is clearly 'where am i'. It is a location. 
Making CWD return 'how did I get to this location' is wrong.

Symlinks make 'getting somewhere' easier, they provide shortcuts.
Their use is convenient, but no more than that.

(yes, I know you can do some other nifty tricks with them)

>> Did I say I was against symlinks ? No. I use them a lot, and all the time.
>>
>> They're just typing shortcuts, for convenience.
>
> You can do more with symlinks than that. Famous examples:
> /tmp -> /var/tmp or the links in /lib.

Sure. All of them specify how to get somewhere. No problem with that.

>> So, if I open (because it is faster)
>>
>> /home/michael/lazarus/lazarus.lpi
>>
>> and then the IDE caption tells me I have actually opened
>>
>> /home/michael/projects/lazarus/lazarus.lpi
>>
>> I will only be happy.
>
> And bash users will report it as a bug.

<quip>
Bash users should be bashed on the head till they understand symlinks :)
Why do you think I use tcsh ? 
</quip>

Seriously: I think the analogy using 'where am I' and 'how did I get here' 
expresses best my view on the whole issue.

Michael.



More information about the fpc-pascal mailing list