Compare commits

...
Sign in to create a new pull request.

87 commits

Author SHA1 Message Date
Ralf Ertzinger
dd58e131b7 Rebuild for new gccgo libraries 2026-01-11 18:29:57 +01:00
Mamoru TASAKA
4f78b765d1 Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_4.0 2026-01-08 20:15:17 +09:00
Ralf Ertzinger
87e2b9fbb4 Fix path errors for EPEL9 uwsgidecorator packages 2025-11-26 21:49:21 +01:00
Remi Collet
b2673a41cc rebuild for https://fedoraproject.org/wiki/Changes/php85 2025-10-15 07:59:30 +02:00
Ralf Ertzinger
451e6fd8be Update to 2.0.31, drop merged patches 2025-10-12 16:53:42 +02:00
Python Maint
fce9901ade Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 15:01:52 +02:00
Ralf Ertzinger
305e1c563f Add python3.13 module for EL9 2025-08-20 20:37:21 +02:00
Python Maint
06e8062cb4 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 15:21:55 +02:00
Ralf Ertzinger
1e2ce24bb0 Disable perl-Coro for rawhide, as this blocks rebuilding
for perl 5.42 (see https://bugzilla.redhat.com/show_bug.cgi?id=2379448)
2025-07-24 16:11:11 +02:00
Jitka Plesnikova
0d453e9ae8 Perl 5.42 rebuild 2025-07-08 14:25:37 +02:00
Python Maint
14c9d4c7a6 Rebuilt for Python 3.14 2025-06-09 07:43:54 +02:00
Ralf Ertzinger
7fdcfd0cd4 Update to 2.0.30 2025-06-08 18:37:32 +02:00
Python Maint
f6a6568654 Rebuilt for Python 3.14 2025-06-03 15:52:55 +02:00
Ralf Ertzinger
b0edddcb6b Update to 2.0.29 2025-04-12 12:57:47 +02:00
Ralf Ertzinger
2cad1e43b7 Rebuild for new libgo 2025-03-24 19:45:33 +01:00
Ralf Ertzinger
e82e663aeb Add sysusers.d config file to allow rpm to create users/groups automatically 2025-02-18 22:23:30 +01:00
Björn Esser
72801155cd
Add explicit BR: libxcrypt-devel
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
2025-02-01 19:58:05 +01:00
Ralf Ertzinger
6e2e54ccb9 Fix type errors flagged by GCC15 2025-01-24 21:14:49 +01:00
Fedora Release Engineering
19e19698a5 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 14:01:56 +00:00
Mamoru TASAKA
6fe6c653dd Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.4 2025-01-08 10:41:52 +09:00
Ralf Ertzinger
b7b8802b0f Update to 2.0.28, drop merged patches 2024-11-02 21:25:32 +01:00
Richard W.M. Jones
64c090a890 Rebuild for Jansson 2.14
(https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/3PYINSQGKQ4BB25NQUI2A2UCGGLAG5ND/)
2024-10-22 13:40:31 +01:00
Ralf Ertzinger
e40dac0496 Fix uWSGI auto-reloading on config change 2024-10-14 20:12:42 +02:00
Remi Collet
d3a2179c1d rebuild for https://fedoraproject.org/wiki/Changes/php84 2024-10-14 10:42:39 +02:00
Ralf Ertzinger
f03b56ba3a Only build fiber plugin when rack plugin is also built 2024-09-29 19:27:25 +02:00
Ralf Ertzinger
670041ecc3 pdate to 2.0.27
Drop merged patches
Re-enable rack plugin for EPEL10, dependencies now present
2024-09-25 18:42:22 +02:00
Ralf Ertzinger
08576b2d25 Disable building the Ruby rack plugin for EPEL10 2024-09-22 21:15:53 +02:00
Miroslav Suchý
ee7dd133dd convert license to SPDX
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4
2024-09-04 22:36:26 +02:00
Ralf Ertzinger
591a578dd8 Cleanup work, EL10 support
- Drop support for EL7
- Add support for EL10
- Explicitly require pcre2 (all builds already pulled this
  in anyway)
2024-09-04 21:44:07 +02:00
Ralf Ertzinger
c0b79e45a5 Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
Add patch for python 3.13
2024-08-15 19:53:46 +02:00
Fedora Release Engineering
dce67072b9 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 08:29:55 +00:00
Jitka Plesnikova
4b286aba5a Perl 5.40 rebuild 2024-06-12 12:48:12 +02:00
Python Maint
0ed57cdb27 Rebuilt for Python 3.13 2024-06-09 01:40:22 +02:00
Ralf Ertzinger
8a5c0bd833 Update to 2.0.26
Rework support for multiple python versions
2024-06-06 19:11:42 +02:00
Ralf Ertzinger
64940f3b45 Rework support for multiple python versions 2024-05-09 20:34:52 +02:00
Ralf Ertzinger
5017f0c5b9 Update to 2.0.25.1, drop merged patches
Use github.com as source for the main tarball
Do not build for i686 any more
2024-04-16 20:24:11 +02:00
Dominik 'Rathann' Mierzejewski
d986271efb Rebuilt for gloox-1.0.28 2024-03-19 10:57:17 +01:00
Ralf Ertzinger
b9c84238a9 Update to 2.0.24, drop merged patches 2024-02-10 21:46:05 +01:00
Fedora Release Engineering
65dfd0fc87 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-27 07:23:48 +00:00
Ralf Ertzinger
94be625586 Build plugin for python3.11 under EPEL9 2024-01-23 21:57:07 +01:00
Ralf Ertzinger
c8dfeab0b8 Add reworked patch for python3.12 2024-01-23 21:35:44 +01:00
Mamoru TASAKA
5d4ae9e199 Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.3 2024-01-03 23:13:45 +09:00
Ralf Ertzinger
b6771ca19f Update to 2.0.23, drop merged patches 2023-11-02 21:31:30 +01:00
Ralf Ertzinger
0bbf1dd464 Add comment for adding patches 2023-10-21 19:17:26 +02:00
Ralf Ertzinger
196bf72239 Drop 2to3 call, it doesn't do anything anymore 2023-10-21 19:15:17 +02:00
Remi Collet
6bb552f1a3 rebuild for https://fedoraproject.org/wiki/Changes/php83
add patch for PHP 8.3 from
  https://github.com/unbit/uwsgi/pull/2559
2023-10-03 10:51:38 +02:00
Ralf Ertzinger
32a6303889 Rework python 3.12 patch 2023-09-30 19:02:38 +02:00
Miro Hrončok
a5bb2db7fa Don't build the Python 3.11 module on Fedora 39+, it is not installable 2023-09-26 12:02:01 +02:00
Ralf Ertzinger
6e64b87273 Changes missing from previous commit (release/clog) 2023-09-16 20:12:35 +02:00
Ralf Ertzinger
c7c2087887 Extend building the python 3.11 module to rawhide 2023-09-16 20:01:03 +02:00
Ralf Ertzinger
e8deb619aa For Fedora 39, build an extra module against Python 3.11
Disable PIE and enable PIC for the mail executable to avoid crashes when using
  the PHP module (see BZ2203863)
2023-09-15 18:16:22 +02:00
Ralf Ertzinger
36451ce9eb Update to 2.0.22
This updates uwsgi to 2.0.22.

It also adds an (incomplete) patch to support python 3.12, used in
the upcoming Fedora 39.
2023-07-30 09:48:50 +02:00
Fedora Release Engineering
9c7aeda849 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 17:21:11 +00:00
Jitka Plesnikova
03e47f3db8 Perl 5.38 rebuild 2023-07-11 15:47:10 +02:00
Python Maint
5a83c85c74 Rebuilt for Python 3.12 2023-06-15 22:51:02 +02:00
Ralf Ertzinger
046b3f783e Rework Ruby patches
Disable python3-greenlet plugin for EPEL9
2023-06-15 19:50:45 +02:00
Python Maint
613d1530bd Rebuilt for Python 3.12 2023-06-15 18:55:12 +02:00
Ralf Ertzinger
9a0d37a514 Fix incomplete patch for Ruby taint issue 2023-04-22 21:20:36 +02:00
Ralf Ertzinger
8e28bafc5e Fix Ruby/Rack plugin for Ruby >= 3.2 2023-04-22 15:28:53 +02:00
Ralf Ertzinger
e5468e855f Rebuilt for new libgo.so 2023-01-24 21:10:19 +01:00
Fedora Release Engineering
4cca0607cd Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-21 06:02:54 +00:00
Mamoru TASAKA
eee272fdb8 Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.2 2023-01-04 15:21:46 +09:00
Ralf Ertzinger
b41d6035d6 Drop the perl-PSGI Requirement from the Perl plugin, it's not
trictly needed
2022-10-28 21:39:35 +02:00
Ralf Ertzinger
9a8c2b97e2 Update to 2.0.21 2022-10-28 19:25:26 +02:00
Ralf Ertzinger
361f4afe4b Fix PHP 8.2 support 2022-10-06 20:23:45 +02:00
Ralf Ertzinger
4cfce955e5 Remove deprecated StandardError setting from .service file 2022-09-16 20:22:45 +02:00
Ralf Ertzinger
a3b3307d31 Fix PHP 8.1 support 2022-08-09 22:10:37 +02:00
Fedora Release Engineering
061e65645f Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 11:37:12 +00:00
Victor Stinner
703b4ef92d Add Python 3.11 support
Resolves: rhbz#2099185
2022-06-30 18:02:15 +02:00
Python Maint
35a88dd5f8 Rebuilt for Python 3.11 2022-06-13 19:54:20 +02:00
Jitka Plesnikova
927b0ea2f0 Perl 5.36 rebuild 2022-06-01 08:39:30 +02:00
Ralf Ertzinger
6d410724c0 Add support for EPEL9 2022-03-04 20:09:54 +01:00
Ralf Ertzinger
73fd0c25da Clean up %post, %preun and %postun scripts 2022-02-23 20:13:29 +01:00
Ralf Ertzinger
9ce919a50a Fix errors in uwsgi python module when building against python3.10 or higher 2022-02-19 21:28:32 +01:00
Ralf Ertzinger
6ce71e5bb0 F37 rebuild for new libgo 2022-02-16 19:40:16 +01:00
Ralf Ertzinger
07af6e6242 Adding emperor-amqp for all targets
Adding emperor-pg for Fedora/EPEL8
Adding emperor-zeromq for Fedora/EPEL8
2022-02-12 13:45:27 +01:00
Ralf Ertzinger
91de37bf29 Fix gccgo plugin build for F36 2022-02-07 22:31:19 +01:00
Ralf Ertzinger
8fe9ce38dd Update to 2.0.20
Fix build against PHP8
Remove support for EL6
General logic cleanup and removal of dead code from the spec file
Add --verbose to build step to show compiler settings
2022-02-02 20:32:34 +01:00
fe1aea352d Unretirement request: https://pagure.io/releng/issue/10604 2022-02-01 08:05:02 +01:00
Miro Hrončok
a94cfe59a9 Orphaned for 6+ weeks 2021-06-17 02:06:02 +02:00
Python Maint
e4283b49ff Rebuilt for Python 3.10 2021-06-04 21:19:09 +02:00
Jitka Plesnikova
7401d4cffd Perl 5.34 rebuild 2021-05-21 23:09:36 +02:00
Tomas Hrnciar
531ba59523 BuildRequire setuptools explicitly
See https://fedoraproject.org/wiki/Changes/Reduce_dependencies_on_python3-setuptools
2021-04-19 13:18:32 +02:00
Michael Scherer
c9429687f8 Fix description for uwsgi-alarm-xmpp 2021-02-14 09:56:00 +01:00
Fedora Release Engineering
19f789b571 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-27 22:51:21 +00:00
Mamoru TASAKA
930caad53a F-34: rebuild against ruby 3.0 2021-01-06 20:25:37 +09:00
Miro Hrončok
168dba046f Rebuilt for libevent soname change 2020-09-15 16:02:41 +02:00
29 changed files with 1840 additions and 408 deletions

24
.gitignore vendored
View file

@ -46,3 +46,27 @@
/uwsgi-docs-32a8f73.tar.gz
/uwsgi-2.0.18.tar.gz
/uwsgi-docs-8d868ea.tar.gz
/uwsgi-2.0.20.tar.gz
/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
/uwsgi-2.0.23.tar.gz
/uwsgi-docs-3be14d3.tar.gz
/uwsgi-2.0.24.tar.gz
/uwsgi-docs-4e23afe.tar.gz
/2.0.25.1.tar.gz
/uwsgi-docs-8dcaacd.tar.gz
/2.0.26.tar.gz
/uwsgi-docs-59e6cd1.tar.gz
/2.0.27.tar.gz
/uwsgi-docs-c0f17cd.tar.gz
/2.0.28.tar.gz
/uwsgi-docs-9606cb0.tar.gz
/2.0.29.tar.gz
/uwsgi-docs-b9da5ea.tar.gz
/2.0.30.tar.gz
/uwsgi-docs-f728a25.tar.gz
/uwsgi-docs-5784c30.tar.gz
/2.0.31.tar.gz

View file

@ -11,7 +11,6 @@ malloc_implementation = libc
embedded_plugins = corerouter, echo, ping
plugins = airbrake,
alarm_curl,
alarm_xmpp,
cache,
carbon,
cgi,
@ -20,9 +19,9 @@ plugins = airbrake,
curl_cron,
dumbloop,
dummy,
emperor_amqp,
fastrouter,
forkptyrouter,
geoip,
graylog2,
http,
ldap,
@ -35,9 +34,7 @@ plugins = airbrake,
nagios,
notfound,
pam,
php,
pty,
rack,
rawrouter,
redislog,
router_basicauth,
@ -67,6 +64,7 @@ plugins = airbrake,
stats_pusher_socket,
stats_pusher_statsd,
syslog,
systemd_logger,
transformation_chunked,
transformation_gzip,
transformation_offload,

View file

@ -1,2 +1,2 @@
SHA512 (uwsgi-2.0.18.tar.gz) = 6561703279bcc4a81311d033810ac066d0f113bab13b0942f3eef86cac29c584a6641b52476840d6895151aee5ed064ae2d03b18932cf7f47e62f4eeed76da61
SHA512 (uwsgi-docs-8d868ea.tar.gz) = 1ebf9bbe42d7a67553ff1081a2322fc00c72b72fa52879bba3b7ce8d9f4934b5643d96444ce75559b9f7303be4cdc0453ae2b4d73f1fa13cfc32f69d522bc2f0
SHA512 (uwsgi-docs-5784c30.tar.gz) = 4f966da4a867e45043a0eb4a123b439c8ab1f7ce6e8b32d770545ff7fae586e4e7dd011106aa6ed0ec82a6c6192937e0fd12ed681443332205566fc329e11cd8
SHA512 (2.0.31.tar.gz) = d4d327f36455438e165298cb5a7d483c951f4acd3d834b46ceeda105bd3664792ead226b02e06db62e92c210544778119bf75a55d9d4f30f8fba896c7de51e6d

View file

@ -1,10 +0,0 @@
diff -up uwsgi-2.0.16/plugins/glusterfs/glusterfs.c.glfs uwsgi-2.0.16/plugins/glusterfs/glusterfs.c
--- uwsgi-2.0.16/plugins/glusterfs/glusterfs.c.glfs 2018-04-03 14:35:48.099323330 +0200
+++ uwsgi-2.0.16/plugins/glusterfs/glusterfs.c 2018-04-03 14:35:07.573068567 +0200
@@ -1,5 +1,5 @@
#include <uwsgi.h>
-#include <api/glfs.h>
+#include <glusterfs/api/glfs.h>
extern struct uwsgi_server uwsgi;

View file

@ -0,0 +1,41 @@
diff -uNr a/core/master_utils.c b/core/master_utils.c
--- a/core/master_utils.c 2024-09-23 22:05:33.000000000 +0200
+++ b/core/master_utils.c 2024-10-14 19:57:00.233290804 +0200
@@ -54,12 +54,6 @@
uwsgi_detach_daemons();
- for (i = 1; i <= uwsgi.numproc; i++) {
- if (uwsgi.workers[i].pid > 0) {
- waitpid(uwsgi.workers[i].pid, &waitpid_status, 0);
- }
- }
-
for (i = 0; i < ushared->gateways_cnt; i++) {
if (ushared->gateways[i].pid > 0) {
kill(ushared->gateways[i].pid, SIGKILL);
diff -uNr a/core/uwsgi.c b/core/uwsgi.c
--- a/core/uwsgi.c 2024-09-23 22:05:33.000000000 +0200
+++ b/core/uwsgi.c 2024-10-14 19:57:00.134291181 +0200
@@ -1319,6 +1319,8 @@
// gracefully destroy
void gracefully_kill_them_all(int signum) {
+ int waitpid_status;
+
if (uwsgi_instance_is_dying) return;
uwsgi.status.gracefully_destroying = 1;
@@ -1341,6 +1343,12 @@
}
}
+
+ for (i = 1; i <= uwsgi.numproc; i++) {
+ if (uwsgi.workers[i].pid > 0) {
+ waitpid(uwsgi.workers[i].pid, &waitpid_status, 0);
+ }
+ }
uwsgi_destroy_processes();
}

View file

@ -9,7 +9,6 @@ ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
Restart=always
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]

1065
uwsgi.spec

File diff suppressed because it is too large Load diff

1
uwsgi.sysusers Normal file
View file

@ -0,0 +1 @@
u uwsgi - 'uWSGI daemon user' /run/uwsgi -

View file

@ -0,0 +1,14 @@
diff -uNr a/core/utils.c b/core/utils.c
--- a/core/utils.c 2021-10-06 07:22:45.000000000 +0200
+++ b/core/utils.c 2022-01-23 12:19:10.715602147 +0100
@@ -593,6 +593,10 @@
uwsgi_error("chroot()");
exit(1);
}
+ if (chdir("/")) {
+ uwsgi_error("chdir()");
+ exit(1);
+ }
uwsgi.is_chrooted = 1;
#ifdef __linux__
if (uwsgi.logging_options.memory_report) {

View file

@ -0,0 +1,64 @@
diff -uNr a/uwsgiconfig.py b/uwsgiconfig.py
--- a/uwsgiconfig.py 2024-02-09 21:30:45.436292711 +0100
+++ b/uwsgiconfig.py 2024-02-09 21:32:29.607595604 +0100
@@ -690,7 +690,27 @@
'-D_LARGEFILE_SOURCE',
'-D_FILE_OFFSET_BITS=64'
]
- if "gcc" in GCC:
+
+ gcc_version = spcall("%s -dumpversion" % GCC)
+ if not gcc_version and GCC.startswith('gcc'):
+ if uwsgi_os == 'Darwin':
+ GCC = 'llvm-' + GCC
+ else:
+ GCC = 'gcc'
+ gcc_version = spcall("%s -dumpversion" % GCC)
+
+ try:
+ gcc_version_components = gcc_version.split('.')
+ gcc_major = int(gcc_version_components[0])
+ if len(gcc_version_components) > 1:
+ gcc_minor = int(gcc_version_components[1])
+ else:
+ # gcc 5.0 is represented as simply "5"
+ gcc_minor = 0
+ except Exception:
+ raise Exception("you need a C compiler to build uWSGI")
+
+ if "gcc" in GCC and gcc_major >= 5:
cflags.append('-Wformat-signedness')
self.cflags = cflags + os.environ.get("CFLAGS", "").split() + self.get('cflags', '').split()
@@ -710,14 +730,6 @@
if uwsgi_os == 'GNU':
self.cflags.append('-D__HURD__')
- gcc_version = spcall("%s -dumpversion" % GCC)
- if not gcc_version and GCC.startswith('gcc'):
- if uwsgi_os == 'Darwin':
- GCC = 'llvm-' + GCC
- else:
- GCC = 'gcc'
- gcc_version = spcall("%s -dumpversion" % GCC)
-
try:
add_it = False
cpp_include_list = str(spcall3("%s -v" % CPP)).split("\n")
@@ -750,16 +762,6 @@
if not mute:
print("detected include path: %s" % self.include_path)
- try:
- gcc_version_components = gcc_version.split('.')
- gcc_major = int(gcc_version_components[0])
- if len(gcc_version_components) > 1:
- gcc_minor = int(gcc_version_components[1])
- else:
- # gcc 5.0 is represented as simply "5"
- gcc_minor = 0
- except:
- raise Exception("you need a C compiler to build uWSGI")
if (sys.version_info[0] == 2) or (gcc_major < 4) or (gcc_major == 4 and gcc_minor < 3):
self.cflags = self.cflags + ['-fno-strict-aliasing']
# add -fno-strict-aliasing only on python2 and gcc < 4.3

View file

@ -0,0 +1,13 @@
diff --git a/plugins/glusterfs/glusterfs.c b/plugins/glusterfs/glusterfs.c
index 83428faf..c0063f4e 100644
--- a/plugins/glusterfs/glusterfs.c
+++ b/plugins/glusterfs/glusterfs.c
@@ -46,7 +46,7 @@ struct uwsgi_glusterfs_async_io {
ssize_t rlen;
};
-static void uwsgi_glusterfs_read_async_cb(glfs_fd_t *fd, ssize_t rlen, void *data) {
+static void uwsgi_glusterfs_read_async_cb(glfs_fd_t *fd, ssize_t rlen, struct glfs_stat *prestat, struct glfs_stat *poststat, void *data) {
struct uwsgi_glusterfs_async_io *aio = (struct uwsgi_glusterfs_async_io *) data;
#ifdef UWSGI_DEBUG
uwsgi_log("[glusterfs-cb] rlen = %d\n", rlen);

View file

@ -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,)]

View file

@ -1,15 +1,15 @@
diff -Naurp a/plugins/mono/uwsgiplugin.py b/plugins/mono/uwsgiplugin.py
--- a/plugins/mono/uwsgiplugin.py 2016-10-03 03:16:59.000000000 -0500
+++ b/plugins/mono/uwsgiplugin.py 2017-03-20 16:18:54.917935286 -0500
@@ -1,9 +1,9 @@
import os
NAME='mono'
diff -uNwr a/plugins/mono/uwsgiplugin.py b/plugins/mono/uwsgiplugin.py
--- a/plugins/mono/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200
+++ b/plugins/mono/uwsgiplugin.py 2022-10-27 20:47:38.791413699 +0200
@@ -3,9 +3,9 @@
NAME = 'mono'
-CFLAGS = os.popen('pkg-config --cflags mono-2').read().rstrip().split()
+CFLAGS = os.popen('pkg-config --cflags mono-2 glib-2.0').read().rstrip().split()
LDFLAGS = []
-LIBS = os.popen('pkg-config --libs mono-2').read().rstrip().split()
+LIBS = os.popen('pkg-config --libs mono-2 glib-2.0').read().rstrip().split()
+LIBS = os.popen('pkg-config --libs mono-2 glib-2.0').read().rstrip().split()
GCC_LIST = ['mono_plugin']
if os.uname()[0] == 'Darwin':

View file

@ -1,16 +0,0 @@
diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c
index 72c390223..1690fb60c 100644
--- a/plugins/php/php_plugin.c
+++ b/plugins/php/php_plugin.c
@@ -1115,10 +1115,9 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
SG(request_info).path_translated = wsgi_req->file;
+ memset(&file_handle, 0, sizeof(zend_file_handle));
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = real_filename;
- file_handle.free_filename = 0;
- file_handle.opened_path = NULL;
if (php_request_startup(TSRMLS_C) == FAILURE) {
uwsgi_500(wsgi_req);

17
uwsgi_fix_php8.patch Normal file
View file

@ -0,0 +1,17 @@
diff -uNr a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
--- a/plugins/php/uwsgiplugin.py 2022-01-22 22:40:33.783038869 +0100
+++ b/plugins/php/uwsgiplugin.py 2022-01-22 22:41:45.261394898 +0100
@@ -20,7 +20,12 @@
if ld_run_path:
LDFLAGS.append('-L%s' % ld_run_path)
-LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp' + php_version]
+# PHP8 and above does not add the version to the library
+# name
+if int(php_version) < 8:
+ LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp' + php_version]
+else:
+ LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp']
phplibdir = os.environ.get('UWSGICONFIG_PHPLIBDIR')
if phplibdir:

View file

@ -0,0 +1,42 @@
From 8ca18da9a01eee19156243c5c0d28d2572698e4a Mon Sep 17 00:00:00 2001
From: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Date: Sun, 30 Jan 2022 14:31:50 +0100
Subject: [PATCH] plugins/php: handle php8.1 zend_file_handle signature change
filename is now a zend_string.
Refs #2394
---
plugins/php/php_plugin.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c
index d336adddc..8b5a24156 100644
--- a/plugins/php/php_plugin.c
+++ b/plugins/php/php_plugin.c
@@ -1096,14 +1096,19 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
SG(request_info).path_translated = wsgi_req->file;
- memset(&file_handle, 0, sizeof(zend_file_handle));
- file_handle.type = ZEND_HANDLE_FILENAME;
- file_handle.filename = real_filename;
+#if PHP_VERSION_ID >= 80100
+ zend_string *handle_filename = zend_string_init(real_filename, real_filename_len, 0);
+#else
+ const char *handle_filename = real_filename;
+#endif
+ memset(&file_handle, 0, sizeof(zend_file_handle));
+ file_handle.type = ZEND_HANDLE_FILENAME;
+ file_handle.filename = handle_filename;
- if (php_request_startup() == FAILURE) {
+ if (php_request_startup() == FAILURE) {
uwsgi_500(wsgi_req);
- return -1;
- }
+ return -1;
+ }
struct uwsgi_string_list *usl=NULL;

15
uwsgi_fix_php82.patch Normal file
View file

@ -0,0 +1,15 @@
diff -uNr a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c
--- a/plugins/php/php_plugin.c 2022-10-06 19:52:07.237882916 +0200
+++ b/plugins/php/php_plugin.c 2022-10-06 19:56:29.232418542 +0200
@@ -607,7 +607,11 @@
static int php_uwsgi_startup(sapi_module_struct *sapi_module)
{
+#if PHP_VERSION_ID >= 80200
+ if (php_module_startup(&uwsgi_sapi_module, &uwsgi_module_entry)==FAILURE) {
+#else
if (php_module_startup(&uwsgi_sapi_module, &uwsgi_module_entry, 1)==FAILURE) {
+#endif
return FAILURE;
} else {
return SUCCESS;

52
uwsgi_fix_php83.patch Normal file
View file

@ -0,0 +1,52 @@
From 064984116e86ac0a5d5d3805765395b661fc4455 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 4 Sep 2023 13:10:52 +0200
Subject: [PATCH] ini_entries is read-only PHP 8.3
---
plugins/php/php_plugin.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c
index b3efa006a..d9b615bac 100644
--- a/plugins/php/php_plugin.c
+++ b/plugins/php/php_plugin.c
@@ -27,6 +27,7 @@ struct uwsgi_php {
char *fallback;
char *fallback2;
char *fallback_qs;
+ char *ini_entries;
size_t ini_size;
int dump_config;
char *server_software;
@@ -232,21 +233,22 @@ static sapi_module_struct uwsgi_sapi_module;
void uwsgi_php_append_config(char *filename) {
size_t file_size = 0;
- char *file_content = uwsgi_open_and_read(filename, &file_size, 1, NULL);
- uwsgi_sapi_module.ini_entries = realloc(uwsgi_sapi_module.ini_entries, uphp.ini_size + file_size);
- memcpy(uwsgi_sapi_module.ini_entries + uphp.ini_size, file_content, file_size);
+ char *file_content = uwsgi_open_and_read(filename, &file_size, 1, NULL);
+ uphp.ini_entries = realloc(uphp.ini_entries, uphp.ini_size + file_size);
+ memcpy(uphp.ini_entries + uphp.ini_size, file_content, file_size);
uphp.ini_size += file_size-1;
free(file_content);
+ uwsgi_sapi_module.ini_entries = uphp.ini_entries;
}
void uwsgi_php_set(char *opt) {
- uwsgi_sapi_module.ini_entries = realloc(uwsgi_sapi_module.ini_entries, uphp.ini_size + strlen(opt)+2);
- memcpy(uwsgi_sapi_module.ini_entries + uphp.ini_size, opt, strlen(opt));
-
+ uphp.ini_entries = realloc(uphp.ini_entries, uphp.ini_size + strlen(opt)+2);
+ memcpy(uphp.ini_entries + uphp.ini_size, opt, strlen(opt));
uphp.ini_size += strlen(opt)+1;
- uwsgi_sapi_module.ini_entries[uphp.ini_size-1] = '\n';
- uwsgi_sapi_module.ini_entries[uphp.ini_size] = 0;
+ uphp.ini_entries[uphp.ini_size-1] = '\n';
+ uphp.ini_entries[uphp.ini_size] = 0;
+ uwsgi_sapi_module.ini_entries = uphp.ini_entries;
}
extern ps_module ps_mod_uwsgi;

View file

@ -0,0 +1,43 @@
diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c
index 717d6317b..d336adddc 100644
--- a/plugins/php/php_plugin.c
+++ b/plugins/php/php_plugin.c
@@ -497,21 +497,24 @@ PHP_FUNCTION(uwsgi_signal) {
RETURN_NULL();
}
+ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
zend_function_entry uwsgi_php_functions[] = {
- PHP_FE(uwsgi_version, NULL)
- PHP_FE(uwsgi_setprocname, NULL)
- PHP_FE(uwsgi_worker_id, NULL)
- PHP_FE(uwsgi_masterpid, NULL)
- PHP_FE(uwsgi_signal, NULL)
-
- PHP_FE(uwsgi_rpc, NULL)
-
- PHP_FE(uwsgi_cache_get, NULL)
- PHP_FE(uwsgi_cache_set, NULL)
- PHP_FE(uwsgi_cache_update, NULL)
- PHP_FE(uwsgi_cache_del, NULL)
- PHP_FE(uwsgi_cache_clear, NULL)
- PHP_FE(uwsgi_cache_exists, NULL)
+ PHP_FE(uwsgi_version, arginfo_void)
+ PHP_FE(uwsgi_setprocname, arginfo_void)
+ PHP_FE(uwsgi_worker_id, arginfo_void)
+ PHP_FE(uwsgi_masterpid, arginfo_void)
+ PHP_FE(uwsgi_signal, arginfo_void)
+
+ PHP_FE(uwsgi_rpc, arginfo_void)
+
+ PHP_FE(uwsgi_cache_get, arginfo_void)
+ PHP_FE(uwsgi_cache_set, arginfo_void)
+ PHP_FE(uwsgi_cache_update, arginfo_void)
+ PHP_FE(uwsgi_cache_del, arginfo_void)
+ PHP_FE(uwsgi_cache_clear, arginfo_void)
+ PHP_FE(uwsgi_cache_exists, arginfo_void)
{ NULL, NULL, NULL},
};

View file

@ -1,38 +0,0 @@
diff --git a/plugins/psgi/psgi.h b/plugins/psgi/psgi.h
index 92e6b588..064041a2 100644
--- a/plugins/psgi/psgi.h
+++ b/plugins/psgi/psgi.h
@@ -87,3 +87,5 @@ void uwsgi_perl_exec(char *);
void uwsgi_perl_check_auto_reload(void);
void uwsgi_psgi_preinit_apps(void);
+
+extern struct uwsgi_perl uperl;
diff --git a/plugins/psgi/psgi_loader.c b/plugins/psgi/psgi_loader.c
index 1e61f0e9..a9211185 100644
--- a/plugins/psgi/psgi_loader.c
+++ b/plugins/psgi/psgi_loader.c
@@ -1,7 +1,6 @@
#include "psgi.h"
extern struct uwsgi_server uwsgi;
-struct uwsgi_perl uperl;
extern struct uwsgi_plugin psgi_plugin;
diff --git a/plugins/psgi/psgi_plugin.c b/plugins/psgi/psgi_plugin.c
index e1177be2..8ca0a2ed 100644
--- a/plugins/psgi/psgi_plugin.c
+++ b/plugins/psgi/psgi_plugin.c
@@ -3,11 +3,7 @@
extern char **environ;
extern struct uwsgi_server uwsgi;
-#ifdef __APPLE__
-extern struct uwsgi_perl uperl;
-#else
struct uwsgi_perl uperl;
-#endif
struct uwsgi_plugin psgi_plugin;

View file

@ -0,0 +1,11 @@
diff -uNr a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h
--- a/plugins/python/uwsgi_python.h 2021-10-06 07:22:45.000000000 +0200
+++ b/plugins/python/uwsgi_python.h 2022-02-19 18:39:10.929895062 +0100
@@ -1,3 +1,7 @@
+// This needs to be defined before Python.h is included
+// to indicate that the code uses Py_ssize_t properly
+#define PY_SSIZE_T_CLEAN
+
#include <uwsgi.h>
#include <Python.h>

View file

@ -1,8 +1,7 @@
diff --git a/plugins/jvm/uwsgiplugin.py b/plugins/jvm/uwsgiplugin.py
index f39ad63..d9e95bb 100644
--- a/plugins/jvm/uwsgiplugin.py
+++ b/plugins/jvm/uwsgiplugin.py
@@ -65,11 +65,6 @@ if "-framework JavaVM" in JVM_LIBPATH:
diff -uNr a/plugins/jvm/uwsgiplugin.py b/plugins/jvm/uwsgiplugin.py
--- a/plugins/jvm/uwsgiplugin.py 2024-02-08 17:35:28.000000000 +0100
+++ b/plugins/jvm/uwsgiplugin.py 2024-02-08 21:55:26.627134235 +0100
@@ -69,11 +69,6 @@
GCC_LIST = ['jvm_plugin']
@ -12,38 +11,36 @@ index f39ad63..d9e95bb 100644
- os.environ['LD_RUN_PATH'] = JVM_LIBPATH[0][2:]
-
def post_build(config):
if os.system("javac %s/plugins/jvm/uwsgi.java" % os.getcwd()) != 0:
if subprocess.call("javac %s/plugins/jvm/uwsgi.java" % os.getcwd(), shell=True) != 0:
os._exit(1)
diff --git a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
index d930c44..273cdde 100644
--- a/plugins/php/uwsgiplugin.py
+++ b/plugins/php/uwsgiplugin.py
@@ -19,7 +19,6 @@ LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split()
diff -uNr a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
--- a/plugins/php/uwsgiplugin.py 2024-02-08 17:35:28.000000000 +0100
+++ b/plugins/php/uwsgiplugin.py 2024-02-08 21:56:28.630427541 +0100
@@ -19,7 +19,6 @@
if ld_run_path:
LDFLAGS.append('-L%s' % ld_run_path)
- os.environ['LD_RUN_PATH'] = ld_run_path
LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp' + php_version]
# PHP8 and above does not add the version to the library
# name
diff -uNr a/plugins/python/uwsgiplugin.py b/plugins/python/uwsgiplugin.py
--- a/plugins/python/uwsgiplugin.py 2024-02-08 17:35:28.000000000 +0100
+++ b/plugins/python/uwsgiplugin.py 2024-02-08 21:55:26.654133927 +0100
@@ -88,9 +88,6 @@
libdir = "%s/lib" % sysconfig.PREFIX
diff --git a/plugins/python/uwsgiplugin.py b/plugins/python/uwsgiplugin.py
index 843876f..69ae68f 100644
--- a/plugins/python/uwsgiplugin.py
+++ b/plugins/python/uwsgiplugin.py
@@ -58,8 +58,6 @@ if not 'UWSGI_PYTHON_NOLIB' in os.environ:
LDFLAGS.append("-L%s" % libdir)
LDFLAGS.append("-Wl,-rpath,%s" % libdir)
- os.environ['LD_RUN_PATH'] = "%s" % libdir
- LDFLAGS.append("-Wl,-rpath,%s" % libdir)
-
- os.environ['LD_RUN_PATH'] = "%s" % libdir
LIBS.append('-lpython%s' % get_python_version())
else:
LIBS = []
diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
index 210b28e..06f5edd 100644
--- a/plugins/rack/uwsgiplugin.py
+++ b/plugins/rack/uwsgiplugin.py
@@ -46,7 +46,6 @@ LIBS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['LIBS']\""
diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
--- a/plugins/rack/uwsgiplugin.py 2024-02-08 17:35:28.000000000 +0100
+++ b/plugins/rack/uwsgiplugin.py 2024-02-08 21:55:26.655133916 +0100
@@ -48,7 +48,6 @@
if has_shared == 'yes':
LDFLAGS.append('-L' + libpath )
@ -51,11 +48,10 @@ index 210b28e..06f5edd 100644
LIBS.append(os.popen(RUBYPATH + " -e \"require 'rbconfig';print '-l' + %s::CONFIG['RUBY_SO_NAME']\"" % rbconfig).read().rstrip())
else:
rubylibdir = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['rubylibdir']\"").read().rstrip()
diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
index ecea48d..4f35984 100644
--- a/plugins/ruby19/uwsgiplugin.py
+++ b/plugins/ruby19/uwsgiplugin.py
@@ -40,6 +40,5 @@ LDFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['LDFLAG
diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
--- a/plugins/ruby19/uwsgiplugin.py 2024-02-08 17:35:28.000000000 +0100
+++ b/plugins/ruby19/uwsgiplugin.py 2024-02-08 21:55:26.655133916 +0100
@@ -42,6 +42,5 @@
libpath = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['libdir']\"" % rbconfig).read().rstrip()
LDFLAGS.append('-L' + libpath )

View file

@ -0,0 +1,15 @@
diff -uNr a/plugins/rack/rack_plugin.c b/plugins/rack/rack_plugin.c
--- a/plugins/rack/rack_plugin.c 2022-10-24 12:21:58.000000000 +0200
+++ b/plugins/rack/rack_plugin.c 2023-06-13 21:47:46.514179214 +0200
@@ -456,7 +456,11 @@
static void rack_hack_dollar_zero(VALUE name, ID id) {
ur.dollar_zero = rb_obj_as_string(name);
+ // From ruby 2.7 onwards this is a noop, from ruby 3.2 onwards
+ // this function no longer exists
+#if !defined(RUBY27)
rb_obj_taint(ur.dollar_zero);
+#endif
}
#ifndef RUBY19

View file

@ -0,0 +1,33 @@
diff -uNr a/plugins/pty/pty.c b/plugins/pty/pty.c
--- a/plugins/pty/pty.c 2024-10-26 11:59:26.000000000 +0200
+++ b/plugins/pty/pty.c 2025-01-24 20:04:55.952597269 +0100
@@ -259,7 +259,7 @@
}
-static void uwsgi_pty_winch() {
+static void uwsgi_pty_winch(int signum) {
// 2 uwsgi packets
char uwsgi_pkt[8];
#ifdef TIOCGWINSZ
@@ -309,7 +309,7 @@
if (upty.uremote) {
signal(SIGWINCH, uwsgi_pty_winch);
// send current terminal size
- uwsgi_pty_winch();
+ uwsgi_pty_winch(0);
}
upty.queue = event_queue_init();
diff -uNr a/plugins/tuntap/tuntap.c b/plugins/tuntap/tuntap.c
--- a/plugins/tuntap/tuntap.c 2024-10-26 11:59:26.000000000 +0200
+++ b/plugins/tuntap/tuntap.c 2025-01-24 20:33:49.513449322 +0100
@@ -409,7 +409,7 @@
}
}
-static void uwsgi_tuntap_router() {
+static void uwsgi_tuntap_router(int (*_)(void *), char ** __) {
if (!utt.routers) return;

174
uwsgi_python311.patch Normal file
View file

@ -0,0 +1,174 @@
Add Python 3.11 support
Backport of https://github.com/unbit/uwsgi/pull/2453
Resolves: rhbz#2099185
diff --git a/plugins/python/profiler.c b/plugins/python/profiler.c
index 92bc3da..2a7e1cc 100644
--- a/plugins/python/profiler.c
+++ b/plugins/python/profiler.c
@@ -13,6 +13,14 @@ int PyFrame_GetLineNumber(PyFrameObject *frame) {
}
#endif
+#if PY_VERSION_HEX < 0x030900B1
+PyCodeObject* PyFrame_GetCode(PyFrameObject *frame)
+{
+ Py_INCREF(frame->f_code);
+ return frame->f_code;
+}
+#endif
+
#ifdef PYTHREE
#undef PyString_AsString
static char *PyString_AsString(PyObject *o) {
@@ -27,27 +35,32 @@ int uwsgi_python_profiler_call(PyObject *obj, PyFrameObject *frame, int what, Py
static uint64_t last_ts = 0;
uint64_t now = uwsgi_micros();
uint64_t delta = 0;
+ PyCodeObject *code;
switch(what) {
case PyTrace_CALL:
if (last_ts == 0) delta = 0;
else delta = now - last_ts;
last_ts = now;
+ code = PyFrame_GetCode(frame);
uwsgi_log("[uWSGI Python profiler %llu] CALL: %s (line %d) -> %s %d args, stacksize %d\n",
(unsigned long long) delta,
- PyString_AsString(frame->f_code->co_filename),
+ PyString_AsString(code->co_filename),
PyFrame_GetLineNumber(frame),
- PyString_AsString(frame->f_code->co_name), frame->f_code->co_argcount, frame->f_code->co_stacksize);
+ PyString_AsString(code->co_name), code->co_argcount, code->co_stacksize);
+ Py_DECREF(code);
break;
case PyTrace_C_CALL:
if (last_ts == 0) delta = 0;
else delta = now - last_ts;
last_ts = now;
+ code = PyFrame_GetCode(frame);
uwsgi_log("[uWSGI Python profiler %llu] C CALL: %s (line %d) -> %s %d args, stacksize %d\n",
(unsigned long long) delta,
- PyString_AsString(frame->f_code->co_filename),
+ PyString_AsString(code->co_filename),
PyFrame_GetLineNumber(frame),
- PyEval_GetFuncName(arg), frame->f_code->co_argcount, frame->f_code->co_stacksize);
+ PyEval_GetFuncName(arg), code->co_argcount, code->co_stacksize);
+ Py_DECREF(code);
break;
}
@@ -68,7 +81,9 @@ int uwsgi_python_tracer(PyObject *obj, PyFrameObject *frame, int what, PyObject
delta = now - last_ts;
}
last_ts = now;
- uwsgi_log("[uWSGI Python profiler %llu] file %s line %d: %s argc:%d\n", (unsigned long long)delta, PyString_AsString(frame->f_code->co_filename), PyFrame_GetLineNumber(frame), PyString_AsString(frame->f_code->co_name), frame->f_code->co_argcount);
+ PyCodeObject *code = PyFrame_GetCode(frame);
+ uwsgi_log("[uWSGI Python profiler %llu] file %s line %d: %s argc:%d\n", (unsigned long long)delta, PyString_AsString(code->co_filename), PyFrame_GetLineNumber(frame), PyString_AsString(code->co_name), code->co_argcount);
+ Py_DECREF(code);
}
return 0;
diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c
index 6834f84..1d21c0d 100644
--- a/plugins/python/python_plugin.c
+++ b/plugins/python/python_plugin.c
@@ -1137,9 +1137,13 @@ void uwsgi_python_init_apps() {
}
// prepare for stack suspend/resume
- if (uwsgi.async > 1) {
+ if (uwsgi.async > 0) {
+#ifdef UWSGI_PY311
+ up.current_recursion_remaining = uwsgi_malloc(sizeof(int)*uwsgi.async);
+#else
up.current_recursion_depth = uwsgi_malloc(sizeof(int)*uwsgi.async);
- up.current_frame = uwsgi_malloc(sizeof(struct _frame)*uwsgi.async);
+#endif
+ up.current_frame = uwsgi_malloc(sizeof(up.current_frame[0])*uwsgi.async);
}
// setup app loaders
@@ -1530,12 +1534,22 @@ void uwsgi_python_suspend(struct wsgi_request *wsgi_req) {
PyGILState_Release(pgst);
if (wsgi_req) {
+#ifdef UWSGI_PY311
+ up.current_recursion_remaining[wsgi_req->async_id] = tstate->recursion_remaining;
+ up.current_frame[wsgi_req->async_id] = tstate->cframe;
+#else
up.current_recursion_depth[wsgi_req->async_id] = tstate->recursion_depth;
up.current_frame[wsgi_req->async_id] = tstate->frame;
+#endif
}
else {
+#ifdef UWSGI_PY311
+ up.current_main_recursion_remaining = tstate->recursion_remaining;
+ up.current_main_frame = tstate->cframe;
+#else
up.current_main_recursion_depth = tstate->recursion_depth;
up.current_main_frame = tstate->frame;
+#endif
}
}
@@ -1763,12 +1777,22 @@ void uwsgi_python_resume(struct wsgi_request *wsgi_req) {
PyGILState_Release(pgst);
if (wsgi_req) {
+#ifdef UWSGI_PY311
+ tstate->recursion_remaining = up.current_recursion_remaining[wsgi_req->async_id];
+ tstate->cframe = up.current_frame[wsgi_req->async_id];
+#else
tstate->recursion_depth = up.current_recursion_depth[wsgi_req->async_id];
tstate->frame = up.current_frame[wsgi_req->async_id];
+#endif
}
else {
+#ifdef UWSGI_PY311
+ tstate->recursion_remaining = up.current_main_recursion_remaining;
+ tstate->cframe = up.current_main_frame;
+#else
tstate->recursion_depth = up.current_main_recursion_depth;
tstate->frame = up.current_main_frame;
+#endif
}
}
diff --git a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h
index 357d731..6c6f7a4 100644
--- a/plugins/python/uwsgi_python.h
+++ b/plugins/python/uwsgi_python.h
@@ -18,6 +18,10 @@
#define UWSGI_PYTHON_OLD
#endif
+#if (PY_VERSION_HEX >= 0x030b0000)
+# define UWSGI_PY311
+#endif
+
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 7
#define HAS_NOT_PyMemoryView_FromBuffer
#endif
@@ -165,11 +169,19 @@ struct uwsgi_python {
char *callable;
+#ifdef UWSGI_PY311
+ int *current_recursion_remaining;
+ _PyCFrame **current_frame;
+
+ int current_main_recursion_remaining;
+ _PyCFrame *current_main_frame;
+#else
int *current_recursion_depth;
struct _frame **current_frame;
int current_main_recursion_depth;
struct _frame *current_main_frame;
+#endif
void (*swap_ts)(struct wsgi_request *, struct uwsgi_app *);
void (*reset_ts)(struct wsgi_request *, struct uwsgi_app *);

82
uwsgi_python312-2.patch Normal file
View file

@ -0,0 +1,82 @@
diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c
index de92f34c..08d99a96 100644
--- a/plugins/python/python_plugin.c
+++ b/plugins/python/python_plugin.c
@@ -233,21 +233,6 @@ void uwsgi_python_pthread_child(void) {
PyMethodDef uwsgi_spit_method[] = { {"uwsgi_spit", py_uwsgi_spit, METH_VARARGS, ""} };
PyMethodDef uwsgi_write_method[] = { {"uwsgi_write", py_uwsgi_write, METH_VARARGS, ""} };
-PyDoc_STRVAR(uwsgi_py_doc, "uWSGI api module.");
-
-#ifdef PYTHREE
-static PyModuleDef uwsgi_module3 = {
- PyModuleDef_HEAD_INIT,
- "uwsgi",
- uwsgi_py_doc,
- -1,
- NULL,
-};
-PyObject *init_uwsgi3(void) {
- return PyModule_Create(&uwsgi_module3);
-}
-#endif
-
int uwsgi_python_init() {
char *pyversion = strchr(Py_GetVersion(), '\n');
@@ -313,9 +298,6 @@ pep405:
wchar_t *pname = uwsgi_calloc(sizeof(wchar_t) * (strlen(program_name)+1));
mbstowcs(pname, program_name, strlen(program_name)+1);
Py_SetProgramName(pname);
-#ifdef UWSGI_PY312
- PyImport_AppendInittab("uwsgi", init_uwsgi3);
-#endif
#else
Py_SetProgramName(program_name);
#endif
@@ -678,6 +660,21 @@ next:
+PyDoc_STRVAR(uwsgi_py_doc, "uWSGI api module.");
+
+#ifdef PYTHREE
+static PyModuleDef uwsgi_module3 = {
+ PyModuleDef_HEAD_INIT,
+ "uwsgi",
+ uwsgi_py_doc,
+ -1,
+ NULL,
+};
+PyObject *init_uwsgi3(void) {
+ return PyModule_Create(&uwsgi_module3);
+}
+#endif
+
void init_uwsgi_embedded_module() {
PyObject *new_uwsgi_module, *zero;
int i;
@@ -698,10 +695,21 @@ void init_uwsgi_embedded_module() {
#ifdef PYTHREE
-#ifndef UWSGI_PY312
+# ifndef UWSGI_PY312
PyImport_AppendInittab("uwsgi", init_uwsgi3);
-#endif
new_uwsgi_module = PyImport_AddModule("uwsgi");
+# else
+ // From python 3.12 onwards, PyImport_AppendInittab() can no
+ // longer be called after Py_Initialize(). Instead, dynamically
+ // add the module instead
+ PyObject *sys_modules;
+ PyImport_AddModule("uwsgi");
+ new_uwsgi_module = init_uwsgi3();
+ sys_modules = PyImport_GetModuleDict();
+ PyDict_SetItemString(sys_modules, "uwsgi", new_uwsgi_module);
+ Py_DECREF(new_uwsgi_module);
+
+# endif
#else
new_uwsgi_module = Py_InitModule3("uwsgi", NULL, uwsgi_py_doc);
#endif

152
uwsgi_python312.patch Normal file
View file

@ -0,0 +1,152 @@
diff -uNr a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c
--- a/plugins/python/python_plugin.c 2023-07-27 17:34:12.000000000 +0200
+++ b/plugins/python/python_plugin.c 2023-09-30 18:30:47.884490233 +0200
@@ -197,6 +197,7 @@
PyMethodDef uwsgi_spit_method[] = { {"uwsgi_spit", py_uwsgi_spit, METH_VARARGS, ""} };
PyMethodDef uwsgi_write_method[] = { {"uwsgi_write", py_uwsgi_write, METH_VARARGS, ""} };
+PyObject *init_uwsgi3(void);
int uwsgi_python_init() {
char *pyversion = strchr(Py_GetVersion(), '\n');
@@ -261,6 +262,9 @@
wchar_t *pname = uwsgi_calloc(sizeof(wchar_t) * (strlen(program_name)+1));
mbstowcs(pname, program_name, strlen(program_name)+1);
Py_SetProgramName(pname);
+#ifdef UWSGI_PY312
+ PyImport_AppendInittab("uwsgi", init_uwsgi3);
+#endif
#else
Py_SetProgramName(program_name);
#endif
@@ -658,7 +662,9 @@
#ifdef PYTHREE
+#ifndef UWSGI_PY312
PyImport_AppendInittab("uwsgi", init_uwsgi3);
+#endif
new_uwsgi_module = PyImport_AddModule("uwsgi");
#else
new_uwsgi_module = Py_InitModule3("uwsgi", NULL, uwsgi_py_doc);
@@ -1161,7 +1167,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 +1333,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 +1350,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 +1611,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 +1624,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 +1862,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 +1875,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 2023-07-27 17:34:12.000000000 +0200
+++ b/plugins/python/uwsgi_python.h 2023-09-30 18:30:24.766699317 +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;

193
uwsgi_python313.patch Normal file
View file

@ -0,0 +1,193 @@
diff -uNr a/core/init.c b/core/init.c
--- a/core/init.c 2024-06-01 20:40:38.000000000 +0200
+++ b/core/init.c 2024-08-13 09:56:13.152870522 +0200
@@ -432,8 +432,8 @@
uwsgi.cores = uwsgi.async;
}
+ uwsgi.has_threads = 1;
if (uwsgi.threads > 1) {
- uwsgi.has_threads = 1;
uwsgi.cores = uwsgi.threads;
}
diff -uNr a/core/uwsgi.c b/core/uwsgi.c
--- a/core/uwsgi.c 2024-06-01 20:40:38.000000000 +0200
+++ b/core/uwsgi.c 2024-08-13 09:56:13.156870522 +0200
@@ -197,7 +197,7 @@
{"freebind", no_argument, 0, "put socket in freebind mode", uwsgi_opt_true, &uwsgi.freebind, 0},
#endif
{"map-socket", required_argument, 0, "map sockets to specific workers", uwsgi_opt_add_string_list, &uwsgi.map_socket, 0},
- {"enable-threads", no_argument, 'T', "enable threads", uwsgi_opt_true, &uwsgi.has_threads, 0},
+ {"enable-threads", no_argument, 'T', "enable threads (stub option this is true by default)", uwsgi_opt_true, &uwsgi.has_threads, 0},
{"no-threads-wait", no_argument, 0, "do not wait for threads cancellation on quit/reload", uwsgi_opt_true, &uwsgi.no_threads_wait, 0},
{"auto-procname", no_argument, 0, "automatically set processes name to something meaningful", uwsgi_opt_true, &uwsgi.auto_procname, 0},
diff -uNr a/.github/workflows/test.yml b/.github/workflows/test.yml
--- a/.github/workflows/test.yml 2024-06-01 20:40:38.000000000 +0200
+++ b/.github/workflows/test.yml 2024-08-13 09:56:13.152870522 +0200
@@ -37,7 +37,7 @@
runs-on: ubuntu-20.04
strategy:
matrix:
- python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
+ python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
test-suite: [python, deadlocks]
steps:
- name: Add deadnakes ppa
diff -uNr a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c
--- a/plugins/python/python_plugin.c 2024-08-13 09:55:30.374870522 +0200
+++ b/plugins/python/python_plugin.c 2024-08-13 10:00:36.315870522 +0200
@@ -406,7 +406,7 @@
// reset python signal flags so child processes can trap signals
// Necessary if uwsgi fork hooks not called to update interpreter state
if (!up.call_uwsgi_fork_hooks && up.call_osafterfork) {
-#ifdef HAS_NOT_PyOS_AfterFork_Child
+#ifdef HAS_NOT_PYOS_FORK_STABLE_API
PyOS_AfterFork();
#else
PyOS_AfterFork_Child();
@@ -1340,11 +1340,10 @@
// 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
+#ifdef HAS_NOT_PYOS_FORK_STABLE_API
_PyImport_AcquireLock();
+#else
+ PyOS_BeforeFork();
#endif
}
}
@@ -1357,17 +1356,16 @@
if (uwsgi.has_threads) {
if (step == 0) {
// Release locks within master process
-#if defined UWSGI_PY312
- PyInterpreterState *interp = PyInterpreterState_Get();
- _PyImport_ReleaseLock(interp);
-#else
+#ifdef HAS_NOT_PYOS_FORK_STABLE_API
_PyImport_ReleaseLock();
+#else
+ PyOS_AfterFork_Parent();
#endif
UWSGI_RELEASE_GIL
}
else {
// Ensure thread state and locks are cleaned up in child process
-#ifdef HAS_NOT_PyOS_AfterFork_Child
+#ifdef HAS_NOT_PYOS_FORK_STABLE_API
PyOS_AfterFork();
#else
PyOS_AfterFork_Child();
@@ -1618,7 +1616,11 @@
PyGILState_Release(pgst);
if (wsgi_req) {
-#ifdef UWSGI_PY312
+#ifdef UWSGI_PY313
+ 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->current_frame;
+#elif defined 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;
@@ -1631,7 +1633,11 @@
#endif
}
else {
-#ifdef UWSGI_PY312
+#ifdef UWSGI_PY313
+ 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->current_frame;
+#elif defined 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;
@@ -1871,7 +1877,11 @@
PyGILState_Release(pgst);
if (wsgi_req) {
-#ifdef UWSGI_PY312
+#ifdef UWSGI_PY313
+ 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->current_frame = up.current_frame[wsgi_req->async_id];
+#elif defined 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];
@@ -1884,7 +1894,11 @@
#endif
}
else {
-#ifdef UWSGI_PY312
+#ifdef UWSGI_PY313
+ tstate->c_recursion_remaining = up.current_main_c_recursion_remaining;
+ tstate->py_recursion_remaining = up.current_main_py_recursion_remaining;
+ tstate->current_frame = up.current_main_frame;
+#elif defined 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;
@@ -2098,7 +2112,7 @@
// ensure signals can be used again from python
// Necessary if fork hooks have been not used to update interpreter state
if (!up.call_osafterfork && !up.call_uwsgi_fork_hooks)
-#ifdef HAS_NOT_PyOS_AfterFork_Child
+#ifdef HAS_NOT_PYOS_FORK_STABLE_API
PyOS_AfterFork();
#else
PyOS_AfterFork_Child();
diff -uNr a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h
--- a/plugins/python/uwsgi_python.h 2024-06-01 20:40:38.000000000 +0200
+++ b/plugins/python/uwsgi_python.h 2024-08-13 10:04:58.492870522 +0200
@@ -25,6 +25,10 @@
# define UWSGI_PY312
#endif
+#if (PY_VERSION_HEX >= 0x030d0000)
+# define UWSGI_PY313
+#endif
+
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 7
#define HAS_NOT_PyMemoryView_FromBuffer
#endif
@@ -41,12 +45,8 @@
#define HAS_NO_ERRORS_IN_PyFile_FromFd
#endif
-#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7
-#define HAS_NOT_PyOS_AfterFork_Child
-#endif
-
-#if PY_MAJOR_VERSION < 3
-#define HAS_NOT_PyOS_AfterFork_Child
+#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7) || PY_MAJOR_VERSION < 3
+#define HAS_NOT_PYOS_FORK_STABLE_API
#endif
#if PY_MAJOR_VERSION > 2
@@ -172,7 +172,15 @@
char *callable;
-#ifdef UWSGI_PY312
+#ifdef UWSGI_PY313
+ int *current_c_recursion_remaining;
+ int *current_py_recursion_remaining;
+ struct _PyInterpreterFrame **current_frame;
+
+ int current_main_c_recursion_remaining;
+ int current_main_py_recursion_remaining;
+ struct _PyInterpreterFrame *current_main_frame;
+#elif defined UWSGI_PY312
int *current_c_recursion_remaining;
int *current_py_recursion_remaining;
_PyCFrame **current_frame;

View file

@ -1,42 +1,42 @@
diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
index 2375bc9..b908417 100644
--- a/plugins/rack/uwsgiplugin.py
+++ b/plugins/rack/uwsgiplugin.py
@@ -10,13 +10,14 @@ except:
diff -uNr a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
--- 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()
-v = version.split('.')
+v = tuple(int(x) for x in version.split('.'))
GCC_LIST = ['rack_plugin', 'rack_api']
-if (v[0] == '1' and v[1] == '9') or v[0] >= '2':
+if version >= '1.9':
+if v >= (1, 9):
CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
CFLAGS.append('-DRUBY19')
+ if version >= '2.0':
+ CFLAGS.append('-DRUBY20')
- if version >= '2.7':
+ if v >= (2, 7):
CFLAGS.append('-DRUBY27')
CFLAGS.append('-Wno-unused-parameter')
rbconfig = 'RbConfig'
else:
diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
index 4f35984..156018f 100644
--- a/plugins/ruby19/uwsgiplugin.py
+++ b/plugins/ruby19/uwsgiplugin.py
@@ -10,13 +10,14 @@ except:
diff -uNr a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
--- 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()
-v = version.split('.')
+v = tuple(int(x) for x in version.split('.'))
GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api']
-if v[0] == '1' and v[1] == '9':
+if version >= '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.0':
+ CFLAGS.append('-DRUBY20')
- if version >= '2.7':
+ if v >= (2, 7):
CFLAGS.append('-DRUBY27')
CFLAGS.append('-Wno-unused-parameter')
rbconfig = 'RbConfig'
else: