Skip to content

Commit

Permalink
maint: initial support for Lua 5.4
Browse files Browse the repository at this point in the history
* luaposix-git-1.rockspec (dependencies): Bump lua to 5.4.
* .travis.yml: Add Lua 5.4 to the test matrix.
* ext/include/_helpers.c: Add LUA_VERSION_NUM 504.
* lib/posix/init.lua: Add parens to require calls in comma
expressions in generic for loops with next.
* NEWS.md (New Features): Updated.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
  • Loading branch information
gvvaughan committed Jul 6, 2020
1 parent 5d5e06e commit 0a9c78b
Show file tree
Hide file tree
Showing 40 changed files with 48 additions and 43 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -4,6 +4,7 @@ sudo: false

env:
matrix:
- VLUA="lua=5.4"
- VLUA="lua=5.3"
- VLUA="lua=5.2"
- VLUA="lua=5.1"
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Expand Up @@ -6,13 +6,17 @@

- Internally, we use our own bitwise operation wrapper functions
rather than bit32 where possible. This means bitwise operations
when running under Lua 5.3 work on 64bit integers.
when running under Lua 5.3+ work on 64bit integers.

### Bugs Fixed

- `posix.deprecated.getrlimit` and `posix.deprecated.setrlimit` pass
tests again.

### New Features

- Initial support for Lua 5.4.


## Noteworthy changes in release 34.1.1 (2019-07-27) [stable]

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -7,8 +7,8 @@ By the [luaposix project][github]
[![travis-ci status](https://secure.travis-ci.org/luaposix/luaposix.png?branche=master)](http://travis-ci.org/luaposix/luaposix/builds)
[![codecov.io](https://codecov.io/github/luaposix/luaposix/coverage.svg?branch=master)](https://codecov.io/github/luaposix/luaposix?branch=master)

This is a POSIX binding for LuaJIT, [Lua][] 5.1, 5.2 and 5.3; like most
libraries it simply binds to C APIs on the underlying system, so it
This is a POSIX binding for LuaJIT, [Lua][] 5.1, 5.2, 5.3 and 5.4; like
most libraries it simply binds to C APIs on the underlying system, so it
won't work on non-POSIX systems. However, it does try to detect the
level of POSIX conformance of the underlying system and bind only
available APIs.
Expand Down
4 changes: 2 additions & 2 deletions ext/include/_helpers.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down Expand Up @@ -67,7 +67,7 @@
# endif
#endif

#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503
#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504

This comment has been minimized.

Copy link
@emaste

emaste Jan 14, 2021

Any reason this isn't just LUA_VERSION_NUM >= 502?

This comment has been minimized.

Copy link
@gvvaughan

gvvaughan Jan 14, 2021

Author Contributor

This code is not known to work with 600 or even 505, because we don't know what changes will be required, or even whether it will make sense to support 501 and 505 from the same codebase. As it happened, 5.4 did not have any changes that required more than version bumps here... but 5.2 and 5.3 did require extra code to be supported.

This comment has been minimized.

Copy link
@emaste

emaste Jan 14, 2021

Fair enough, but what do you think about something explicit like

#if LUA_VERSION_NUM > 504
#error This has not been updated for Lua 5.5 support
#endif

rather than having this happen incidentally as a side effect of this lua_rawlen case?

I ended up here after lcurses (which includes a copy of this file) failed to build on FreeBSD after a Lua upgrade in a rather non-obvious way:

In file included from /tmp/cirrus-ci-build/contrib/lua/lcurses/ext/curses.c:90:
/tmp/cirrus-ci-build/contrib/lua/lcurses/ext/curses/chstr.c:108:12: error: implicit declaration of function 'lua_strlen' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        int len = lua_strlen(L, 3);
                  ^
# define lua_objlen lua_rawlen
# define lua_strlen lua_rawlen
#endif
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/ctype.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/dirent.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/errno.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/fcntl.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/fnmatch.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/glob.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/grp.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/libgen.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/poll.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/posix.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/pwd.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sched.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/signal.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/stdio.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/stdlib.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/msg.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/resource.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/socket.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/stat.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/statvfs.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/time.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/times.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/utsname.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/sys/wait.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/syslog.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/termio.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/time.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/unistd.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ext/posix/utime.c
@@ -1,5 +1,5 @@
/*
* POSIX library for Lua 5.1, 5.2 & 5.3.
* POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
* Copyright (C) 2013-2020 Gary V. Vaughan
* Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
* Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion lib/posix/_base.lua
@@ -1,5 +1,5 @@
--[[
POSIX library for Lua 5.1, 5.2 & 5.3.
POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
Copyright (C) 2014-2020 Gary V. Vaughan
]]
--[[--
Expand Down
2 changes: 1 addition & 1 deletion lib/posix/_strict.lua
@@ -1,5 +1,5 @@
--[[
POSIX library for Lua 5.1, 5.2 & 5.3.
POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
Copyright (C) 2014-2020 Gary V. Vaughan
]]
--[[--
Expand Down
2 changes: 1 addition & 1 deletion lib/posix/compat.lua
@@ -1,5 +1,5 @@
--[[
POSIX library for Lua 5.1, 5.2 & 5.3.
POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
Copyright (C) 2014-2020 Gary V. Vaughan
]]
--[[--
Expand Down
2 changes: 1 addition & 1 deletion lib/posix/deprecated.lua
@@ -1,5 +1,5 @@
--[[
POSIX library for Lua 5.1, 5.2 & 5.3.
POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
Copyright (C) 2014-2020 Gary V. Vaughan
]]
--[[--
Expand Down
6 changes: 3 additions & 3 deletions lib/posix/init.lua
@@ -1,5 +1,5 @@
--[[
POSIX library for Lua 5.1, 5.2 & 5.3.
POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
Copyright (C) 2013-2020 Gary V. Vaughan
Copyright (C) 2010-2013 Reuben Thomas <rrt@sc3d.org>
Copyright (C) 2008-2010 Natanael Copa <natanael.copa@gmail.com>
Expand Down Expand Up @@ -327,10 +327,10 @@ do
end

-- Inject deprecated APIs (overwriting submodules) for backwards compatibility.
for k, v in next, require 'posix.deprecated' do
for k, v in next, (require 'posix.deprecated') do
M[k] = v
end
for k, v in next, require 'posix.compat' do
for k, v in next, (require 'posix.compat') do
M[k] = v
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/posix/util.lua
@@ -1,5 +1,5 @@
--[[
POSIX library for Lua 5.1, 5.2 & 5.3.
POSIX library for Lua 5.1, 5.2, 5.3 & 5.4.
Copyright (C) 2014-2020 Gary V. Vaughan
]]

Expand Down
2 changes: 1 addition & 1 deletion luaposix-git-1.rockspec
Expand Up @@ -14,7 +14,7 @@ description = {
}

dependencies = {
'lua >= 5.1, < 5.4',
'lua >= 5.1, < 5.5',
}

do
Expand Down

0 comments on commit 0a9c78b

Please sign in to comment.