From 7fcd734ed8c7e4842728c7ae9a9448a2a51a4d47 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Jul 19 2021 18:25:49 +0000 Subject: Update to version 1.14.1.0 --- diff --git a/.gitignore b/.gitignore index 75aafd6..0890f9b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /luv-1.34.2.1.tar.gz /luv-1.36.0.0.tar.gz /luv-1.41.0.0.tar.gz +/luv-1.41.1.0.tar.gz diff --git a/43491413f6ed3721f1f883ed94b2c4e9aad1e186.patch b/43491413f6ed3721f1f883ed94b2c4e9aad1e186.patch deleted file mode 100644 index 8d47580..0000000 --- a/43491413f6ed3721f1f883ed94b2c4e9aad1e186.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 43491413f6ed3721f1f883ed94b2c4e9aad1e186 Mon Sep 17 00:00:00 2001 -From: Ryan Liptak -Date: Thu, 22 Apr 2021 20:13:52 -0700 -Subject: [PATCH] Fix udp multicast test with restrictive firewall settings - (#541) - -Closes #539 ---- - tests/test-udp.lua | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/tests/test-udp.lua b/tests/test-udp.lua -index e73da9f..ccaca66 100644 ---- a/tests/test-udp.lua -+++ b/tests/test-udp.lua -@@ -235,6 +235,20 @@ return require('lib/tap')(function (test) - server:recv_start(recv_cb) - - assert(client:send("PING", multicast_addr, TEST_PORT, expect(function(err) -+ -- EPERM here likely means that a firewall has denied the send, which -+ -- can happen in some build/CI environments, e.g. the Fedora build system. -+ -- Reproducible on Linux with iptables by doing: -+ -- iptables --policy OUTPUT DROP -+ -- iptables -A OUTPUT -s 127.0.0.1 -j ACCEPT -+ -- and for ipv6: -+ -- ip6tables --policy OUTPUT DROP -+ -- ip6tables -A OUTPUT -s ::1 -j ACCEPT -+ if err == "EPERM" then -+ print("send to multicast ip was likely denied by firewall, skipping") -+ client:close() -+ server:close() -+ return -+ end - assert(not err, err) - end))) - end diff --git a/598ccf22e30915fc8fe06f2912b7cdee5215eaa1.patch b/598ccf22e30915fc8fe06f2912b7cdee5215eaa1.patch deleted file mode 100644 index 399d58d..0000000 --- a/598ccf22e30915fc8fe06f2912b7cdee5215eaa1.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 598ccf22e30915fc8fe06f2912b7cdee5215eaa1 Mon Sep 17 00:00:00 2001 -From: Ryan Liptak -Date: Wed, 21 Apr 2021 05:55:36 -0700 -Subject: [PATCH] Fix udp multicast test when no exernal interfaces are - available (#540) - -Fixes #539 ---- - tests/test-udp.lua | 41 +++++++++++++++++++++++++++-------------- - 1 file changed, 27 insertions(+), 14 deletions(-) - -diff --git a/tests/test-udp.lua b/tests/test-udp.lua -index 403316c..e73da9f 100644 ---- a/tests/test-udp.lua -+++ b/tests/test-udp.lua -@@ -179,7 +179,7 @@ return require('lib/tap')(function (test) - assert(uv.udp_bind(server, bind_addr, TEST_PORT)) - local _, err, errname = uv.udp_set_membership(server, multicast_addr, interface_addr, "join") - if errname == "ENODEV" then -- print("no ipv6 multicast route, skipping") -+ print("no multicast route, skipping") - server:close() - return - elseif errname == "EADDRNOTAVAIL" and multicast_addr == "ff02::1" then -@@ -240,26 +240,39 @@ return require('lib/tap')(function (test) - end - end - -- test("udp multicast join ipv4", multicast_join_test("0.0.0.0", "239.255.0.1", nil)) -- -- test("udp multicast join ipv6", function(print, p, expect, uv) -- local function can_ipv6_external() -- local addresses = assert(uv.interface_addresses()) -- for _, vals in pairs(addresses) do -- for _, info in ipairs(vals) do -- if info.family == "inet6" and not info.internal then -- return true -- end -+ -- TODO This might be overkill, but the multicast -+ -- tests seem to rely on external interfaces being -+ -- available on some platforms. So, we use this to skip -+ -- the tests when there are no relevant exernal interfaces -+ -- available. Note: The Libuv multicast join test does use this -+ -- same check for skipping the ipv6 test; we just expanded it to -+ -- the ipv4 test as well. -+ local function has_external_interface(uv, family) -+ local addresses = assert(uv.interface_addresses()) -+ for _, vals in pairs(addresses) do -+ for _, info in ipairs(vals) do -+ if (not family or info.family == family) and not info.internal then -+ return true - end - end -- return false - end -+ return false -+ end - -- if not can_ipv6_external() then -- print("no ipv6 support, skipping") -+ test("udp multicast join ipv4", function(print, p, expect, uv) -+ if not has_external_interface(uv, "inet") then -+ print("no external ipv4 interface, skipping") - return - end -+ local testfn = multicast_join_test("0.0.0.0", "239.255.0.1", nil) -+ return testfn(print, p, expect, uv) -+ end) - -+ test("udp multicast join ipv6", function(print, p, expect, uv) -+ if not has_external_interface(uv, "inet6") then -+ print("no external ipv6 interface, skipping") -+ return -+ end - local testfn = multicast_join_test("::", "ff02::1", nil) - return testfn(print, p, expect, uv) - end) diff --git a/606d300bdd0439b663c64784d81c18031694687d.patch b/606d300bdd0439b663c64784d81c18031694687d.patch deleted file mode 100644 index 7495f07..0000000 --- a/606d300bdd0439b663c64784d81c18031694687d.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 606d300bdd0439b663c64784d81c18031694687d Mon Sep 17 00:00:00 2001 -From: Ryan Liptak -Date: Fri, 2 Jul 2021 13:22:04 -0700 -Subject: [PATCH] Fix thread dumping in Lua 5.4.3+ - -luaL_buffinit apparently can push things onto the stack (although this is undocumented in the Lua 5.4 manual), so it needs to be called after lua_dump to make sure the function to-be-dumped is still at the top of the stack in lua_dump - -Closes #553 ---- - src/thread.c | 28 +++++++++++++++++++++------- - 1 file changed, 21 insertions(+), 7 deletions(-) - -diff --git a/src/thread.c b/src/thread.c -index fa757c5..e159f1b 100644 ---- a/src/thread.c -+++ b/src/thread.c -@@ -207,9 +207,23 @@ static int luv_thread_arg_push(lua_State* L, luv_thread_arg_t* args, int flags) - return i; - } - --int thread_dump(lua_State* L, const void* p, size_t sz, void* B) { -- (void)L; -- luaL_addlstring((luaL_Buffer*) B, (const char*) p, sz); -+// Copied from lstrlib.c in Lua 5.4.3 -+// -+// luaL_buffinit might push stuff onto the stack (this is undocumented as of now), -+// so it must be called after lua_dump to ensure that the function to dump -+// is still on the top of the stack -+struct luv_thread_Writer { -+ int init; -+ luaL_Buffer B; -+}; -+ -+static int thread_dump (lua_State *L, const void *b, size_t size, void *ud) { -+ struct luv_thread_Writer *state = (struct luv_thread_Writer *)ud; -+ if (!state->init) { -+ state->init = 1; -+ luaL_buffinit(L, &state->B); -+ } -+ luaL_addlstring(&state->B, (const char *)b, size); - return 0; - } - -@@ -218,14 +232,14 @@ static int luv_thread_dumped(lua_State* L, int idx) { - lua_pushvalue(L, idx); - } else { - int ret; -- luaL_Buffer b; -+ struct luv_thread_Writer state; -+ state.init = 0; - luaL_checktype(L, idx, LUA_TFUNCTION); - lua_pushvalue(L, idx); -- luaL_buffinit(L, &b); -- ret = lua_dump(L, thread_dump, &b, 1); -+ ret = lua_dump(L, thread_dump, &state, 1); - lua_pop(L, 1); - if (ret==0) { -- luaL_pushresult(&b); -+ luaL_pushresult(&state.B); - } else - luaL_error(L, "Error: unable to dump given function"); - } diff --git a/f1b90eab8e301d83dba9fc0b4a501d718b4cb94e.patch b/f1b90eab8e301d83dba9fc0b4a501d718b4cb94e.patch deleted file mode 100644 index b3411e4..0000000 --- a/f1b90eab8e301d83dba9fc0b4a501d718b4cb94e.patch +++ /dev/null @@ -1,40 +0,0 @@ -From f1b90eab8e301d83dba9fc0b4a501d718b4cb94e Mon Sep 17 00:00:00 2001 -From: Ryan Liptak -Date: Wed, 30 Jun 2021 18:50:56 -0700 -Subject: [PATCH] Get rid of race condition in timer test - -The test no longer really asserts that they have been run concurrently, but I'm not sure that's a super worthwhile thing to test here, since that seems like a default assumption built into using libuv ---- - tests/test-timer.lua | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/tests/test-timer.lua b/tests/test-timer.lua -index 05f7739..1d6faca 100644 ---- a/tests/test-timer.lua -+++ b/tests/test-timer.lua -@@ -34,19 +34,20 @@ return require('lib/tap')(function (test) - end) - - -- Test two concurrent timers -- -- There is a small race condition, but there are 100ms of wiggle room. -- -- 400ms is halfway between 100+200ms and 100+400ms - test("timeout with interval", function (print, p, expect, uv) - local a = uv.new_timer() - local b = uv.new_timer() -- uv.timer_start(a, 400, 0, expect(function () -+ uv.timer_start(a, 200, 0, expect(function () - p("timeout", a) -- uv.timer_stop(b) - uv.close(a) -- uv.close(b) - end)) -+ local count = 2 - uv.timer_start(b, 100, 200, expect(function () - p("interval", b) -+ count = count - 1 -+ if count == 0 then -+ uv.close(b) -+ end - end, 2)) - end) - diff --git a/f23ff47c1230ca9ea0d9518fb9eb4e35582cbffc.patch b/f23ff47c1230ca9ea0d9518fb9eb4e35582cbffc.patch deleted file mode 100644 index df78d26..0000000 --- a/f23ff47c1230ca9ea0d9518fb9eb4e35582cbffc.patch +++ /dev/null @@ -1,62 +0,0 @@ -From f23ff47c1230ca9ea0d9518fb9eb4e35582cbffc Mon Sep 17 00:00:00 2001 -From: Ryan Liptak -Date: Mon, 10 May 2021 15:16:13 -0700 -Subject: [PATCH] Add timeout to udp multicast join tests (#543) - -This is one way to close #539. - -With the default settings of firewalld (used by Fedora, RHEL, etc), incoming messages from multicast IPs are dropped, meaning that the multicast test will hang forever. This introduces a 1 second timeout, after which the test will fail. ---- - tests/test-udp.lua | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/tests/test-udp.lua b/tests/test-udp.lua -index ccaca66..abd1bad 100644 ---- a/tests/test-udp.lua -+++ b/tests/test-udp.lua -@@ -174,6 +174,8 @@ return require('lib/tap')(function (test) - local function multicast_join_test(bind_addr, multicast_addr, interface_addr) - return function(print, p, expect, uv) - local uvVersionGEQ = require('lib/utils').uvVersionGEQ -+ local timeout = uv.new_timer() -+ local TIMEOUT_TIME = 1000 - - local server = assert(uv.new_udp()) - assert(uv.udp_bind(server, bind_addr, TEST_PORT)) -@@ -181,6 +183,7 @@ return require('lib/tap')(function (test) - if errname == "ENODEV" then - print("no multicast route, skipping") - server:close() -+ timeout:close() - return - elseif errname == "EADDRNOTAVAIL" and multicast_addr == "ff02::1" then - -- OSX, BSDs, and some other platforms need %lo in their multicast/interface addr -@@ -212,6 +215,7 @@ return require('lib/tap')(function (test) - -- note: because of this conditional close, the test will fail with an unclosed handle if recv_cb_called - -- doesn't hit 2, so we don't need to expect(recv_cb) or assert recv_cb_called == 2 - server:close() -+ timeout:close() - else - -- udp_set_source_membership added in 1.32.0 - if uvVersionGEQ("1.32.0") then -@@ -247,10 +251,20 @@ return require('lib/tap')(function (test) - print("send to multicast ip was likely denied by firewall, skipping") - client:close() - server:close() -+ timeout:close() - return - end - assert(not err, err) - end))) -+ -+ -- some firewalls might reject incoming messages from multicast IPs, -+ -- so we need a timeout to avoid hanging forever in that scenario -+ timeout:start(TIMEOUT_TIME, 0, expect(function() -+ print("timeout (could be caused by firewall settings)") -+ client:close() -+ server:close() -+ timeout:close() -+ end, 0)) - end - end - diff --git a/lua-luv.spec b/lua-luv.spec index b4446b0..1965980 100644 --- a/lua-luv.spec +++ b/lua-luv.spec @@ -7,7 +7,7 @@ %global lua_51_pkgdir %{_datadir}/lua/%{lua_51_version} %global lua_51_builddir obj-lua%{lua_51_version} -%global real_version 1.41.0 +%global real_version 1.41.1 %global extra_version 0 %if 0%{?rhel} && 0%{?rhel} < 9 @@ -27,7 +27,7 @@ BuildRequires: lua5.1-compat53 Name: lua-luv Version: %{real_version}.%{extra_version} -Release: 3%{?dist} +Release: 1%{?dist} License: ASL 2.0 Summary: Bare libuv bindings for lua @@ -39,12 +39,6 @@ Requires: lua(abi) = %{lua_version} Source0: https://github.com/luvit/luv/archive/%{real_version}-%{extra_version}/luv-%{version}.tar.gz -Patch0: https://github.com/luvit/luv/commit/598ccf22e30915fc8fe06f2912b7cdee5215eaa1.patch -Patch1: https://github.com/luvit/luv/commit/43491413f6ed3721f1f883ed94b2c4e9aad1e186.patch -Patch2: https://github.com/luvit/luv/commit/f23ff47c1230ca9ea0d9518fb9eb4e35582cbffc.patch -Patch3: https://github.com/luvit/luv/commit/f1b90eab8e301d83dba9fc0b4a501d718b4cb94e.patch -Patch4: https://github.com/luvit/luv/commit/606d300bdd0439b663c64784d81c18031694687d.patch - Patch100: lua-luv-s390.patch %description @@ -94,11 +88,6 @@ Files required for lua5.1-luv development %prep %setup -n luv-%{real_version}-%{extra_version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %ifarch s390x %patch100 -p1 %endif @@ -200,6 +189,10 @@ rm luv.so %{lua_51_incdir}/luv/util.h %changelog +* Mon Jul 19 2021 Andreas Schneider - 1.41.1.0-1 +- Update to version 1.41.1 + * https://github.com/luvit/luv/releases/tag/1.41.1-0 + * Mon Jul 12 2021 Michel Alexandre Salim - 1.41.0.0-3 - use macros from lua-{s,}rpm-macros; spec now portable across Lua versions - reenable s390x build on epel8 (#1829151) diff --git a/sources b/sources index 80d2587..fa87f38 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (luv-1.41.0.0.tar.gz) = 9330194af921f414ed63c4ef45e7c91f3ce8f143c28ca7a554bfc1652265e8aebbe1287de5a42f470eef252481bedc5bd0579b19222f12261f58750c8bc4e689 +SHA512 (luv-1.41.1.0.tar.gz) = 3caf8aad9bf09b5cc7270adb3db7aafbfb790671ac3b1dcfb045876058996a768728bade052885227bb4496a7760ee9c54dce52880cd3c5a971d269462bf6022