GNU bug report logs - #44662
Lua search paths

Previous Next

Package: guix;

Reported by: raingloom <raingloom <at> riseup.net>

Date: Sun, 15 Nov 2020 18:29:02 UTC

Severity: normal

Merged with 25425

To reply to this bug, email your comments to 44662 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#44662; Package guix. (Sun, 15 Nov 2020 18:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to raingloom <raingloom <at> riseup.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 15 Nov 2020 18:29:02 GMT) Full text and rfc822 format available.

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

From: raingloom <raingloom <at> riseup.net>
To: Guix Bugs <bug-guix <at> gnu.org>
Subject: Lua search paths
Date: Sun, 15 Nov 2020 19:24:41 +0100
I have a very WIP branch adding search paths to Lua.
https://git.sr.ht/~raingloom/guix-source/tree/raingloom/lua

The problem is that Lua uses a different path format compared to most
packages. Instead of a list of directories, it is a list of path
patterns, each potentially containing a question mark ('?'), which gets
substituted for the module being searched.

For pure Lua modules, this basically means /lib/lua/5.3/?.lua and
/lib/lua/5.3/?/init.lua.
I am not aware of any practical use of paths that do not contain a '?',
so there is a relatively easy solution here:
use the string.gsub function to expand every path component that does
not contain a '?' into two components, the ?.lua and the ?/init.lua one.
This means externally defined components are not expanded, only the
ones defined by Guix.

For C modules, it's a bit trickier, because there is a special
component that looks into loadall.so, which I must admit I'm not
familiar with. As far as I know, popular modules all define their own
shared object file, never a loadall.so.

Also, the path is separated by semicolons, not colons, but I think Guix
can already handle that.

The approaches I see:
- patch loadlib.c in Lua to expand LUA_PATH and LUA_CPATH according to
  the above mentioned heuristics, or
- patch Guix to support paths of this format
- define something like GUIX_LUA_PATH that gets expanded on its own and
  only contains Lua modules defined in Guix, and then gets appended to
  package.path (and do the same for package.path)


Solving this would open up access to the huge variety of Lua modules
and make things like game development in LÖVE much better integrated.
Its users could even use `guix pack` to distribute their games.




Information forwarded to bug-guix <at> gnu.org:
bug#44662; Package guix. (Fri, 26 Mar 2021 09:30:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: raingloom <raingloom <at> riseup.net>
Cc: 44662 <at> debbugs.gnu.org
Subject: Re: bug#44662: Lua search paths
Date: Fri, 26 Mar 2021 10:28:03 +0100
Hi,

On Sun, 15 Nov 2020 at 19:24, raingloom <raingloom <at> riseup.net> wrote:
> I have a very WIP branch adding search paths to Lua.
> https://git.sr.ht/~raingloom/guix-source/tree/raingloom/lua
>
> The problem is that Lua uses a different path format compared to most
> packages. Instead of a list of directories, it is a list of path
> patterns, each potentially containing a question mark ('?'), which gets
> substituted for the module being searched.

From my understanding, it is a duplicate to
<<http://issues.guix.gnu.org/issue/25425>.  Does it make sense to merge
them?


All the best,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#44662; Package guix. (Fri, 26 Mar 2021 20:37:01 GMT) Full text and rfc822 format available.

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

From: raingloom <raingloom <at> riseup.net>
To: 44662 <at> debbugs.gnu.org
Subject: Re: bug#44662: Lua search paths
Date: Fri, 26 Mar 2021 21:29:49 +0100
On Fri, 26 Mar 2021 10:28:03 +0100
zimoun <zimon.toutoune <at> gmail.com> wrote:

> Hi,
> 
> On Sun, 15 Nov 2020 at 19:24, raingloom <raingloom <at> riseup.net> wrote:
> > I have a very WIP branch adding search paths to Lua.
> > https://git.sr.ht/~raingloom/guix-source/tree/raingloom/lua
> >
> > The problem is that Lua uses a different path format compared to
> > most packages. Instead of a list of directories, it is a list of
> > path patterns, each potentially containing a question mark ('?'),
> > which gets substituted for the module being searched.  
> 
> From my understanding, it is a duplicate to
> <<http://issues.guix.gnu.org/issue/25425>.  Does it make sense to
> merge them?
> 
> 
> All the best,
> simon

Yup, a merge seems to be in order.




Merged 25425 44662. Request was from zimoun <zimon.toutoune <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 26 Mar 2021 22:53:02 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 77 days ago.

Previous Next


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