GNU bug report logs - #72867
[PATCH] gexp: Make 'local-file' follow symlinks.

Previous Next

Package: guix-patches;

Reported by: Nigko Yerden <nigko.yerden <at> gmail.com>

Date: Thu, 29 Aug 2024 06:10:01 UTC

Severity: normal

Tags: patch

Full log


Message #35 received at 72867 <at> debbugs.gnu.org (full text, mbox):

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Nigko Yerden <nigko.yerden <at> gmail.com>
Cc: 72867 <at> debbugs.gnu.org
Subject: Re: [PATCH v3] gexp: Make 'local-file' follow symlinks.
Date: Tue, 03 Sep 2024 17:05:44 +0200
Hello Nigko.

Nigko Yerden <nigko.yerden <at> gmail.com> writes:
> This patch is the result of collective work of
> Florian Pelz <pelzflorian <at> pelzflorian.de> and
> Nigko Yerden <nigko.yerden <at> gmail.com>

Thanks for the credit, but it would be unusual to mention me in the
commit message, where discussion does not count.

Please do not put me in the commit message; I made no code contribution.

I also would favor to simplify `current-source-directory' and not add an
optional follow-symlinks? argument.  I believe processing profiles is
the only reasonable case that unconditionally following symlinks would
break, and people do not do profile processing in outside code.

> * tests/gexp.scm ("local-file, load through symlink"): New test.

This one is a good test; but it tests only half, namely the
rare-in-practice case of `local-file' when loading a Scheme file.  Here,
`current-source-directory' evaluate file-name to
"/tmp/guix-directory.VxrxZT/dir/link-to-code.scm", which has a slash as
prefix, so absolute-dirname is not called.

The original issue is that the package in a channel according to
cookbook’s “The Repository as a Channel” cannot be built when the
load-path is set up in the usual way.  There, absolute-dirname gets
called.  I think we would need a (very similar) test that covers this.

Instead of primitive-load, we would need to invoke Guile on a file in a
channel or in the GUILE_LOAD_PATH, or set %load-path.  I may be wrong
here and do not know how, but we definitely should cover when
`file-name' in is not prefixed with a slash.

Regards,
Florian




This bug report was last modified 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.