GNU bug report logs - #25425
lua does not set search paths

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Ricardo Wurmus <rekado@HIDDEN>; merged with #44662; dated Thu, 12 Jan 2017 10:58:02 UTC; Maintainer for guix is bug-guix@HIDDEN.
Merged 25425 44662. Request was from zimoun <zimon.toutoune@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 25425 <at> debbugs.gnu.org:


Received: (at 25425) by debbugs.gnu.org; 24 Mar 2021 22:31:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 24 18:31:30 2021
Received: from localhost ([127.0.0.1]:36338 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lPC2E-0000t2-9g
	for submit <at> debbugs.gnu.org; Wed, 24 Mar 2021 18:31:30 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:41844)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1lPC2C-0000so-Tz
 for 25425 <at> debbugs.gnu.org; Wed, 24 Mar 2021 18:31:29 -0400
Received: by mail-wr1-f51.google.com with SMTP id b9so346865wrt.8
 for <25425 <at> debbugs.gnu.org>; Wed, 24 Mar 2021 15:31:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=FHinleyZxpftRyTFcG97+4GF7F7g5DR31ciwnCcLL1M=;
 b=gUCUleCD2krW/msMPdAcOp9n9tN9mA6t07y7KmZhCMCywFNHOmiH0mOauV+96jQCs1
 tSve4+bFalMCN5f72z82uyrcH4ZUJ+IDvgFKCfpNAcoOa5BupsstowKr2oisJ2ffQzDQ
 Y2iEdbWpDQjqUB0i7wfRZZle3MkZysyODYM32f/pRkS1um6xJFY1PASaW6c26EnqhRSd
 qBkRjlvPOqaB5D+3a5/YeK75VqahTqV5qIaMlOISZ3sVoMoL32WhB1Sy2iim/xG9RV2p
 8wgO+VW9bKB+TII6qcTGTEYwlmBft5huNhyTjDDc3DlXyo6Del41d1AcuW39xKfjs03b
 KSag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=FHinleyZxpftRyTFcG97+4GF7F7g5DR31ciwnCcLL1M=;
 b=CZDtrF8HkxmPNwcCaVkrIMH9dGQzsewv3CPOhXrkVEJGaHuJe9CSw9v2Vj1HSJbSvu
 RwFa0aP16WzdqL9gLoEJVFs97i0UVHtr7IOMHzo0++LwUrjJLmtNEhKOCz2pW7RFo0OH
 udSs0ZJ/xCwySpwB6JQYSrbR2CkVYKtSH7n2zk0IXyto8xHuxgwJGqSuiAFG6Kc04tsS
 jJ0mp+fOdTpZUpSie2GFoJBBujnAkkYZ7mrXJKJ/1EWoJ7q7brR/K+rfEoGjnih9W3Os
 y3AA8aoYFWk19wHQGJoUY58T5JCsn8d7bEUejmOumtj52sOqOGGlOmcPAiiYHEJGD55W
 T6cQ==
X-Gm-Message-State: AOAM533RHpqoZFKFQWVmAcoLZUYJuX7TYCUcUs10BBku3q/WLzyLbVhy
 IqcMQ90/z4U2xmIwJOrGaOWwDqwCaPM=
X-Google-Smtp-Source: ABdhPJzE2wE1J0ZIoL+HprAC6Mtp8yKi0BiQ4skaceJ/ZbGbR8KjzywAeh9+3Prv8o103KN2V0p8iQ==
X-Received: by 2002:a5d:58c9:: with SMTP id o9mr5716703wrf.181.1616625083009; 
 Wed, 24 Mar 2021 15:31:23 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id i17sm4878101wrp.77.2021.03.24.15.31.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 24 Mar 2021 15:31:22 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#25425: cannot express search path
References: <87shoo7dgx.fsf@HIDDEN> <87r34879o1.fsf@HIDDEN>
 <87bmvc2vjn.fsf@HIDDEN> <87lgug72vc.fsf@HIDDEN>
 <87d1feep2q.fsf@HIDDEN> <874m0q2087.fsf@HIDDEN>
Date: Wed, 24 Mar 2021 23:27:16 +0100
In-Reply-To: <874m0q2087.fsf@HIDDEN> (Ricardo Wurmus's message of "Sun,
 22 Jan 2017 23:34:00 +0100")
Message-ID: <86r1k49ohn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 25425
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 25425 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

This is an old bug about Lua and search path.

  <http://issues.guix.gnu.org/issue/25425>

It is still unsolved:

--8<---------------cut here---------------start------------->8---
$ guix environment -C --ad-hoc lua lua-lpeg -- lua
Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio
> require('lpeg')
stdin:1: module 'lpeg' not found:
	no field package.preload['lpeg']
	no file '/usr/local/share/lua/5.3/lpeg.lua'
	no file '/usr/local/share/lua/5.3/lpeg/init.lua'
	no file '/usr/local/lib/lua/5.3/lpeg.lua'
	no file '/usr/local/lib/lua/5.3/lpeg/init.lua'
	no file './lpeg.lua'
	no file './lpeg/init.lua'
	no file '/usr/local/lib/lua/5.3/lpeg.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './lpeg.so'
stack traceback:
	[C]: in function 'require'
	stdin:1: in main chunk
	[C]: in ?
>
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ guix environment -C --ad-hoc lua lua-lpeg
[env]$ export LUA_PATH=3D"$GUIX_ENVIRONMENT/share/lua/5.3/?.lua;$GUIX_ENVIR=
ONMENT/share/lua/5.3/?/?.lua"
[env]$ export LUA_CPATH=3D"$GUIX_ENVIRONMENT/lib/lua/5.3/?.so;$GUIX_ENVIRON=
MENT/lib/lua/5.3/?/?.so"
[env]$ lua
Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio
> require('lpeg')
table: 0x23fd510
>
--8<---------------cut here---------------end--------------->8---


On Sun, 22 Jan 2017 at 23:34, Ricardo Wurmus <rekado@HIDDEN> wrote:
> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
>> Ricardo Wurmus <rekado@HIDDEN> skribis:
>>> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
>>>
>>>> I think this should work:
>>>>
>>>>        (search-path-specification
>>>>          (variable "LUA_PATH")
>>>>          (separator ";")
>>>>          (files '("share/lua/5.3"))
>>>>          (file-pattern "\\.lua$")
>>>>          (file-type 'regular))
>>>
>>> I tried this very same thing but it doesn=E2=80=99t work because Lua ex=
pects
>>> placeholders (=E2=80=9C?=E2=80=9D) in the search paths.  The placeholde=
rs are replaced
>>> with the actual package names.  If the actual file name does not exist
>>> it will try the next pattern.  If the file *does* exist =E2=80=93 which=
 *will* be
>>> the case for any of the files on LUA_PATH that have been generated by
>>> the search-path-specification =E2=80=94 Lua will try to load the packag=
e from
>>> that path.
>>>
>>> This will fail because a search for the =E2=80=9Clpeg=E2=80=9D module w=
ould be satisfied
>>> by the file =E2=80=9Cre.lua=E2=80=9D, because that=E2=80=99s the first =
valid file on the
>>> LUA_PATH.  =E2=80=9Cre.lua=E2=80=9D requires =E2=80=9Clpeg=E2=80=9D its=
elf, so another lookup is
>>> performed, which will again result in =E2=80=9Cre.lua=E2=80=9D to be lo=
aded=E2=80=A6
>>>
>>> AIUI we must generate a value for LUA_PATH that keeps the placeholders
>>> intact.
>>
>> So are you saying that it=E2=80=99s important for the question marks to =
remain
>> intact?
>
> Yes, that seems to be the case.
>
>> This sounds terrible.  I=E2=80=99m not sure how to address it, and I don=
=E2=80=99t feel
>> like stretching the search path mechanism this much.
>>
>> Thoughts?
>
> I agree.  It=E2=80=99s a really odd special case.  On the other hand, not
> extending the search path mechanism would mean that we have to find
> other ways to fix =E2=80=9Cguix environment=E2=80=9D, build phases, and p=
rofiles when
> Lua packages are involved.
>
> Build phases are easy to fix (by using a procedure that sets the
> appropriate environment variables depending on the build inputs), but I
> don=E2=80=99t know how to make profiles behave the way they should.  Mayb=
e it
> would be fine to set a single value for LUA_PATH (and LUA_CPATH) that
> assumes a single prefix (the profile path) and contains the necessary
> placeholders.

Is it fixable?


All the best,
simon






Information forwarded to bug-guix@HIDDEN:
bug#25425; Package guix. Full text available.

Message received at 25425 <at> debbugs.gnu.org:


Received: (at 25425) by debbugs.gnu.org; 22 Jan 2017 22:34:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 22 17:34:17 2017
Received: from localhost ([127.0.0.1]:38554 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cVQiG-0000I8-TP
	for submit <at> debbugs.gnu.org; Sun, 22 Jan 2017 17:34:17 -0500
Received: from sender163-mail.zoho.com ([74.201.84.163]:21009)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1cVQiE-0000Hy-3F
 for 25425 <at> debbugs.gnu.org; Sun, 22 Jan 2017 17:34:14 -0500
Received: from localhost (xd9ba26ac.dyn.telefonica.de [217.186.38.172]) by
 mx.zohomail.com with SMTPS id 1485124446321189.09644048515645;
 Sun, 22 Jan 2017 14:34:06 -0800 (PST)
References: <87shoo7dgx.fsf@HIDDEN> <87r34879o1.fsf@HIDDEN>
 <87bmvc2vjn.fsf@HIDDEN> <87lgug72vc.fsf@HIDDEN>
 <87d1feep2q.fsf@HIDDEN>
User-agent: mu4e 0.9.18; emacs 25.1.1
From: Ricardo Wurmus <rekado@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#25425: cannot express search path
In-reply-to: <87d1feep2q.fsf@HIDDEN>
Date: Sun, 22 Jan 2017 23:34:00 +0100
Message-ID: <874m0q2087.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.2 (/)
X-Debbugs-Envelope-To: 25425
Cc: 25425 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.2 (/)


Ludovic Courtès <ludo@HIDDEN> writes:

> Hello!
>
> Ricardo Wurmus <rekado@HIDDEN> skribis:
>
>> Ludovic Courtès <ludo@HIDDEN> writes:
>>
>>> I think this should work:
>>>
>>>        (search-path-specification
>>>          (variable "LUA_PATH")
>>>          (separator ";")
>>>          (files '("share/lua/5.3"))
>>>          (file-pattern "\\.lua$")
>>>          (file-type 'regular))
>>
>> I tried this very same thing but it doesn’t work because Lua expects
>> placeholders (“?”) in the search paths.  The placeholders are replaced
>> with the actual package names.  If the actual file name does not exist
>> it will try the next pattern.  If the file *does* exist – which *will* be
>> the case for any of the files on LUA_PATH that have been generated by
>> the search-path-specification — Lua will try to load the package from
>> that path.
>>
>> This will fail because a search for the “lpeg” module would be satisfied
>> by the file “re.lua”, because that’s the first valid file on the
>> LUA_PATH.  “re.lua” requires “lpeg” itself, so another lookup is
>> performed, which will again result in “re.lua” to be loaded…
>>
>> AIUI we must generate a value for LUA_PATH that keeps the placeholders
>> intact.
>
> So are you saying that it’s important for the question marks to remain
> intact?

Yes, that seems to be the case.

> This sounds terrible.  I’m not sure how to address it, and I don’t feel
> like stretching the search path mechanism this much.
>
> Thoughts?

I agree.  It’s a really odd special case.  On the other hand, not
extending the search path mechanism would mean that we have to find
other ways to fix “guix environment”, build phases, and profiles when
Lua packages are involved.

Build phases are easy to fix (by using a procedure that sets the
appropriate environment variables depending on the build inputs), but I
don’t know how to make profiles behave the way they should.  Maybe it
would be fine to set a single value for LUA_PATH (and LUA_CPATH) that
assumes a single prefix (the profile path) and contains the necessary
placeholders.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





Information forwarded to bug-guix@HIDDEN:
bug#25425; Package guix. Full text available.

Message received at 25425 <at> debbugs.gnu.org:


Received: (at 25425) by debbugs.gnu.org; 22 Jan 2017 21:56:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 22 16:56:42 2017
Received: from localhost ([127.0.0.1]:38515 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cVQ7t-00067L-Px
	for submit <at> debbugs.gnu.org; Sun, 22 Jan 2017 16:56:41 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46917)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1cVQ7s-000674-Dp
 for 25425 <at> debbugs.gnu.org; Sun, 22 Jan 2017 16:56:40 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1cVQ7k-00008d-96
 for 25425 <at> debbugs.gnu.org; Sun, 22 Jan 2017 16:56:35 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45312)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1cVQ7k-00008W-5k; Sun, 22 Jan 2017 16:56:32 -0500
Received: from reverse-83.fdn.fr ([80.67.176.83]:37290 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1cVQ7j-0001DE-GM; Sun, 22 Jan 2017 16:56:31 -0500
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#25425: cannot express search path
References: <87shoo7dgx.fsf@HIDDEN> <87r34879o1.fsf@HIDDEN>
 <87bmvc2vjn.fsf@HIDDEN> <87lgug72vc.fsf@HIDDEN>
Date: Sun, 22 Jan 2017 22:56:29 +0100
In-Reply-To: <87lgug72vc.fsf@HIDDEN> (Ricardo Wurmus's message of "Thu,
 12 Jan 2017 15:46:15 +0100")
Message-ID: <87d1feep2q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -8.2 (--------)
X-Debbugs-Envelope-To: 25425
Cc: 25425 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -8.2 (--------)

Hello!

Ricardo Wurmus <rekado@HIDDEN> skribis:

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
>
>> I think this should work:
>>
>>        (search-path-specification
>>          (variable "LUA_PATH")
>>          (separator ";")
>>          (files '("share/lua/5.3"))
>>          (file-pattern "\\.lua$")
>>          (file-type 'regular))
>
> I tried this very same thing but it doesn=E2=80=99t work because Lua expe=
cts
> placeholders (=E2=80=9C?=E2=80=9D) in the search paths.  The placeholders=
 are replaced
> with the actual package names.  If the actual file name does not exist
> it will try the next pattern.  If the file *does* exist =E2=80=93 which *=
will* be
> the case for any of the files on LUA_PATH that have been generated by
> the search-path-specification =E2=80=94 Lua will try to load the package =
from
> that path.
>
> This will fail because a search for the =E2=80=9Clpeg=E2=80=9D module wou=
ld be satisfied
> by the file =E2=80=9Cre.lua=E2=80=9D, because that=E2=80=99s the first va=
lid file on the
> LUA_PATH.  =E2=80=9Cre.lua=E2=80=9D requires =E2=80=9Clpeg=E2=80=9D itsel=
f, so another lookup is
> performed, which will again result in =E2=80=9Cre.lua=E2=80=9D to be load=
ed=E2=80=A6
>
> AIUI we must generate a value for LUA_PATH that keeps the placeholders
> intact.

So are you saying that it=E2=80=99s important for the question marks to rem=
ain
intact?

This sounds terrible.  I=E2=80=99m not sure how to address it, and I don=E2=
=80=99t feel
like stretching the search path mechanism this much.

Thoughts?

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#25425; Package guix. Full text available.

Message received at 25425 <at> debbugs.gnu.org:


Received: (at 25425) by debbugs.gnu.org; 12 Jan 2017 14:46:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 12 09:46:27 2017
Received: from localhost ([127.0.0.1]:50740 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cRge3-0005nV-5t
	for submit <at> debbugs.gnu.org; Thu, 12 Jan 2017 09:46:27 -0500
Received: from sender163-mail.zoho.com ([74.201.84.163]:21097)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1cRge1-0005nM-Kv
 for 25425 <at> debbugs.gnu.org; Thu, 12 Jan 2017 09:46:26 -0500
Received: from localhost (xd933e5de.dyn.telefonica.de [217.51.229.222]) by
 mx.zohomail.com with SMTPS id 1484232379732247.56501610128362;
 Thu, 12 Jan 2017 06:46:19 -0800 (PST)
References: <87shoo7dgx.fsf@HIDDEN> <87r34879o1.fsf@HIDDEN>
 <87bmvc2vjn.fsf@HIDDEN>
User-agent: mu4e 0.9.18; emacs 25.1.1
From: Ricardo Wurmus <rekado@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#25425: cannot express search path
In-reply-to: <87bmvc2vjn.fsf@HIDDEN>
Date: Thu, 12 Jan 2017 15:46:15 +0100
Message-ID: <87lgug72vc.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 25425
Cc: 25425 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)


Ludovic Courtès <ludo@HIDDEN> writes:

> I think this should work:
>
>        (search-path-specification
>          (variable "LUA_PATH")
>          (separator ";")
>          (files '("share/lua/5.3"))
>          (file-pattern "\\.lua$")
>          (file-type 'regular))

I tried this very same thing but it doesn’t work because Lua expects
placeholders (“?”) in the search paths.  The placeholders are replaced
with the actual package names.  If the actual file name does not exist
it will try the next pattern.  If the file *does* exist – which *will* be
the case for any of the files on LUA_PATH that have been generated by
the search-path-specification — Lua will try to load the package from
that path.

This will fail because a search for the “lpeg” module would be satisfied
by the file “re.lua”, because that’s the first valid file on the
LUA_PATH.  “re.lua” requires “lpeg” itself, so another lookup is
performed, which will again result in “re.lua” to be loaded…

AIUI we must generate a value for LUA_PATH that keeps the placeholders
intact.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
http://elephly.net





Information forwarded to bug-guix@HIDDEN:
bug#25425; Package guix. Full text available.

Message received at 25425 <at> debbugs.gnu.org:


Received: (at 25425) by debbugs.gnu.org; 12 Jan 2017 14:38:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 12 09:38:18 2017
Received: from localhost ([127.0.0.1]:50724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cRgWA-0005aN-4x
	for submit <at> debbugs.gnu.org; Thu, 12 Jan 2017 09:38:18 -0500
Received: from eggs.gnu.org ([208.118.235.92]:55962)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1cRgW9-0005a8-6u
 for 25425 <at> debbugs.gnu.org; Thu, 12 Jan 2017 09:38:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1cRgVy-0004P7-QS
 for 25425 <at> debbugs.gnu.org; Thu, 12 Jan 2017 09:38:11 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38541)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1cRgVy-0004P2-Mx; Thu, 12 Jan 2017 09:38:06 -0500
Received: from [193.50.110.111] (port=60774 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1cRgVy-0000Na-4x; Thu, 12 Jan 2017 09:38:06 -0500
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#25425: cannot express search path
References: <87shoo7dgx.fsf@HIDDEN> <87r34879o1.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 23 =?utf-8?Q?Niv=C3=B4se?= an 225 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-unknown-linux-gnu
Date: Thu, 12 Jan 2017 15:38:04 +0100
In-Reply-To: <87r34879o1.fsf@HIDDEN> (Ricardo Wurmus's message of "Thu,
 12 Jan 2017 13:19:26 +0100")
Message-ID: <87bmvc2vjn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -8.2 (--------)
X-Debbugs-Envelope-To: 25425
Cc: 25425 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -8.2 (--------)

Ricardo Wurmus <rekado@HIDDEN> skribis:

> It seems that the =E2=80=9Csearch-path-specification=E2=80=9D cannot be u=
sed to include
> placeholders such as =E2=80=9C?=E2=80=9D as required by LUA_PATH and LUA_=
CPATH.  The
> search paths in Lua are not directories and they are not actual file
> names.

Indeed.

> I suggest adding an optional =E2=80=9Cplaceholder=E2=80=9D field to
> =E2=80=9Csearch-path-specification=E2=80=9D, which would hold a string li=
ke =E2=80=9C?/?.lua=E2=80=9D in
> this case.

I think this should work:

       (search-path-specification
         (variable "LUA_PATH")
         (separator ";")
         (files '("share/lua/5.3"))
         (file-pattern "\\.lua$")
         (file-type 'regular))

See libxml2 for an example with similar requirements.

HTH!

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#25425; Package guix. Full text available.

Message received at 25425 <at> debbugs.gnu.org:


Received: (at 25425) by debbugs.gnu.org; 12 Jan 2017 12:19:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 12 07:19:35 2017
Received: from localhost ([127.0.0.1]:50686 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cReLv-0000Ua-Ha
	for submit <at> debbugs.gnu.org; Thu, 12 Jan 2017 07:19:35 -0500
Received: from sender163-mail.zoho.com ([74.201.84.163]:21146)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1cReLt-0000UO-SU
 for 25425 <at> debbugs.gnu.org; Thu, 12 Jan 2017 07:19:34 -0500
Received: from localhost (xd933e5de.dyn.telefonica.de [217.51.229.222]) by
 mx.zohomail.com with SMTPS id 1484223570289778.6713834002436;
 Thu, 12 Jan 2017 04:19:30 -0800 (PST)
User-agent: mu4e 0.9.18; emacs 25.1.1
From: Ricardo Wurmus <rekado@HIDDEN>
To: 25425 <at> debbugs.gnu.org
Subject: cannot express search path
Date: Thu, 12 Jan 2017 13:19:26 +0100
Message-ID: <87r34879o1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 25425
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

It seems that the “search-path-specification” cannot be used to include
placeholders such as “?” as required by LUA_PATH and LUA_CPATH.  The
search paths in Lua are not directories and they are not actual file
names.

I suggest adding an optional “placeholder” field to
“search-path-specification”, which would hold a string like “?/?.lua” in
this case.





Information forwarded to bug-guix@HIDDEN:
bug#25425; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Jan 2017 10:57:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 12 05:57:48 2017
Received: from localhost ([127.0.0.1]:50657 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cRd4m-0006PB-C8
	for submit <at> debbugs.gnu.org; Thu, 12 Jan 2017 05:57:48 -0500
Received: from eggs.gnu.org ([208.118.235.92]:60049)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1cRd4k-0006Ow-Kf
 for submit <at> debbugs.gnu.org; Thu, 12 Jan 2017 05:57:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rekado@HIDDEN>) id 1cRd4c-0003nJ-4B
 for submit <at> debbugs.gnu.org; Thu, 12 Jan 2017 05:57:41 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38058)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <rekado@HIDDEN>) id 1cRd4c-0003mw-14
 for submit <at> debbugs.gnu.org; Thu, 12 Jan 2017 05:57:38 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50910)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rekado@HIDDEN>) id 1cRd4V-0002Mc-HO
 for bug-guix@HIDDEN; Thu, 12 Jan 2017 05:57:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rekado@HIDDEN>) id 1cRd4S-0003jI-HN
 for bug-guix@HIDDEN; Thu, 12 Jan 2017 05:57:31 -0500
Received: from sender163-mail.zoho.com ([74.201.84.163]:21111)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <rekado@HIDDEN>) id 1cRd4S-0003gj-7R
 for bug-guix@HIDDEN; Thu, 12 Jan 2017 05:57:28 -0500
Received: from localhost (xd933e5de.dyn.telefonica.de [217.51.229.222]) by
 mx.zohomail.com with SMTPS id 1484218642802280.72548184011146;
 Thu, 12 Jan 2017 02:57:22 -0800 (PST)
User-agent: mu4e 0.9.18; emacs 25.1.1
From: Ricardo Wurmus <rekado@HIDDEN>
To: "'bug-guix\@gnu.org'" <bug-guix@HIDDEN>
Subject: lua does not set search paths
Date: Thu, 12 Jan 2017 11:57:18 +0100
Message-ID: <87shoo7dgx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

The lua interpreter packages do not set native search paths, so they
cannot find lua modules.

  $ guix environment --ad-hoc lua lua-lpeg
  $ lua
  > require('lpeg')
  … ERROR …

However:

  $ guix environment --ad-hoc lua lua-lpeg
  $ export LUA_PATH="$GUIX_ENVIRONMENT/share/lua/5.3/?.lua;$GUIX_ENVIRONMENT/share/lua/5.3/?/?.lua"
  $ export LUA_CPATH="$GUIX_ENVIRONMENT/lib/lua/5.3/?.so;$GUIX_ENVIRONMENT/lib/lua/5.3/?/?.so"
  $ lua
  > require('lpeg')
  table: 0x1b80300


--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
http://elephly.net





Acknowledgement sent to Ricardo Wurmus <rekado@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#25425; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 26 Mar 2021 23:00:02 UTC

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