Subject: [bug#72867] [PATCH v6] gexp: Make 'local-file' follow symlinks.

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Sun, 06 Oct 2024 09:09:00 +0200

My reply was lacking.  I accidentally deleted footnote
[1] https://git.savannah.gnu.org/cgit/guile.git/tree/

Ludovic Courtès <[email-masked]> writes:
>> --- a/guix/utils.scm
>> +++ b/guix/utils.scm
>> @@ -1121,11 +1121,7 @@ (define absolute-dirname
>>      (match (search-path %load-path file)
>>        (#f #f)
>>        ((? string? file)
>> -       ;; If there are relative names in %LOAD-PATH, FILE can be relative and
>> -       ;; needs to be canonicalized.
>> -       (if (string-prefix? "/" file)
>> -           (dirname file)
>> -           (canonicalize-path (dirname file)))))))
>> +       (dirname (canonicalize-path file))))))
>
> Am I right that we cannot keep the ‘if’ here, as it would perform
> “lexical” dot-dot resolution instead of Unix resolution (accounting for
> symlinks), right?

Yes, exactly.

Does not the mlambda Ludo had put in absolute-dirname resolve all
canonicalize-path concerns?  There are many patches, but all have the
same file.

Regards,
Florian