00:17:39  * deep-book-gk_joined
00:19:05  * deep-book-gk_part
00:41:36  * DarkGodquit (Ping timeout: 260 seconds)
01:05:41  * erlbot--quit (Remote host closed the connection)
01:05:49  * erlbot--joined
02:18:04  <volga629>I found the issue
02:18:54  <volga629>I was need add to make make %{?_smp_mflags} LUA_BUILD_TYPE=System WITH_LUA_ENGINE=Lua
02:19:22  <volga629>but the issue how I can port to which lua binary to use
02:19:49  <volga629>on system /usr/bin/lua is 5.3 and /usr/bin/lua-5.1
02:20:34  <volga629>LUA_V=%{luacompatver}
02:20:42  <volga629>which 5.1
02:20:44  <volga629>is
02:46:17  <volga629>I have this script
02:46:18  <volga629>https://paste.fedoraproject.org/paste/LnVRHotlXS0yHKEm~wlscg
02:47:23  <volga629>how to make luv listen for request and return constructed HTTP header based on rc
02:49:04  <SinisterRectus>if you only have luv, you need to use a tcp socket for http requests + the necessary codec
02:49:30  <SinisterRectus>look at how luvit and lit do it with the http module or coro-http
02:51:02  <volga629>you mean this
02:51:02  <volga629>ocal http = require("http")
02:51:16  <volga629>local http = require("http")
02:55:53  <volga629>I tried last time with luvit and there are was issue to find path for external modules
02:58:53  <SinisterRectus>were you using an old version of luvit again
02:59:18  <volga629>not really
02:59:39  <volga629>lua-luvit-2.14.2-3.fc25.x86_64
03:15:57  <volga629>with luvit I get no field package.preload['lua_ip']
03:57:42  <volga629>still get it right
03:57:47  <volga629>can't
04:06:40  <volga629>How with luv handle HTTP request
04:33:07  <volga629>for luvit I can adjust system path for modules
04:33:09  <volga629>package.path = package.path .. ";/usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.1/?.so"
04:33:52  <volga629>but still can't load lua_ip properly
04:35:17  <volga629>error loading module 'lua_ip' from file '/usr/lib64/lua/5.3/lua_ip.so':
04:35:30  <volga629>usr/lib64/lua/5.3/lua_ip.so:1: unexpected symbol near 'char(127)'
04:36:04  <volga629>still missing something
04:37:35  <squeek502>you need to use package.cpath
04:37:38  <squeek502>not package.path
04:37:46  <squeek502>its trying to load it as a lua script
04:37:49  <squeek502>rather than a binary module
04:39:17  <squeek502>volga629
04:40:11  <volga629>[string "bundle:deps/require.lua"]:279: No such module 'lua_ip' in '/home/volga629/ip.lua'
04:40:11  <volga629>multiple Lua VMs detected
04:40:19  <volga629>that with cpath
04:41:42  <volga629>this script https://paste.fedoraproject.org/paste/w-8gWj9R81k9VDJx2yuUiA check PgSQL node status
04:41:51  <squeek502>paste the line that you're using to modify cpath
04:42:18  <volga629>luvit should play role of web service
04:42:23  <volga629>1 line
04:42:41  <volga629>package.cpath = package.cpath .. ";/usr/lib64/lua/5.3/?.so;/usr/lib64/lua/5.1/?.so"
04:42:50  <squeek502>strange, that should work
04:42:58  <squeek502>multiple lua vms detected might be due to lua being compared statically rather than shared, though
04:43:33  <squeek502>or are you using a luvit binary?
04:43:46  <volga629>yes
04:43:54  <volga629>2.14 I think
04:44:35  <volga629>this error
04:44:35  <volga629>https://paste.fedoraproject.org/paste/FZP1ymPhxCjO2GDEkxqmeQ
04:46:03  <squeek502>yeah looks like its a misleading error
04:46:19  <squeek502>luvit's require is failing when it falls back to lua's require
04:46:31  <squeek502>the .so is being found but its causing the multiple Lua VM error
04:46:52  <squeek502>im not very familiar with that error on linux
04:47:08  <squeek502>but i know on windows lua needs to be compiled as a .dll to avoid it
04:47:20  <volga629>never so it either
04:48:51  <volga629>is possible achieve same with luv ?
04:48:56  <squeek502>here's some info: http://lua.2524044.n2.nabble.com/C-Lua-modules-not-compatible-with-every-Lua-interpreter-td7647522.html
04:50:30  <squeek502>potentially possible with luv, you could use lit's luvit-loader.lua to allow luvit-style requires
04:50:31  <squeek502>https://github.com/luvit/lit/blob/master/luvit-loader.lua
04:51:35  <volga629>hmmm
04:51:41  <squeek502>a good example of that can be found here: https://github.com/creationix/simple-http-server
04:52:35  <squeek502>would be possible to run that with normal lua and luv built as a lua module
04:54:27  <volga629>in my case just give HTTP header with reply 200 or 503 with some message
04:55:17  <squeek502>your current code should still work without many changes
04:55:47  <squeek502>would just need to add luvit-loader.lua to your project files
04:56:16  <squeek502>and add dofile("luvit-loader.lua") to the top of your ip.lua
04:56:44  <volga629>let me try
04:57:16  <squeek502>then you should be able to do lua ip.lua
04:57:52  <volga629>lua: ip.lua:4: module 'http' not found:
04:57:54  <squeek502>as long as luv.so is available and you have a uv.lua that works as an alias for luv.so (which is setup if you install luv from luarocks)
04:58:21  <volga629>luv.so is in place
04:58:52  <volga629>uv = require('luv') that in place
04:59:15  <squeek502>can you paste the full error for 'http' not found?
05:00:06  <volga629>oh I don't need load http anymore, because it for luvit
05:00:27  <squeek502>if you need to use http, you still need it
05:00:34  <volga629>?https://paste.fedoraproject.org/paste/crkFIt3Qv6QfN6ESCPomww
05:00:41  <volga629>that full error
05:01:05  <volga629>is luvit-loader.lua should +x ?
05:01:08  <volga629>be
05:01:13  <squeek502>dont think so
05:01:26  <squeek502>ip.lua is in /home/volga629/?
05:02:04  <squeek502>oh wait, i know why
05:02:21  <squeek502>you need to install any luvit packages you need
05:03:38  <volga629>lhttps://paste.fedoraproject.org/paste/UQzD~HWpDOvQYEXfJ4juPw
05:03:42  <squeek502>if you have lit, run
05:03:46  <squeek502>lit install luvit/http
05:03:59  <squeek502>in /home/volga629
05:04:21  <volga629>done
05:04:22  <volga629>done: success
05:04:37  <squeek502>now try running ip.lua
05:04:55  <volga629>lua: /home/volga629/deps/net.lua:34: module 'uv' not found:
05:05:57  <squeek502>add a file uv.lua
05:05:58  <squeek502>with
05:06:03  <squeek502>return require('luv')
05:07:01  <squeek502>might want to put it in /home/volga629/deps actually
05:08:39  <volga629>lua: /home/volga629/deps/http.lua:41: module 'luvi' not found:
05:09:32  <squeek502>wow thats a silly dependency
05:09:40  <squeek502>edit deps/http.lua
05:09:47  <squeek502>and remove local luvi = require('luvi')
05:09:59  <squeek502>and modify this line
05:10:00  <squeek502> ClientRequest._defaultUserAgent = 'luvit/http luvi/' .. luvi.version
05:10:12  <squeek502>to remove luvi.version
05:13:09  <volga629>that worked no error, but still no listener
05:13:30  <squeek502>ah you also need to start the uv loop manually
05:13:43  <squeek502>put uv.run()
05:13:46  <squeek502>at the bottom of ip.lua
05:14:41  <volga629>lua: ip.lua:89: attempt to index a nil value (global 'uv')
05:14:46  <volga629>look like need load it
05:14:50  <squeek502>yeah
05:14:58  <squeek502>local uv = require('uv')
05:15:06  <squeek502>somewhere in ip.lua
05:16:00  <volga629>that better curl: (18) transfer closed with 40 bytes remaining to read
05:16:30  <volga629>Uncaught Error: /home/volga629/deps/stream/stream_readable.lua:805: attempt to index a nil value (global 'process')
05:17:13  <squeek502>ah, looks like luvit's libraries assume luvit's runtime environment more than i thought
05:17:21  <volga629>https://paste.fedoraproject.org/paste/WWz9ntoozBw0IGpD51iT3A
05:19:02  <squeek502>you can try doing
05:19:06  <squeek502>lit install luvit/process
05:19:13  <squeek502>and then putting
05:19:14  <squeek502>_G.process = require('process').globalProcess()
05:19:21  <squeek502>in ip.lua
05:20:19  <volga629>some deps again
05:20:19  <volga629>lua: /home/volga629/deps/process.lua:36: module 'env' not found:
05:23:07  <squeek502>not actually sure where that comes from
05:24:01  <squeek502>hm its from luvi
05:24:02  <squeek502>:/
05:26:10  <volga629>trying to find what is env
05:26:22  <squeek502>its built into luvi's c code
05:26:29  <squeek502>loaded as a built-in module
05:26:35  <volga629>or I see
05:26:37  <volga629>oh
05:26:42  <squeek502>looks like it shouldnt matter for your purposes though
05:26:47  <squeek502>if you edit deps/process.lua
05:26:59  <squeek502>and change
05:27:01  <squeek502>local env = require('env')
05:27:05  <squeek502>to something like
05:27:07  <squeek502>local env = {}
05:27:12  <squeek502>that might fix it
05:28:05  <volga629>another error
05:28:06  <volga629> Connect to server using a web browser.
05:28:06  <volga629>Uncaught Error: /home/volga629/deps/stream/stream_readable.lua:116: attempt to call a nil value (field 'getn')
05:29:10  <squeek502>what version of lua are you using?
05:29:15  <squeek502>table.getn might not exist?
05:29:20  <volga629>5.3
05:30:04  <volga629>The function table.getn is deprecated!
05:30:06  <volga629>?
05:30:12  <volga629>is this possible
05:30:27  <squeek502>yeah looks like it was removed in 5.3
05:30:53  <squeek502>change deps/stream/stream_readable.lua line 116
05:30:55  <squeek502>from return table.getn(buf)
05:31:00  <squeek502>to return #buf
05:31:12  <volga629>ok total
05:32:02  <volga629>lua: /home/volga629/deps/stream/stream_writable.lua:359: attempt to call a nil value (field 'getn')
05:32:15  <squeek502>haha same thing in there
05:32:22  <squeek502>change any table.getn(x) to #x
05:32:35  <volga629> table.getn(state.buffer) ~= 0 then
05:32:48  <squeek502>#state.buffer ~= 0 then
05:32:59  <squeek502>there are two in that file
05:33:17  <squeek502>line 251 and line 359
05:34:22  <volga629>here are too
05:34:23  <volga629> while c <= table.getn(state.buffer) do
05:34:39  <squeek502>while c <= #state.buffer do
05:35:18  <squeek502>wow there's actually a lot in stream_writable.lua
05:35:29  <volga629>if c <= table.getn(state.buffer)
05:37:24  <volga629>yes this file contain a lot of entries
05:37:28  <squeek502>try this: https://paste.fedoraproject.org/paste/Bw0O2wMttEzJdCdD7SbOtw
05:38:21  <volga629>right now no errors
05:38:22  <volga629>PgSQL node canldev01-fedora25 is offline
05:39:28  <squeek502>https://hastebin.com/yesijehozi.lua
05:42:34  <volga629>that worked
05:42:48  <squeek502>:)
05:42:50  <volga629>I need think how to package all this into rpm
05:42:59  <volga629>YES, THANK YOU
05:43:24  <squeek502>you're welcome, surprised we got it working
05:44:34  <volga629>all lua in deps I can put some directory and I can use path to find it ?
05:45:02  <volga629>I just need package it to rpm
05:45:24  <squeek502>im not familiar with rpm
05:45:27  <squeek502>i mostly use windows :(
05:46:33  <volga629>I am just talking about remove deps directory and try use it in like /usr/share/myproject
05:46:36  <squeek502>i think the deps folder needs to be in the same directory as ip.lua
05:46:54  <volga629>then use path
05:46:58  <volga629>to find it
05:47:04  <volga629>let me try
05:47:21  <squeek502>it might be possible, im not sure
05:47:54  <squeek502>if it is you might not need luvit-loader.lua anymore
05:48:19  <squeek502>since those files would be loaded using lua's default require loader
05:49:27  <squeek502>(just fyi) luvit-loader.lua's purpose is to be able to load from deps/libs folders like luvit
05:50:08  <volga629>or I see
05:50:31  <volga629>so I can do /usr/share/myproject and put deps inside
05:50:40  <volga629>should work
05:51:02  <squeek502>no, because luvit-loader only looks based on the currently executing file
05:51:24  <squeek502>so if require is called from /some/dir/ip.lua
05:51:51  <squeek502>then luvit-loader will look in /some/dir/deps, /some/dir/libs, /some/deps, /some/libs, /deps, /libs
05:52:20  <volga629> I see
05:52:25  <squeek502>it doesnt use package.path
05:52:52  <squeek502>but you might be able to just load everything without luvit-loader
05:53:12  <squeek502>if you put everything from deps into some path thats in package.path
05:53:22  <squeek502>lua's require might be able to load everything still
05:53:57  <volga629>package.path you mean in system path
05:54:24  <squeek502>i forget how lua's package.path gets set
05:54:38  <squeek502>i dont think its based on the system path
05:54:53  <squeek502>unless you set LUA_PATH
05:54:55  <squeek502>then it uses that
05:54:58  <squeek502>i think
05:55:43  <squeek502>but package.path is whats important
05:56:01  <squeek502>thats what lua uses to look for things when require is called
05:56:11  <volga629>in fedora case it is
05:56:12  <volga629> /usr/share/lua/5.3/
05:56:23  <volga629>that where ?.lua
05:56:47  <squeek502> /usr/share/lua/5.3/?.lua
05:56:49  <squeek502>like that?
05:56:55  <volga629>yes
05:57:14  <squeek502>yeah so if you put everything from deps into /usr/share/lua/5.3
05:57:15  <squeek502>that might work
05:57:18  <volga629>I am going try move deps to /usr/share/lua/5.3/myproject
06:01:06  <volga629>no didn't worked
06:01:07  <volga629>lua: /usr/share/lua/5.3/myproject/net.lua:38: module 'stream' not found:
06:01:42  <squeek502>yeah it's looking in /usr/share/lua/5.3/myproject/deps/ probably
06:01:58  <volga629>in /usr/share/lua/5.3/myproject/libs
06:02:20  <volga629>yes
06:02:20  <volga629>no file '/usr/share/lua/5.3/myproject/deps/stream'
06:02:21  <squeek502>yeah those are pretty much the same thing
06:02:37  <squeek502>it treats those two folder names the same way
06:06:05  <volga629>if try(pathJoin(dir, "deps", path)) or
06:06:05  <volga629> try(pathJoin(dir, "libs", path)) then
06:08:02  <volga629>I changed this "deps", to "myproject",
06:08:06  <volga629>and i works
06:08:07  <volga629>it
06:21:23  <volga629>again thank for all help
06:21:50  <volga629>loader will stay. I will try package tomorrow
06:31:53  * rendarjoined
07:33:01  * DarkGodjoined
07:38:03  * squeek502_joined
07:38:52  * squeek502quit (Ping timeout: 240 seconds)
07:47:08  * DarkGodquit (Ping timeout: 240 seconds)
08:01:48  * DarkGodjoined
08:17:31  * DarkGodquit (Ping timeout: 255 seconds)
08:19:12  * DarkGodjoined
08:34:26  * DarkGodquit (Ping timeout: 246 seconds)
09:21:46  * CapsAdminquit (Ping timeout: 276 seconds)
09:23:40  * DarkGodjoined
09:27:12  * CapsAdminjoined
13:55:34  * SkyRocknRolljoined
13:59:33  * SkyRocknRollquit (Max SendQ exceeded)
14:00:42  * SkyRocknRolljoined
15:03:49  * SkyRocknRollquit (Ping timeout: 255 seconds)
15:16:00  * SkyRocknRolljoined
16:52:43  * SkyRocknRollquit (Ping timeout: 255 seconds)
17:06:05  * SkyRocknRolljoined
17:44:02  * SkyRocknRollquit (Remote host closed the connection)
18:19:27  * rendarquit (Quit: std::lower_bound + std::less_equal *works* with a vector without duplicates!)
19:49:50  * rje_quit (Remote host closed the connection)
19:50:44  * rjejoined
19:54:19  * songgaoquit (Ping timeout: 268 seconds)
20:06:00  * songgaojoined
20:12:20  * rjequit (Quit: Leaving...)
20:17:36  * rjejoined
20:32:38  * rjequit (Quit: Leaving...)
20:33:01  * rjejoined
20:53:11  * rjequit (Quit: Leaving...)
20:53:31  * rjejoined
20:54:05  * rjequit (Client Quit)
20:55:14  * rjejoined
20:57:03  * rjequit (Client Quit)
20:57:38  * rjejoined
21:10:19  * rjequit (Quit: Leaving...)
21:10:40  * rjejoined
21:15:37  * rjequit (Quit: Leaving...)
21:15:52  * rjejoined
21:18:43  * rjequit (Client Quit)
21:19:02  * rjejoined