Hi,
This is a port for Lua 5.4.0
The Lua Manual can be found here:
https://www.lua.org/manual/5.4/
Andrew Gierth has added editline and documentation options to the port.
Built and lightly tested on Ghost BSD 20 (FreeBSD 12.1 STABLE).
Paths
| Differential D14709 Authored by russ.haley_gmail.com on Mar 16 2018, 6:28 AM.
Tags
Referenced Files
Subscribers
Details
Summary Hi, This is a port for Lua 5.4.0 The Lua Manual can be found here: Andrew Gierth has added editline and documentation options to the port. Built and lightly tested on Ghost BSD 20 (FreeBSD 12.1 STABLE).
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes andrew_tao173.riddles.org.uk updated this revision to Diff 45367.Jul 16 2018, 2:03 PM2018-07-16 14:03:11 (UTC+0) Comment ActionsThis is now a diff against the result of 'svn cp lua53 lua54' as requested by mat. Also includes mat's other requested changes. Comment Actions Could you use devel/arcanist, or at least generate a diff with full context like it does, with svn diff -x -U9999 or git diff -U9999. andrew_tao173.riddles.org.uk updated this revision to Diff 45369.Jul 16 2018, 2:22 PM2018-07-16 14:22:06 (UTC+0) Comment Actionsmat: like this? andrew_tao173.riddles.org.uk updated this revision to Diff 45435.Jul 17 2018, 9:55 PM2018-07-17 21:55:05 (UTC+0) Comment ActionsRemove use of ${PORTNAME} in line with discussions over on the 5.3.5 patch. andrew_tao173.riddles.org.uk retitled this revision from Lua 5.4.0 to lang/lua54 - new port for Lua 5.4.0.Jul 18 2018, 2:21 PM2018-07-18 14:21:58 (UTC+0) andrew_tao173.riddles.org.uk updated this revision to Diff 45460.Jul 18 2018, 2:27 PM2018-07-18 14:27:50 (UTC+0) Comment ActionsChange OPTIONS_DEFAULT+= to just = in accordance with nitpicking on the 5.3.5 patch.
andrew_tao173.riddles.org.uk updated this revision to Diff 45464.Jul 18 2018, 3:52 PM2018-07-18 15:52:06 (UTC+0) Comment ActionsUse DISTVERSION. This corrects the package version too (now 5.4.0.w2) andrew_tao173.riddles.org.uk updated this revision to Diff 45576.Jul 20 2018, 3:06 AM2018-07-20 03:06:17 (UTC+0) Comment ActionsSync with 5.3.5 work. This adds the dynamic-libedit patch (which is an extra patch here, rather than unconditionally patching lua.c as in 5.3.5, because unlike 5.3.5 we don't otherwise have any need to patch that file). Other changes are just cosmetic. andrew_tao173.riddles.org.uk updated this revision to Diff 45745.Jul 23 2018, 10:11 PM2018-07-23 22:11:19 (UTC+0) Comment ActionsChanges in line with 5.3.5 patch:
Comment Actions
I'm happy with it. Comment Actions I cannot comment on the specifics of lua (i.e. do these changes work), I've never used lua and haven't tested it. However, I am happy with the above changes with the following comments:
@jbeich: your thoughts? And, who will commit this change? Comment Actions
Hi @dbn, Lua 5.4 is still in a beta phase so my preference is to hold this port until the Lua 5.4 official release, then update and push it to the repository. @andrew_tao173.riddles.org.uk has already indicated his preference to hold the port until the Lua release (unless something has changed?) Comment Actions
I didn't say to hold it until release, I said -work2 was "not ready for prime time" or some such. But in the absence of any statement from the Lua devs about the likely timing of a -work3 or a final 5.4.0, I see these options:
I'm not all that keen on option 1, but any of options 1-3 might be useful from a Lua development point of view. Another factor to consider is updating Uses/lua.mk (which doesn't recognize 5.4 yet). I have been testing the idea of giving USES=lua a flavors option for lua modules to use and it seems to work well - I could put that work up as a separate revision for review? Comment Actions
I had started a review for updating Uses/lua.mk last year (https://reviews.freebsd.org/D13691 - feel free to re-use this or start a new one). This review is when I was informed about the previous exp-run and why Lua was still at 5.2. My plan had been to follow the Lua releases and try to get everything updated to 5.3, but I have nothing against your suggestions. Option 2 would be my preference; it seems like the best "bang for the buck". I'm keen to see your flavors work! andrew_tao173.riddles.org.uk updated this revision to Diff 46435.Aug 8 2018, 9:10 PM2018-08-08 21:10:21 (UTC+0) Comment ActionsTrack changes requested by mat for the 5.3 port. Comment Actions Now that a 5.4.0-beta release has been made, and there are signs that features are actually stabilizing (there have been many changes since work2), perhaps we could pick this up again. The distinfo needs an update of course. Comment Actions
Yes, I'll start on that now. Thanks for the ping. russ.haley_gmail.com updated this revision to Diff 63394.Oct 17 2019, 4:01 AM2019-10-17 04:01:21 (UTC+0) Comment ActionsUpdated for the latest Lua 5.4 Beta release.
Comment Actions https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199480 Is this patch for arc4random something that we should look at applying? Comment Actions hmmmm? > Installing for lua54-5.4.0.b_1> Checking if lua54 is already installed> Registering installation for lua54-5.4.0.b_1pkg-static: duplicate file listing: /usr/local/share/doc/lua54/lua/contents.html, ignoring Comment Actions
The assert patch no longer needs to touch lgc.c, since that was fixing a bug with a misplaced assert that is now fixed upstream. Only the change to lprefix.h is needed now. Comment Actions You seem to have duplicated a patch? There should be no patch for lua.c other than the extra-patch-libedit-dl one.
russ.haley_gmail.com updated this revision to Diff 63427.Edited · Oct 18 2019, 4:18 AM2019-10-18 04:18:10 (UTC+0) Comment ActionsNew patch to address comments, thank you Andrew. Update: retested the default LIBEDIT_DL configuration and I don't get command line history russellh@gbsd2 ~/f/p/l/l/w/l/src> ./lua54 Lua 5.4.0 Copyright (C) 1994-2019 Lua.org, PUC-Rio > print('test') test > ^[[A^C⏎ but it works fine with libreadline: russellh@gbsd2 ~/f/p/l/l/w/l/src> ./lua54 Lua 5.4.0 Copyright (C) 1994-2019 Lua.org, PUC-Rio > print('test') test > print('test') test Build output for LIBEDIT_DL is here: https://pastebin.com/UTVrdZVX russ.haley_gmail.com updated this revision to Diff 63429.Oct 18 2019, 5:13 AM2019-10-18 05:13:29 (UTC+0) Comment ActionsAddressed andrews comments. Fixed missing patch for LIBEDIT_DL and tested LIBEDIT_DL option. twice. :-/ russ.haley_gmail.com updated this revision to Diff 63431.Oct 18 2019, 5:38 AM2019-10-18 05:38:52 (UTC+0) Comment ActionsAdded option for arc4random random seed. I tested running math.random and it looked randomish to me? I don't know what I'm looking for but the flags were present in the build output: ... --- liolib.o --- cc -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_POSIX -DLUA_USE_DLOPEN -DLUA_USE_READLINE_DL -isystem /usr/local/include -O2 -pipe -fPIC -D__BSD_VISIBLE -DLUA_USER_H='<stdlib.h>' -D'lua_makeseed()=cast(unsigned int, arc4random())' -fstack-protector-strong -isystem /usr/local/include -c liolib.c -o liolib.o --- lmathlib.o --- cc -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_POSIX -DLUA_USE_DLOPEN -DLUA_USE_READLINE_DL -isystem /usr/local/include -O2 -pipe -fPIC -D__BSD_VISIBLE -DLUA_USER_H='<stdlib.h>' -D'lua_makeseed()=cast(unsigned int, arc4random())' -fstack-protector-strong -isystem /usr/local/include -c lmathlib.c -o lmathlib.o ... Comment Actions Looks like Roberto snuck some hardcoded -Os options into the makefile, we need to either patch those back out or think of something else to do with them. Comment Actions
You should ask about that on the mailing list. -O2 is specified twice, as well as -Os. Which option does the compiler take? cc -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_POSIX -DLUA_USE_DLOPEN -DLUA_USE_READLINE_DL -isystem /usr/local/include -O2 -pipe -fPIC -D__BSD_VISIBLE -DLUA_USER_H='<stdlib.h>' -D'lua_makeseed()=cast(unsigned int, arc4random())' -fstack-protector-strong -isystem /usr/local/include -Os -c lcode.c Complete build output here: https://pastebin.com/pB2N7D3w russ.haley_gmail.com updated this revision to Diff 63528.Edited · Oct 22 2019, 4:13 AM2019-10-22 04:13:36 (UTC+0) Comment ActionsPatch out targets that added -Os to llex.o, lparser.o, and lcode.o. Build output here https://pastebin.com/2tLGT9RA Comment Actions
Generally the last one.
That first -O2 needs to be patched out as well - wasn't there something for that in files/patch-src_Makefile before? russ.haley_gmail.com updated this revision to Diff 63951.Nov 5 2019, 5:31 AM2019-11-05 05:31:19 (UTC+0) Comment ActionsPatch out CFLAGS optimization in third party makefile as per handbook: https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/dads-cflags.html
andrew_tao173.riddles.org.uk updated this revision to Diff 70611.Apr 15 2020, 6:32 PM2020-04-15 18:32:26 (UTC+0) Comment ActionsUpdate to lua 5.4.0-rc1 Update to match recent changes to Lua framework; connect to the build; add the new version to the list of supported versions in default-versions and Uses/lua.mk. Allowing 5.4 in Uses/lua.mk does have the potential to break builds of ports that specify, e.g., USES=lua:53+ (so that the default version of 5.2 is not in range) and where they use interfaces that change from 5.3 to 5.4. I'm not sure how many cases of this there are (if any); I will do my own test run soon, but an exp-run will likely be needed at some point. Now that there's an actual release candidate, we can think about pushing this forward. Herald added a reviewer: portmgr. · View Herald TranscriptApr 15 2020, 6:32 PM2020-04-15 18:32:26 (UTC+0) Comment Actions Test results: adding support for 5.4 causes only two ports (archivers/urbackup-server and x11-toolkits/termit) to switch from lua 5.3 to 5.4 when LUA_DEFAULT is 5.2. (They would not switch if the default were 5.3; both are declared as lua:53+, and the default version is chosen if it is in range, otherwise the latest available version in the range.) Both of them fail to build as a result. For archivers/urbackup-server, it's because it has a configure script that looks only for lua53 and older versions. For x11-toolkits/termit it's because it uses cmake to build, and cmake has no idea that lua54 exists so it also has a hardcoded check for lua53 and older. In both cases, adding appropriate CONFIGURE_ENV or CMAKE_ARGS *might* fix the issue; I'll have a poke at them. Comment Actions
I'm not sure what I'm doing wrong but I get the lua54 port files in my ports root directory if I apply this patch. russellh@gbsd2 ~/f/ports> patch < ~/freebsd/patches/D14709.diff andrew_tao173.riddles.org.uk updated this revision to Diff 70739.Apr 18 2020, 5:13 PM2020-04-18 17:13:57 (UTC+0) Comment ActionsChange the two ports that declared themselves lua:53+ to just lua:53, since they don't seem to respond sanely to attempts to force configuration with 5.4 using environment vars. (In my documentation patch for the porter's manual, I've added a note about why this style of version specification should be avoided. See https://reviews.freebsd.org/D24430 for details.) Comment Actions In my opinion, it's a bug in Mk/Uses/lua.mk that USES=lua:53+ chooses lua 5.4 over 5.3 Comment Actions
What alternative logic do you suggest? Comment Actions
Maybe chose the closest from default version that fits the constraints Comment Actions
In other words, choose the lowest version in the range if the default version is below the start of the range, or the highest version if it is above the end? Should the rule be the same for 53+ as for, say, 53-54 ? (I should note, I did not change the version selection logic much in my patch for lua.mk; the old lua.mk would choose the highest version in these kinds of cases too.) I'm honestly not sure that there's a rule that works well for all kinds of ports. The only (unflavored) ports for which lua:53+ really make sense would be ones that are actually written in Lua, rather than embedding Lua into C code (or whatever other language), because the Lua API has breaking changes between every version (while the 5.3 to 5.4 changes are relatively small, there's no guarantee at all about future versions). The major benefit I can see from your suggested rule is that it would ensure that advancing LUA_DEFAULT would not cause any port to suddenly switch to an older version of Lua, whereas with the current logic, a 53+ port will build with 5.4 once that is added, but revert to 5.3 if LUA_DEFAULT was changed from the current value of 5.2 to 5.3. The downside would seem to be that ports that really can benefit from a newer Lua version would be stuck on an older one. In the specific case of the two ports referenced here, I think it's clearly a bug in the ports that they specify 53+ when they cannot actually build with anything other than exactly 5.3. Comment Actions Others have supported the "closest to default" rule, so I'll put up a separate patch for that. russ.haley_gmail.com updated this revision to Diff 74830.Jul 23 2020, 5:29 AM2020-07-23 05:29:24 (UTC+0) Comment ActionsUpdated to use the official release Lua 5.4.0 Comment Actions Please make sure that when committed, this is done by first copying lang/lua53 to lang/lua54.
russ.haley_gmail.com updated this revision to Diff 74898.Jul 24 2020, 9:36 PM2020-07-24 21:36:23 (UTC+0) Comment Actions
russ.haley_gmail.com marked an inline comment as done.Jul 24 2020, 9:37 PM2020-07-24 21:37:18 (UTC+0) russ.haley_gmail.com retitled this revision from lang/lua54 - new port for Lua 5.4.0 to [new port] lang/lua54 - new port for Lua 5.4.0.Jul 24 2020, 9:40 PM2020-07-24 21:40:44 (UTC+0) Comment Actions
They were not included by mistake; they were the ports which would otherwise have broken by adding lua54 as per previous discussion. However, the change to version selection logic from D24492 does hopefully obviate that issue, since now adding lua54 won't change the lua version used by any existing port. Comment Actions
Ah, I thought I had mucked something. Shall I restore them? Comment Actions
Nope. Their maintainers can deal with them in due course. andrew_tao173.riddles.org.uk updated this revision to Diff 78259.Oct 15 2020, 1:11 PM2020-10-15 13:11:19 (UTC+0) Comment ActionsUpdate to 5.4.1 Better handling of ASSERT option (no need for a patch file) Reorder things to pacify portclippy This revision was not accepted when it landed; it landed in state Needs Review.Oct 15 2020, 5:55 PM2020-10-15 17:55:30 (UTC+0) This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 45464 Makefile
distinfo
files/extra-patch-assert
files/lua-5.3.pc.in
files/lua-5.4.pc.in
|
The credit will alreay be present in the commit message, please do not add more in the Makefile.