diff --git a/.gitignore b/.gitignore index a8a8f9c..70d60d7 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ /uwsgi-docs-9b4ef5f.tar.gz /uwsgi-2.0.21.tar.gz /uwsgi-docs-47e1794.tar.gz +/uwsgi-2.0.22.tar.gz +/uwsgi-docs-9c89fef.tar.gz diff --git a/sources b/sources index d55d324..fbbca13 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (uwsgi-2.0.21.tar.gz) = 36a9c1b87a4c3d08482b9045d2227f56b006acb53f38ddf1b510880ae5fc24c0177a077338ec8af3ef0b8f8e220bc4fc7f8311dab8066e13cbcbb616f736c795 -SHA512 (uwsgi-docs-47e1794.tar.gz) = 8fa66303b405da519f986e8a848439bb76d8043a860bb468e43fb451b672a5234ec1a06835b47f0e9bb467bab1bc0daf7fae387dfa1ef0ed3a3a501234fc5950 +SHA512 (uwsgi-2.0.22.tar.gz) = 28aaf786a88f034752ce980f6ae04ee5ea361443ffad7d7e9ec9a88a60dd63c649a44c2d41bb6ddc1572c321567da4c3985f907498bf250e2cd7cd11f4686303 +SHA512 (uwsgi-docs-9c89fef.tar.gz) = be7dfcc3a55ec7a7b9531b5570120d47f9ad304193f55ee73651b2024faaeea07fa4f8e358458dd15c3e36e06f02b757fe6e2db07f952ab2563168a396f68d43 diff --git a/uwsgi.spec b/uwsgi.spec index a9eb650..f00a9ca 100644 --- a/uwsgi.spec +++ b/uwsgi.spec @@ -1,5 +1,5 @@ # Documentation sources: -%global commit 47e17949d0fd95e524d4f90cc58a3fcb11bc0bae +%global commit 9c89fef106799ddd6f5b383936853afecd2c0cce %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global docrepo uwsgi-docs @@ -190,8 +190,8 @@ %endif Name: uwsgi -Version: 2.0.21 -Release: 12%{?dist} +Version: 2.0.22 +Release: 1%{?dist} Summary: Fast, self-healing, application container server # uwsgi is licensed under GPLv2 with a linking exception # docs are licensed under MIT @@ -217,14 +217,9 @@ Patch7: uwsgi_fix_mono.patch # https://github.com/unbit/uwsgi/issues/2283 Patch12: uwsgi_fix_php8.patch Patch13: uwsgi_fix_chroot_chdir.patch -# https://github.com/unbit/uwsgi/issues/2356 -Patch14: uwsgi_fix_php_arginfo.patch -Patch15: uwsgi_fix_python_py_ssize_t.patch -Patch16: uwsgi_python311.patch -# https://github.com/unbit/uwsgi/pull/2400 -Patch17: uwsgi_fix_php81_filename_zend_string.patch -Patch18: uwsgi_fix_php82.patch -Patch19: uwsgi_fix_ruby_taint.patch +# https://github.com/unbit/uwsgi/issues/2552 +Patch20: uwsgi_fix_jvm_missing_path.patch +Patch21: uwsgi_python312.patch BuildRequires: curl, libxml2-devel, libuuid-devel, jansson-devel BuildRequires: libyaml-devel, ruby-devel @@ -1248,8 +1243,8 @@ cp -p %{SOURCE5} README.Fedora %endif %patch12 -p1 %patch13 -p1 -%patch18 -p1 -%patch19 -p1 +%patch20 -p1 +%patch21 -p1 %if %{with perl} && (%{with python3} || %{with python3_other}) && %{with perlcoro} %{__python} -m lib2to3 --write --nobackups plugins/coroae/uwsgiplugin.py @@ -1844,6 +1839,10 @@ exit 0 %changelog +* Fri Jul 28 2023 Ralf Ertzinger - 2.0.22-1 +- Update to 2.0.22 +- Add initial patch for building against python3.12 + * Sat Jul 22 2023 Fedora Release Engineering - 2.0.21-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/uwsgi_fix_jvm_missing_path.patch b/uwsgi_fix_jvm_missing_path.patch new file mode 100644 index 0000000..29960d8 --- /dev/null +++ b/uwsgi_fix_jvm_missing_path.patch @@ -0,0 +1,12 @@ +diff -uNr a/plugins/jvm/uwsgiplugin.py b/plugins/jvm/uwsgiplugin.py +--- a/plugins/jvm/uwsgiplugin.py 2023-07-28 20:59:42.036749911 +0200 ++++ b/plugins/jvm/uwsgiplugin.py 2023-07-28 21:00:11.079400969 +0200 +@@ -36,7 +36,7 @@ + for jvm in known_jvms: + if os.path.exists(jvm + '/include'): + JVM_INCPATH = ["-I%s/include/" % jvm, "-I%s/include/%s" % (jvm, operating_system)] +- if os.path.exists("%s/jre"): ++ if os.path.exists("%s/jre" % jvm): + JVM_LIBPATH = ["-L%s/jre/lib/%s/server" % (jvm, arch)] + else: + JVM_LIBPATH = ["-L%s/lib/server" % (jvm,)] diff --git a/uwsgi_fix_ruby_taint.patch b/uwsgi_fix_ruby_taint.patch index 31f649a..df7fe16 100644 --- a/uwsgi_fix_ruby_taint.patch +++ b/uwsgi_fix_ruby_taint.patch @@ -13,27 +13,3 @@ diff -uNr a/plugins/rack/rack_plugin.c b/plugins/rack/rack_plugin.c } #ifndef RUBY19 -diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py ---- a/plugins/rack/uwsgiplugin.py 2023-06-13 21:46:52.300833924 +0200 -+++ b/plugins/rack/uwsgiplugin.py 2023-06-13 21:48:54.740613764 +0200 -@@ -19,6 +19,8 @@ - CFLAGS.append('-DRUBY19') - CFLAGS.append('-Wno-unused-parameter') - rbconfig = 'RbConfig' -+ if v >= (2, 7): -+ CFLAGS.append('-DRUBY27') - else: - CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['CFLAGS']\"" % rbconfig).read().rstrip().split() - -diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py ---- a/plugins/ruby19/uwsgiplugin.py 2023-06-13 21:46:52.300833924 +0200 -+++ b/plugins/ruby19/uwsgiplugin.py 2023-06-13 21:49:24.566803721 +0200 -@@ -19,6 +19,8 @@ - CFLAGS.append('-DRUBY19') - CFLAGS.append('-Wno-unused-parameter') - rbconfig = 'RbConfig' -+ if v >= (2, 7): -+ CFLAGS.append('-DRUBY27') - else: - CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['CFLAGS']\"" % rbconfig).read().rstrip().split() - diff --git a/uwsgi_python312.patch b/uwsgi_python312.patch new file mode 100644 index 0000000..f04080e --- /dev/null +++ b/uwsgi_python312.patch @@ -0,0 +1,124 @@ +diff -uNr a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c +--- a/plugins/python/python_plugin.c 2022-10-24 12:21:58.000000000 +0200 ++++ b/plugins/python/python_plugin.c 2023-07-13 19:35:32.020467751 +0200 +@@ -1161,7 +1161,10 @@ + + // prepare for stack suspend/resume + if (uwsgi.async > 1) { +-#ifdef UWSGI_PY311 ++#ifdef UWSGI_PY312 ++ up.current_c_recursion_remaining = uwsgi_malloc(sizeof(int)*uwsgi.async); ++ up.current_py_recursion_remaining = uwsgi_malloc(sizeof(int)*uwsgi.async); ++#elif defined UWSGI_PY311 + up.current_recursion_remaining = uwsgi_malloc(sizeof(int)*uwsgi.async); + #else + up.current_recursion_depth = uwsgi_malloc(sizeof(int)*uwsgi.async); +@@ -1324,7 +1327,12 @@ + // Acquire the gil and import lock before forking in order to avoid + // deadlocks in workers + UWSGI_GET_GIL ++#if defined UWSGI_PY312 ++ PyInterpreterState *interp = PyInterpreterState_Get(); ++ _PyImport_AcquireLock(interp); ++#else + _PyImport_AcquireLock(); ++#endif + } + } + +@@ -1336,7 +1344,12 @@ + if (uwsgi.has_threads) { + if (step == 0) { + // Release locks within master process ++#if defined UWSGI_PY312 ++ PyInterpreterState *interp = PyInterpreterState_Get(); ++ _PyImport_ReleaseLock(interp); ++#else + _PyImport_ReleaseLock(); ++#endif + UWSGI_RELEASE_GIL + } + else { +@@ -1592,7 +1605,11 @@ + PyGILState_Release(pgst); + + if (wsgi_req) { +-#ifdef UWSGI_PY311 ++#ifdef UWSGI_PY312 ++ up.current_c_recursion_remaining[wsgi_req->async_id] = tstate->c_recursion_remaining; ++ up.current_py_recursion_remaining[wsgi_req->async_id] = tstate->py_recursion_remaining; ++ up.current_frame[wsgi_req->async_id] = tstate->cframe; ++#elif defined UWSGI_PY311 + up.current_recursion_remaining[wsgi_req->async_id] = tstate->recursion_remaining; + up.current_frame[wsgi_req->async_id] = tstate->cframe; + #else +@@ -1601,7 +1618,11 @@ + #endif + } + else { +-#ifdef UWSGI_PY311 ++#ifdef UWSGI_PY312 ++ up.current_main_c_recursion_remaining = tstate->c_recursion_remaining; ++ up.current_main_py_recursion_remaining = tstate->py_recursion_remaining; ++ up.current_main_frame = tstate->cframe; ++#elif defined UWSGI_PY311 + up.current_main_recursion_remaining = tstate->recursion_remaining; + up.current_main_frame = tstate->cframe; + #else +@@ -1835,7 +1856,11 @@ + PyGILState_Release(pgst); + + if (wsgi_req) { +-#ifdef UWSGI_PY311 ++#ifdef UWSGI_PY312 ++ tstate->c_recursion_remaining = up.current_c_recursion_remaining[wsgi_req->async_id]; ++ tstate->py_recursion_remaining = up.current_py_recursion_remaining[wsgi_req->async_id]; ++ tstate->cframe = up.current_frame[wsgi_req->async_id]; ++#elif defined UWSGI_PY311 + tstate->recursion_remaining = up.current_recursion_remaining[wsgi_req->async_id]; + tstate->cframe = up.current_frame[wsgi_req->async_id]; + #else +@@ -1844,7 +1869,11 @@ + #endif + } + else { +-#ifdef UWSGI_PY311 ++#ifdef UWSGI_PY312 ++ tstate->c_recursion_remaining = up.current_main_c_recursion_remaining; ++ tstate->py_recursion_remaining = up.current_main_py_recursion_remaining; ++ tstate->cframe = up.current_main_frame; ++#elif defined UWSGI_PY311 + tstate->recursion_remaining = up.current_main_recursion_remaining; + tstate->cframe = up.current_main_frame; + #else +diff -uNr a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h +--- a/plugins/python/uwsgi_python.h 2022-10-24 12:21:58.000000000 +0200 ++++ b/plugins/python/uwsgi_python.h 2023-07-13 19:31:50.798050705 +0200 +@@ -21,6 +21,10 @@ + # define UWSGI_PY311 + #endif + ++#if (PY_VERSION_HEX >= 0x030c0000) ++# define UWSGI_PY312 ++#endif ++ + #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 7 + #define HAS_NOT_PyMemoryView_FromBuffer + #endif +@@ -168,7 +172,15 @@ + + char *callable; + +-#ifdef UWSGI_PY311 ++#ifdef UWSGI_PY312 ++ int *current_c_recursion_remaining; ++ int *current_py_recursion_remaining; ++ _PyCFrame **current_frame; ++ ++ int current_main_c_recursion_remaining; ++ int current_main_py_recursion_remaining; ++ _PyCFrame *current_main_frame; ++#elif defined UWSGI_PY311 + int *current_recursion_remaining; + _PyCFrame **current_frame; + diff --git a/uwsgi_ruby20_compatibility.patch b/uwsgi_ruby20_compatibility.patch index 6ac05dd..6fdaa02 100644 --- a/uwsgi_ruby20_compatibility.patch +++ b/uwsgi_ruby20_compatibility.patch @@ -1,7 +1,7 @@ diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py ---- a/plugins/rack/uwsgiplugin.py 2023-06-13 22:05:49.685878391 +0200 -+++ b/plugins/rack/uwsgiplugin.py 2023-06-13 22:07:22.640425653 +0200 -@@ -10,11 +10,11 @@ +--- a/plugins/rack/uwsgiplugin.py 2023-07-28 20:02:57.242903528 +0200 ++++ b/plugins/rack/uwsgiplugin.py 2023-07-28 20:05:59.933863052 +0200 +@@ -10,14 +10,14 @@ rbconfig = 'Config' version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip() @@ -14,11 +14,15 @@ diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py +if v >= (1, 9): CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') +- if version >= '2.7': ++ if v >= (2, 7): + CFLAGS.append('-DRUBY27') CFLAGS.append('-Wno-unused-parameter') + rbconfig = 'RbConfig' diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py ---- a/plugins/ruby19/uwsgiplugin.py 2023-06-13 22:05:49.685878391 +0200 -+++ b/plugins/ruby19/uwsgiplugin.py 2023-06-13 22:07:13.470371664 +0200 -@@ -10,11 +10,11 @@ +--- a/plugins/ruby19/uwsgiplugin.py 2023-07-28 20:02:57.242903528 +0200 ++++ b/plugins/ruby19/uwsgiplugin.py 2023-07-28 20:05:11.560403332 +0200 +@@ -10,14 +10,14 @@ rbconfig = 'Config' version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip() @@ -27,8 +31,12 @@ diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api'] --if v[0] == '1' and v[1] == '9': +-if (v[0] == '1' and v[1] == '9') or v[0] >= '2': +if v >= (1, 9): CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') +- if version >= '2.7': ++ if v >= (2, 7): + CFLAGS.append('-DRUBY27') CFLAGS.append('-Wno-unused-parameter') + rbconfig = 'RbConfig'