lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Sep 28, 2017 at 10:37 PM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Russell Haley once stated:
>> On Thu, Sep 28, 2017 at 2:51 PM, Sean Conner <sean@conman.org> wrote:
>> >
>> >   If you don't feel like install my modules [3] you can probably get
>> > something similar with lposix or luafilesystem or something.
>> >
>> > [2]     Found a resource leak (well, kind of, the GC doesn't kick in as
>> >         often as it should) dealing with reading directories.  Ah, large
>> >         data ...  how well you find bugs!
>> >
>> > [3]     https://github.com/spc476/lua-conmanorg
>>
>> I had to man-handle your makefile to build on freebsd and cut out the
>> net module due to errors (https://pastebin.com/yHARr5Gc), but I got it
>> to compile and install. However, there is no conman.table. I looked
>> and I found table.lua in the repo, but not in the installed directory.
>> I copied table.lua over and replaced your require. The final output
>> was a "bus error".  I didn't see anything immediately and draw the
>> line at going through your C code. :P
>
>   I don't have access to a FreeBSD system to diagnose this, but I suspect
> I'm missing some #define or header file for the networking stuff.  I'm not
> surprised that "make install" failed for some of the modules---I use Lua
> (the standalone Lua executable) to find the appropriate directory [1] and
> that looks to have failed.
>
>   I'm also not surprised at the bus error (well, I am that it was a bus
> fault and not a segfault, but I'm not surprised it crashed) because I had to
> "fix" the bug I mentioned and had not yet commited the change.  It only
> happens on a deeply nested directory structure (which my program defaults to
> $HOME).
>
>   Quite a few of the modules in the repo are ... um ... still being worked
> on [4].  Those I feel comfortable with have rockspecs.
>
>> I hope to get to play with conman a little later. Your cbor stuff sounds neat.
>
>   Thank you.  That makefile is a bit better written.
>
>   -spc
>
> [1]     The two lines in the makefile are:
>
>         LUADIR := $(prefix)/share/lua/$(shell lua -e "print(_VERSION:match '^Lua (.*)')")
>         LIBDIR := $(prefix)/lib/lua/$(shell lua -e "print(_VERSION:match '^Lua (.*)')")
>
>         I should probably make these:
>
>         LUA         = lua
>         prefix      = /usr/local
>         datarootdir = $(prefix)/share
>         libdir      = $(prefix)/lib
>
>         LUADIR := $(DESTDIR)$(datarootdir)/lua/$(shell $(LUA) -e "print(_VERSION:match 'Lua (.*)')")
>         LIBDIR := $(DESTDIR)$(libdir)/lua($(shell $(LUA) -e "print(_VERSION:match '^Lua (.*)')")

Yup, that's what I did (LUAEXEC).

Here is the man-handled uname test (not sure if the -shared is required):

ifeq ($(UNAME),FreeBSD)
  CC     = cc
  CFLAGS = -I /usr/local/include/lua53
  LFLAGS =
  SHARED = -fPIC -shared
#lib/net.so : LDLIBS = -lsocket -lnsl
endif

>         But I got lazy 8-/
>
> [2]     See above.
>
> [3]     See above.
>
> [4]     I have another repo that isn't published yet that is even more so.
>
>