lua-users home
lua-l archive

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


On Sun, Sep 10, 2017 at 12:40 AM, Marc Balmer <marc@msys.ch> wrote:
>
> Am 10.09.2017 um 08:44 schrieb Russell Haley <russ.haley@gmail.com>:
>
> Hi,
>
> I am going over the official FreeBSD Lua53 Ports collection files and
> wanted to share my thoughts. [groans from the audience] These ports
> collections contain the files that are used to patch and build
> packages on FreeBSD and are also used to power the binary build
> system. Some Ports are better than others and some fall into
> disrepair. I have agreed to (attempt) to take on the Lua53 port. The
> source files can be found here:
> https://svnweb.freebsd.org/ports/head/lang/lua53/ [1][2]
>
>
> Great that you taking care of the Lua 5.3 port.  My first remark is, that
> the
> port does not apply the fixes found on http://lua.org/bugs.html.  Maybe
> you can fix that.
>
> My synopsis so far is this: From what I can tell, the default Lua
> makefile doesn't work on FreeBSD when the freebsd target is called.
> Not surprisingly, the FreeBSD port effectively doesn't use the
> makefile from the lua tarball. It is heavily patched and it doesn't
> seem to use the FreeBSD target.
>
>
> I think it is fine to use your own Makefile (we do the same in our
> projects),
> but if you find issues with the Makefile distributed with Lua, maybe post
> it on the list, so upstream can eventually fix it.
>
> To continue, I have some observations about the "port", some of which
> I think are worth bringing up here:
>
> - files/patch-src__Makefile - This patch adds support for *.so files.
> Can I ask why there is no built in target for shared objects files in
> Lua? I am probably missing something. I checked the tarball and git. I
> also tried to look this subject up on the archives but couldn't find
> anything. The patch file is here:
> https://svnweb.freebsd.org/ports/head/lang/lua53/files/patch-src__Makefile?view=markup
>
>
> Lua is so small, it is usually statically linked.  And then, even the use of
> the dynamic linker in Lua is optional, afaict.
>
> - In the main makefile for the port, there are two post-patch
> replacements that happen. One is replacing readline with libeditline.
> Editline seems to be a default library for FreeBSD if man pages are an
> indication: https://www.freebsd.org/cgi/man.cgi?editline. This is
> noted more for interest as I think this library plus the patch that
> duane provided lends weight to the idea of Lua adding it's own library
> and dumping readline altogether.
>
>
> Isn't readline GPL?  So I understand FreeBSD using sth different.
>
> - The second post patch seems to change rand to random. My question
> is: Is this patch necessary, does it affect other platforms, and
> should it be pushed upstream?
>
>
> random() is mentioned as being a "bad random number generator" in the
> man page, so why not change it to something really random, if it absolutely
> needs be changed?
Ya, I need to look into this. I know freebsd uses Yarrow and that's
supposed to be a good thing but the details leaked out my ear right
after I read it.


> Also to consider, there are now a number of patches listed for 5.3.4
> on the bugs list. My assumption is that those are not in the official
> tarball, but ARE in the head revision of the GitHub repo? I'm trying
> to find the shortest path to a clean port file so my question is:
> would it be easier to manually assemble the patches and continue
> including a file and patching the tarball, or is there some merit to
> switching over and downloading from GitHub based on a commit?
>
>
> The patches should definitely make it into the port, they fix real, existing
> issues.
Priority numero uno. Do I apply the patches from the bug list and then
generate one patch file or is there a complete one floating around?

> In conclusion, the failure of the freebsd target in my tests and the
> heavy modification to the base makefile leads me to think it might be
> worthwhile to switch to GitHub and use the base makefile to
> springboard a separate FreeBSD  makefile altogether. Thoughts?

There may have been a tad of hyperbole in this statement. I'll keep
examining what's going on. Here is the complete build from ports (Note
the linking to pthread!):

russellh@prescott:~/FreeBSD/ports/lang/lua53% make
===>  License MIT accepted by the user
===>   lua53-5.3.4 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by lua53-5.3.4 for building
===>  Extracting for lua53-5.3.4
=> SHA256 Checksum OK for lua-5.3.4.tar.gz.
===>  Patching for lua53-5.3.4
===>  Applying FreeBSD patches for lua53-5.3.4
===>   lua53-5.3.4 depends on shared library: libedit.so.0 - found
(/usr/local/lib/libedit.so.0)
===>  Configuring for lua53-5.3.4
===>  Building for lua53-5.3.4
--- lapi.o ---
--- lcode.o ---
--- lctype.o ---
--- ldebug.o ---
--- ldo.o ---
--- ldump.o ---
--- lfunc.o ---
--- lgc.o ---
--- lapi.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lapi.c -o lapi.o
--- lcode.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lcode.c -o lcode.o
--- lctype.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lctype.c -o lctype.o
--- ldebug.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c ldebug.c -o ldebug.o
--- ldo.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c ldo.c -o ldo.o
--- ldump.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c ldump.c -o ldump.o
--- lfunc.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lfunc.c -o lfunc.o
--- lgc.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lgc.c -o lgc.o
--- llex.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c llex.c -o llex.o
--- lmem.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lmem.c -o lmem.o
--- lobject.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lobject.c -o lobject.o
--- lopcodes.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lopcodes.c -o
lopcodes.o
--- lparser.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lparser.c -o lparser.o
--- lstate.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lstate.c -o lstate.o
--- lstring.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lstring.c -o lstring.o
--- ltable.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c ltable.c -o ltable.o
--- ltm.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c ltm.c -o ltm.o
--- lundump.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lundump.c -o lundump.o
--- lvm.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lvm.c -o lvm.o
--- lzio.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lzio.c -o lzio.o
--- lauxlib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lauxlib.c -o lauxlib.o
--- lbaselib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lbaselib.c -o
lbaselib.o
--- lbitlib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lbitlib.c -o lbitlib.o
--- lcorolib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lcorolib.c -o
lcorolib.o
--- ldblib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c ldblib.c -o ldblib.o
--- liolib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c liolib.c -o liolib.o
--- lmathlib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lmathlib.c -o
lmathlib.o
--- loslib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c loslib.c -o loslib.o
--- lstrlib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lstrlib.c -o lstrlib.o
--- ltablib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c ltablib.c -o ltablib.o
--- lutf8lib.o ---
--- loadlib.o ---
--- lutf8lib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lutf8lib.c -o
lutf8lib.o
--- loadlib.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c loadlib.c -o loadlib.o
--- linit.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c linit.c -o linit.o
--- lua.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c lua.c -o lua.o
--- luac.o ---
cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC -fstack-protector
-isystem /usr/local/include -fno-strict-aliasing -I/usr/local/include
-isystem /usr/local/include -DLUA_USE_LINUX -c luac.c -o luac.o
--- liblua-5.3.so ---
--- liblua-5.3.a ---
--- liblua-5.3.so ---
cc -o liblua-5.3.so -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -pipe  -fPIC
-fstack-protector -isystem /usr/local/include -fno-strict-aliasing
-I/usr/local/include -isystem /usr/local/include -DLUA_USE_LINUX  -lm
-pthread -fstack-protector -lm -pthread -fstack-protector -shared
-Wl,-soname=liblua-5.3.so lapi.o lcode.o lctype.o ldebug.o ldo.o
ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o
lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o
lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o
lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
--- liblua-5.3.a ---
ar -crD liblua-5.3.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o
lfunc.o lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o
lstring.o ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o
lbitlib.o lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o
ltablib.o lutf8lib.o loadlib.o linit.o
ranlib liblua-5.3.a
--- lua53 ---
--- luac53 ---
--- lua53 ---
cc -o lua53  -lm -pthread -fstack-protector lua.o liblua-5.3.a -lm
-Wl,-E -L/usr/local/lib -ledit
--- luac53 ---
cc -o luac53  -lm -pthread -fstack-protector luac.o liblua-5.3.a -lm
-Wl,-E -L/usr/local/lib -ledit
===>  Staging for lua53-5.3.4
===>   Generating temporary packing list
cd src && mkdir -p
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/bin
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/include/lua53
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/lib
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/man/man1
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/share/lua/5.3
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/lib/lua/5.3
cd src && install  -s -m 555 lua53 luac53
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h
lua.hpp /usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/include/lua53
cd src && install -p -m 0644 liblua-5.3.a liblua-5.3.so
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/lib
cd doc && install -p -m 0644 lua.1 luac.1
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/man/man1
install  -m 0644
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/lua-5.3.pc
/usr/home/russellh/FreeBSD/ports/lang/lua53/work/stage/usr/local/libdata/pkgconfig
====> Compressing man pages (compress-man)

###
Linking to pthread seems in another email chain to have been
considered a bad idea.

http://lua-users.org/lists/lua-l/2017-08/msg00021.html
http://lua-users.org/lists/lua-l/2017-08/msg00028.html


>
> That makes no sense, to create a secondary Lua  repository, it only
> means you will have to keep stuff in sync with lua.org.  Also keep in
> mind, that Lua is open source, but it is not developed in the open.
>
> I would pull the tarball from lua.org, and have the patches from
> lua.org/bugs.html as local patches.
>
> To be pointed, I think the freebsd target in the Lua makefile should
> be fixed or removed. However, this is a separate discussion that
> should be had around some of the other build change possibilities in
> other threads (see the thread titled "Building Lua 5.3 from Lua.org on
> FreeBSD").
>
>
> I am all for fixing.  I am sure upstream will apply this fixes, if they make
> sense to them.
>
>
> Thanks and goodnight,
>
> Russ
>
>
> Thanks for taking care of Lua on FreeBSD; that is appreciated.
>
> - mb
>
>
> [1] *Note, you must click on the "view" link to see the files
> [2] There is a reference to an external bsd.lua.mk file which I have
> not found, but found
> https://svnweb.freebsd.org/ports/head/Mk/Uses/lua.mk (a point for
> those trying to trace).
>
>