From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#25425: cannot express search path Date: Sun, 22 Jan 2017 22:56:29 +0100 Message-ID: <87d1feep2q.fsf@gnu.org> References: <87shoo7dgx.fsf@mdc-berlin.de> <87r34879o1.fsf@elephly.net> <87bmvc2vjn.fsf@gnu.org> <87lgug72vc.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVQ8H-0006rJ-EU for bug-guix@gnu.org; Sun, 22 Jan 2017 16:57:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVQ8E-0000UV-Bu for bug-guix@gnu.org; Sun, 22 Jan 2017 16:57:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:40316) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cVQ8E-0000UN-8a for bug-guix@gnu.org; Sun, 22 Jan 2017 16:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cVQ8E-00067x-1Y for bug-guix@gnu.org; Sun, 22 Jan 2017 16:57:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87lgug72vc.fsf@elephly.net> (Ricardo Wurmus's message of "Thu, 12 Jan 2017 15:46:15 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ricardo Wurmus Cc: 25425@debbugs.gnu.org Hello! Ricardo Wurmus skribis: > Ludovic Court=C3=A8s 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.