Subject: Re: [bug#72867] when should local-file and current-source-directory not follow symlinks?

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Sat, 31 Aug 2024 19:10:05 +0200

Nigko Yerden <[email-masked]> writes:
> Attila Lendvai wrote:
>> pardon my ignorance, but can you give me a (plausible) example when
>> someone wants to load some files relative to a source file, and also
>> wants to be conscious of symlinks, and chose not to follow them? let
>> alone making that the default anywhere around such operations?
> No, I can't give you an example. The original 'current-source-directory' was
> designed not to follow symlinks. This wasn't my idea. By setting the default
> I just keep the original behavior.

I guess not following symlinks was not design but an oversight.

Profiles like .config/guix/current have lots of symlinks.  Perhaps
behavior might change when custom code is processing profiles.

If we ignored possible custom code breakage, this patch could be
simplified, but not to a one-liner, as it canonicalizes paths in both
`current-source-directory' (when not in the load-path) and
`absolute-dirname' (when in the load-path).

Regards,
Florian