[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#989851: pre-approval unblock: uwsgi/2.0.19.1-8



On 6/16/21 1:14 PM, Graham Inggs wrote:
> Control: tags -1 + moreinfo
> 
> Hi Thomas
> 
> On Mon, 14 Jun 2021 at 21:12, Thomas Goirand <zigo@debian.org> wrote:
>>   [x] attach debdiff against the package in testing
> 
> You've attached a debdiff against uwsgi/2.0.19.1-7 in unstable, which
> is currently blocked [1].
> I think it will be best if 2.0.19.1-7 migrates to testing before you
> go ahead and upload.
> 
> Someone needs to file an unblock request justifying the changes
> between 2.0.19.1-6 and 2.0.19.1-7, hence including Jonas in this
> discussion.
> 
> Regards
> Graham
> 
> 
> [1] https://qa.debian.org/excuses.php?package=uwsgi
> 

Hi Graham,

As you may see in https://bugs.debian.org/989191 the release -7 just
adds a patch to avoid FTBFS in Focal, which Jonas uploaded by mistake to
Sid thinking Sid was affected.

I'm hereby attaching the output of:
git diff -u -r debian/2.0.19.1-6 -r debian/2.0.19.1-7

(which hopefully matches the debdiff)

Maybe you could unblock debian/2.0.19.1-7 considering this is a target
patch? Otherwise, Jonas may agree to revert the patch?

Cheers,

Thomas Goirand (zigo)
diff --git a/debian/changelog b/debian/changelog
index 7b1449f8..70389417 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+uwsgi (2.0.19.1-7) unstable; urgency=medium
+
+  * add patch cherry-picked upstream
+    to remove PHP TSRMLS_* macros;
+    unfuzz another upstream cherry-picked patch;
+    see bug#989191, thanks to Bryce Harrington
+
+ -- Jonas Smedegaard <dr@jones.dk>  Fri, 28 May 2021 07:56:03 +0200
+
 uwsgi (2.0.19.1-6) unstable; urgency=medium
 
   * fix permissions of runtime dir in uwsgi-emperor;
diff --git a/debian/patches/020210221~0f2ef52.patch b/debian/patches/020210221~0f2ef52.patch
new file mode 100644
index 00000000..379d9795
--- /dev/null
+++ b/debian/patches/020210221~0f2ef52.patch
@@ -0,0 +1,252 @@
+escription: plugins/php: remove TSRMLS_* macros
+ They are gone in PHP 8 and were inert since PHP 7.
+Origin: upstream, https://github.com/unbit/uwsgi/commit/0f2ef52
+Author: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
+Forwarded: yes
+Last-Update: 2021-05-28
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/plugins/php/php_plugin.c
++++ b/plugins/php/php_plugin.c
+@@ -74,7 +74,7 @@
+ 
+ 
+ #ifdef UWSGI_PHP7
+-static size_t sapi_uwsgi_ub_write(const char *str, size_t str_length TSRMLS_DC)
++static size_t sapi_uwsgi_ub_write(const char *str, size_t str_length)
+ #else
+ static int sapi_uwsgi_ub_write(const char *str, uint str_length TSRMLS_DC)
+ #endif
+@@ -89,7 +89,7 @@
+ 	return str_length;
+ }
+ 
+-static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
++static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers)
+ {
+ 	sapi_header_struct *h;
+ 	zend_llist_position pos;
+@@ -124,7 +124,7 @@
+ }
+ 
+ #ifdef UWSGI_PHP7
+-static size_t sapi_uwsgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
++static size_t sapi_uwsgi_read_post(char *buffer, size_t count_bytes)
+ #else
+ static int sapi_uwsgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+ #endif
+@@ -151,7 +151,7 @@
+ }
+ 
+ 
+-static char *sapi_uwsgi_read_cookies(TSRMLS_D)
++static char *sapi_uwsgi_read_cookies()
+ {
+ 	uint16_t len = 0;
+ 	struct wsgi_request *wsgi_req = (struct wsgi_request *) SG(server_context);
+@@ -164,55 +164,55 @@
+ 	return NULL;
+ }
+ 
+-static void sapi_uwsgi_register_variables(zval *track_vars_array TSRMLS_DC)
++static void sapi_uwsgi_register_variables(zval *track_vars_array)
+ {
+ 	int i;
+ 	struct wsgi_request *wsgi_req = (struct wsgi_request *) SG(server_context);
+-	php_import_environment_variables(track_vars_array TSRMLS_CC);
++	php_import_environment_variables(track_vars_array);
+ 
+ 	if (uphp.server_software) {
+ 		if (!uphp.server_software_len) uphp.server_software_len = strlen(uphp.server_software);
+-		php_register_variable_safe("SERVER_SOFTWARE", uphp.server_software, uphp.server_software_len, track_vars_array TSRMLS_CC);
++		php_register_variable_safe("SERVER_SOFTWARE", uphp.server_software, uphp.server_software_len, track_vars_array);
+ 	}
+ 	else {
+-		php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, track_vars_array TSRMLS_CC);
++		php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, track_vars_array);
+ 	}
+ 
+ 	for (i = 0; i < wsgi_req->var_cnt; i += 2) {
+ 		php_register_variable_safe( estrndup(wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len),
+ 			wsgi_req->hvec[i + 1].iov_base, wsgi_req->hvec[i + 1].iov_len,
+-			track_vars_array TSRMLS_CC);
++			track_vars_array);
+         }
+ 
+-	php_register_variable_safe("PATH_INFO", wsgi_req->path_info, wsgi_req->path_info_len, track_vars_array TSRMLS_CC);
++	php_register_variable_safe("PATH_INFO", wsgi_req->path_info, wsgi_req->path_info_len, track_vars_array);
+ 	if (wsgi_req->query_string_len > 0) {
+-		php_register_variable_safe("QUERY_STRING", wsgi_req->query_string, wsgi_req->query_string_len, track_vars_array TSRMLS_CC);
++		php_register_variable_safe("QUERY_STRING", wsgi_req->query_string, wsgi_req->query_string_len, track_vars_array);
+ 	}
+ 
+-	php_register_variable_safe("SCRIPT_NAME", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array TSRMLS_CC);
+-	php_register_variable_safe("SCRIPT_FILENAME", wsgi_req->file, wsgi_req->file_len, track_vars_array TSRMLS_CC);
++	php_register_variable_safe("SCRIPT_NAME", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array);
++	php_register_variable_safe("SCRIPT_FILENAME", wsgi_req->file, wsgi_req->file_len, track_vars_array);
+ 
+-	php_register_variable_safe("DOCUMENT_ROOT", wsgi_req->document_root, wsgi_req->document_root_len, track_vars_array TSRMLS_CC);
++	php_register_variable_safe("DOCUMENT_ROOT", wsgi_req->document_root, wsgi_req->document_root_len, track_vars_array);
+ 
+ 	if (wsgi_req->path_info_len) {
+ 		char *path_translated = ecalloc(1, wsgi_req->file_len + wsgi_req->path_info_len + 1);
+ 
+ 		memcpy(path_translated, wsgi_req->file, wsgi_req->file_len);
+ 		memcpy(path_translated + wsgi_req->file_len, wsgi_req->path_info, wsgi_req->path_info_len);
+-		php_register_variable_safe("PATH_TRANSLATED", path_translated, wsgi_req->file_len + wsgi_req->path_info_len , track_vars_array TSRMLS_CC);
++		php_register_variable_safe("PATH_TRANSLATED", path_translated, wsgi_req->file_len + wsgi_req->path_info_len , track_vars_array);
+ 	}
+ 	else {
+-		php_register_variable_safe("PATH_TRANSLATED", "", 0, track_vars_array TSRMLS_CC);
++		php_register_variable_safe("PATH_TRANSLATED", "", 0, track_vars_array);
+ 	}
+ 
+-	php_register_variable_safe("PHP_SELF", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array TSRMLS_CC);
++	php_register_variable_safe("PHP_SELF", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array);
+ 
+ 	struct uwsgi_string_list *usl = uphp.vars;
+ 	while(usl) {
+ 		char *equal = strchr(usl->value, '=');
+ 		if (equal) {
+ 			php_register_variable_safe( estrndup(usl->value, equal-usl->value),
+-				equal+1, strlen(equal+1), track_vars_array TSRMLS_CC);
++				equal+1, strlen(equal+1), track_vars_array);
+ 		}
+ 		usl = usl->next;
+ 	}
+@@ -256,7 +256,7 @@
+ #ifndef UWSGI_PHP7
+ 			name_len = name_len + 1;
+ #endif
+-			zend_register_string_constant(name, name_len, strval, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
++			zend_register_string_constant(name, name_len, strval, CONST_CS | CONST_PERSISTENT, module_number);
+ 		}
+ 		usl = usl->next;
+ 	}
+@@ -289,7 +289,7 @@
+         char *cache = NULL;
+         int cachelen = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -305,7 +305,7 @@
+         char *cache = NULL;
+         int cachelen = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &cache, &cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -324,7 +324,7 @@
+ 	char *cache = NULL;
+ 	int cachelen = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -346,7 +346,7 @@
+ 	if (!uwsgi.caches)
+ 		RETURN_NULL();
+ 
+-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -375,7 +375,7 @@
+ 	if (!uwsgi.caches)
+ 		RETURN_NULL();
+ 
+-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -398,7 +398,7 @@
+         if (!uwsgi.caches)
+                 RETURN_NULL();
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -423,7 +423,7 @@
+         uint16_t argvs[256];
+ 	uint64_t size = 0;
+ 
+-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &varargs, &num_args) == FAILURE) {
++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &varargs, &num_args) == FAILURE) {
+ 		RETURN_NULL();
+ 	}
+ 
+@@ -481,7 +481,7 @@
+ 	char *name;
+ 	int name_len;
+ 
+-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
+ 		RETURN_NULL();
+ 	}
+ 
+@@ -495,7 +495,7 @@
+ 	long long_signum;
+ 	uint8_t signum = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &long_signum) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &long_signum) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -632,7 +632,7 @@
+ #if ((PHP_MAJOR_VERSION >= 7) && (PHP_MINOR_VERSION >= 1))
+ static void sapi_uwsgi_log_message(char *message, int syslog_type_int) {
+ #else
+-static void sapi_uwsgi_log_message(char *message TSRMLS_DC) {
++static void sapi_uwsgi_log_message(char *message) {
+ #endif
+ 	uwsgi_log("%s\n", message);
+ }
+@@ -788,10 +788,6 @@
+ 
+ 	zend_file_handle file_handle;
+ 
+-#ifdef ZTS
+-	TSRMLS_FETCH();
+-#endif
+-
+ 	SG(server_context) = (void *) wsgi_req;
+ 
+ 	if (uwsgi_parse_vars(wsgi_req)) {
+@@ -1065,7 +1061,7 @@
+         file_handle.type = ZEND_HANDLE_FILENAME;
+         file_handle.filename = real_filename;
+ 
+-        if (php_request_startup(TSRMLS_C) == FAILURE) {
++        if (php_request_startup() == FAILURE) {
+ 		uwsgi_500(wsgi_req);
+                 return -1;
+         }
+@@ -1073,13 +1069,13 @@
+ 	struct uwsgi_string_list *usl=NULL;
+ 
+ 	uwsgi_foreach(usl, uphp.exec_before) {
+-		if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec before", 1 TSRMLS_CC) == FAILURE) goto end;
++		if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec before", 1) == FAILURE) goto end;
+ 	}
+ 
+-        php_execute_script(&file_handle TSRMLS_CC);
++        php_execute_script(&file_handle);
+ 
+ 	uwsgi_foreach(usl, uphp.exec_after) {
+-		if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec after", 1 TSRMLS_CC) == FAILURE) goto end;
++		if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec after", 1) == FAILURE) goto end;
+ 	}
+ 
+ end:
diff --git a/debian/patches/0next20191214~f8b4c28.patch b/debian/patches/0next20191214~f8b4c28.patch
index 2628ccf6..c4053c86 100644
--- a/debian/patches/0next20191214~f8b4c28.patch
+++ b/debian/patches/0next20191214~f8b4c28.patch
@@ -69,7 +69,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 -        int cachelen = 0;
 +        php_strlen_size cachelen = 0;
  
-         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
+         if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
                  RETURN_NULL();
 @@ -303,7 +311,7 @@
  PHP_FUNCTION(uwsgi_cache_clear) {
@@ -78,7 +78,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 -        int cachelen = 0;
 +        php_strlen_size cachelen = 0;
  
-         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &cache, &cachelen) == FAILURE) {
+         if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &cache, &cachelen) == FAILURE) {
                  RETURN_NULL();
 @@ -318,11 +326,11 @@
  
@@ -93,7 +93,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 -	int cachelen = 0;
 +	php_strlen_size cachelen = 0;
  
-         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
+         if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
                  RETURN_NULL();
 @@ -338,9 +346,9 @@
  PHP_FUNCTION(uwsgi_cache_get) {
diff --git a/debian/patches/series b/debian/patches/series
index 9dbdf98b..b8c2938a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,6 +4,7 @@
 020200709~1888a1d.patch
 020200825~583592a.patch
 020201007~6a4e7e6.patch
+020210221~0f2ef52.patch
 0next20170920~7cf140a.patch
 0next20191214~f8b4c28.patch
 0next20201122~6d86c03.patch

Reply to: