[prev in list] [next in list] [prev in thread] [next in thread]
List: lua-l
Subject: Re: question about vscode, luaprogramimg, require
From: lua () cdelord ! fr
Date: 2023-10-30 7:19:45
Message-ID: 844bfa7f-3243-42d0-99fc-9268b39f5ec8 () cdelord ! fr
[Download RAW message or body]
[Attachment #2 (text/plain)]
Shouldn't LUA_CPATH contain something like
"/usr/local/lib/lua/5.4/posix/sys/?.so" instead of just
"/usr/local/lib/lua/5.4/posix/sys/" ?
Le 30/10/2023 à 01:37, DENIS a écrit :
> you must set lua path/cpath inside your script lua
>
> > > >
> package.path = os.getenv("LUA_PATH")
> package.cpath = os.getenv("LUA_CPATH")
> <<<
>
> *$ export LUA_CPATH=/opt/lua; lua-5.1 -e
> 'print(os.getenv("LUA_CPATH"))' **
> *
> /opt/lua
>
>
>
>
> ---- Em Dom, 29 out 2023 15:08:46 -0300 *konstantinos Dms
> <konstantinosdms@gmail.com>* escreveu ---
>
> My > print(package.path)
> /usr/local/bin/lua;/usr/local/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?/init.lu \
> a;/usr/local/lib/lua/5.4/?.lua;/usr/local/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua
> My > print(package.cpath)
> /usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/
>
> My echo $LUA_CPATH
> /usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/
> My echo $LUA_PATH
> /usr/local/bin/lua;;
>
> my v.code:
> module 'posix.signal' not found:
> no field package.preload['posix.signal']
> no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'
> no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'
> no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'
> no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'
> no file '/home/konstantinos/Desktop/server/lua-apps/posix.so'
> no file '/home/konstantinos/Desktop/server/lua-apps/posix.so'
> on local posix = require('posix.signal'), seraches on the path i
> have my deployment folder.
>
> vscode launch.json file
>
> "configurations": [
> {
> "type": "lua",
> "request": "launch",
> "name": "Debug",
> "program": "${workspaceFolder}/lua.lua",
> "cpath": "${env:LUA_CPATH}"
> }
> ]
>
>
> Any suggestion?
>
>
>
[Attachment #3 (text/html)]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Shouldn't LUA_CPATH contain something like
"/usr/local/lib/lua/5.4/posix/sys/?.so" instead of just
"/usr/local/lib/lua/5.4/posix/sys/" ?</p>
<div class="moz-cite-prefix">Le 30/10/2023 à 01:37, DENIS a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:18b7e03f8d8.ea8813ae475384.7698792003521915854@denis.com.br">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<div
style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;">
<div>you must set lua path/cpath inside your script lua<br>
</div>
<div><br>
</div>
<div>>>></div>
<div>package.path = os.getenv("LUA_PATH")<br>
</div>
<div>package.cpath = os.getenv("LUA_CPATH")<br>
</div>
<div><<<</div>
<div><br>
</div>
<div><b>$ export LUA_CPATH=/opt/lua; lua-5.1 -e
'print(os.getenv("LUA_CPATH"))' </b><b><br>
</b></div>
<div>/opt/lua<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div class="zmail_extra_hr"
style="border-top: 1px solid rgb(204, 204, 204); height: 0px; margin-top: 10px; \
margin-bottom: 10px; line-height: 0px;"><br> </div>
<div class="zmail_extra" data-zbluepencil-ignore="true">
<div><br>
</div>
<div id="Zm-_Id_-Sgn1">---- Em Dom, 29 out 2023 15:08:46 -0300
<b>konstantinos Dms <a class="moz-txt-link-rfc2396E" \
href="mailto:konstantinosdms@gmail.com"><konstantinosdms@gmail.com></a></b> \
escreveu ---<br> </div>
<div><br>
</div>
<blockquote id="blockquote_zmail" style="margin: 0px;">
<div>
<div dir="ltr">
<p dir="auto">My > print(package.path)<br>
/usr/local/bin/lua;/usr/local/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?/init.lua; \
/usr/local/lib/lua/5.4/?.lua;/usr/local/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua<br>
My > print(package.cpath)<br>
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/</p>
<p dir="auto">My echo $LUA_CPATH<br>
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/<br>
My echo $LUA_PATH<br>
/usr/local/bin/lua;;</p>
<p dir="auto">my v.code:<br>
module 'posix.signal' not found:<br>
no field package.preload['posix.signal']<br>
no file
'/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'<br>
no file
'/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'<br>
no file
'/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'<br>
no file
'/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'<br>
no file
'/home/konstantinos/Desktop/server/lua-apps/posix.so'<br>
no file
'/home/konstantinos/Desktop/server/lua-apps/posix.so'<br>
on local posix = require('posix.signal'), seraches on
the path i have my deployment folder.</p>
<p>vscode launch.json file<br>
</p>
<div
style="font-family: "Droid Sans Mono", "monospace", monospace; \
font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre; color: \
rgb(204, 204, 204); background-color: rgb(31, 31, 31);"><div><span
class="colour" style="color: rgb(204, 204, 204);"></span><span
class="colour" style="color: rgb(156, 220, \
254);">"configurations"</span><span
class="colour" style="color: rgb(204, 204, 204);">: [</span>
</div><div><span class="colour" style="color: rgb(204, 204, 204);">{</span>
</div><div><span class="colour" style="color: rgb(204, 204, 204);"></span><span
class="colour" style="color: rgb(156, 220, 254);">"type"</span><span
class="colour" style="color: rgb(204, 204, 204);">: </span><span
class="colour" style="color: rgb(206, 145, 120);">"lua"</span><span
class="colour" style="color: rgb(204, 204, 204);">,</span>
</div><div><span class="colour" style="color: rgb(204, 204, 204);"></span><span
class="colour" style="color: rgb(156, 220, \
254);">"request"</span><span
class="colour" style="color: rgb(204, 204, 204);">: </span><span
class="colour" style="color: rgb(206, 145, \
120);">"launch"</span><span class="colour" style="color: rgb(204, 204, \
204);">,</span> </div><div><span class="colour" style="color: rgb(204, 204, \
204);"></span><span
class="colour" style="color: rgb(156, 220, 254);">"name"</span><span
class="colour" style="color: rgb(204, 204, 204);">: </span><span
class="colour" style="color: rgb(206, 145, 120);">"Debug"</span><span
class="colour" style="color: rgb(204, 204, 204);">,</span>
</div><div><span class="colour" style="color: rgb(204, 204, 204);"></span><span
class="colour" style="color: rgb(156, 220, \
254);">"program"</span><span
class="colour" style="color: rgb(204, 204, 204);">: </span><span
class="colour" style="color: rgb(206, 145, \
120);">"${workspaceFolder}/lua.lua"</span><span class="colour" style="color: \
rgb(204, 204, 204);">,</span> </div><div><span class="colour" style="color: rgb(204, \
204, 204);"></span><span
class="colour" style="color: rgb(156, 220, 254);">"cpath"</span><span
class="colour" style="color: rgb(204, 204, 204);">: </span><span
class="colour" style="color: rgb(206, 145, \
120);">"${env:LUA_CPATH}"</span> </div><div><span class="colour" style="color: \
rgb(204, 204, 204);">}</span> </div><div><span class="colour" style="color: rgb(204, \
204, 204);">]</span> </div></div>
<p><br>
</p>
<p dir="auto">Any suggestion?<br>
</p>
</div>
</div>
</blockquote>
</div>
<div><br>
</div>
</div>
<br>
</blockquote>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic