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

2021-06-16 Thread Jonas Smedegaard
[ replying via bugreport ]

Quoting Thomas Goirand (2021-06-16 19:20:44)
> Can I NMU uwsgi as per the discussion with the release team? Should it 
> be 2.0.19.1-7.1 or 2.0.19.1-8? Should I also open a merge request on 
> Salsa?

Yes, please use standard procedure for NMUs - i.e. release as -7.1 and 
share the changes with nmudiff (not using salsa).


Thanks,

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc
Description: signature


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

2021-06-16 Thread Graham Inggs
Control: tags -1 + confirmed

On Wed, 16 Jun 2021 at 17:21, Jonas Smedegaard  wrote:
> Correct: the changes in debian/2.0.19.1-7 should not affect Debian.

Thanks.  That was fortunate timing, uwsgi/2.0.19.1-7 and
uwsgi-plugin-php/0.0.12 are both in testing now.

> Sorry for the mess.

No harm done. :-)

Thomas, please go ahead and upload to unstable, and remove the
moreinfo tag once it is built.



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

2021-06-16 Thread Jonas Smedegaard
Quoting Graham Inggs (2021-06-16 17:12:00)
> Hi Thomas, Jonas
> 
> On Wed, 16 Jun 2021 at 16:07, Thomas Goirand  wrote:
> > I'm hereby attaching the output of:
> > git diff -u -r debian/2.0.19.1-6 -r debian/2.0.19.1-7
> 
> Thanks.
> 
> > Maybe you could unblock debian/2.0.19.1-7 considering this is a 
> > target patch? Otherwise, Jonas may agree to revert the patch?
> 
> According to the upstream commit message, these TSRMLS_* macros were 
> inert since PHP 7.  If you and Jonas can agree that this makes no 
> difference for bullseye, then I will unblock uwsgi/2.0.19.1-7 and let 
> uwsgi-plugin-php/0.0.12 migrate.  Thereafter, you can upload 
> uwsgi/2.0.19.1-8.

Correct: the changes in debian/2.0.19.1-7 should not affect Debian.

Sorry for the mess.

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc
Description: signature


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

2021-06-16 Thread Graham Inggs
Hi Thomas, Jonas

On Wed, 16 Jun 2021 at 16:07, Thomas Goirand  wrote:
> I'm hereby attaching the output of:
> git diff -u -r debian/2.0.19.1-6 -r debian/2.0.19.1-7

Thanks.

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

According to the upstream commit message, these TSRMLS_* macros were
inert since PHP 7.  If you and Jonas can agree that this makes no
difference for bullseye, then I will unblock uwsgi/2.0.19.1-7 and let
uwsgi-plugin-php/0.0.12 migrate.  Thereafter, you can upload
uwsgi/2.0.19.1-8.

Regards
Graham



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

2021-06-16 Thread Thomas Goirand
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  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   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 ..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 
+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_arra

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

2021-06-16 Thread Graham Inggs
Control: tags -1 + moreinfo

Hi Thomas

On Mon, 14 Jun 2021 at 21:12, Thomas Goirand  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



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

2021-06-14 Thread Thomas Goirand
Package: release.debian.org
Severity: normal
User: release.debian@packages.debian.org
Usertags: unblock

Dear release team,

The Glance and the Swift packages both use, in some cases, the HTTP
transfer mode:
Transfer-Encoding: chunked

In this mode, no Content-Lenght: header is set, and the client is sending
the data using chunked.

As a result, both Swift and Glance are only partially working. For swift,
the issue happens mostly when someone sends large documents. Upload is
interrupted and breaks. For Glance, it happens when doing a command like
this one:

openstack server image create --name my-name 

Unfortunately, the Uwsgi version 2.0.19, as in Bullseye and Sid, does not
have the feature. The patch was written 4 years ago, but upstream didn't
release a new upstream release containing the patch.

Therefore, I have backported the patch to the version 2.0.19.1 as in
Bullseye (it applied cleanly with only a few fuzz hunks). Please find the
attached debdiff containing the patch I'd like to add.

As this only adds the specific feature, and that it must be activated
using the directive:

wsgi-manage-chunked-input = true

(or with --wsgi-manage-chunked-input on the command line), then I don't
think there's any regression risk for Bullseye. However, this repairs
Glance and Swift, as soon as we add the directive, which Glance and
Swift already have (there will be no need to re-upload Glance or Swift).

Note that I already tested all of this in production, and in fact, I
just would like to apply what I've done in production to what's in Debian
official (rather than having to provide a modified uwsgi in an unofficial
repository).

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

Please allow me to unblock uwsgi/2.0.19.1-8 with the attached patch,
targetting Bullseye,

Cheers,

Thomas Goirand (zigo)
>From 722db2ea22eb454ed678bd6ff8b1c2f287df4802 Mon Sep 17 00:00:00 2001
From: Thomas Goirand 
Date: Fri, 11 Jun 2021 11:09:19 +0200
Subject: [PATCH]   * Add upstream patch to support Transfer-Encoding:
 chuncked, necessary for OpenStack Glance and Swift over uwsgi.

---
 debian/changelog  |   9 +
 .../Add_support_for_chunked_encoding.patch| 241 ++
 debian/patches/series |   1 +
 3 files changed, 251 insertions(+)
 create mode 100644 debian/patches/Add_support_for_chunked_encoding.patch

diff --git a/debian/changelog b/debian/changelog
index 70389417..b0372124 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+uwsgi (2.0.19.1-7.1) UNRELEASED; urgency=medium
+
+  [ Thomas Goirand ]
+  * Non-maintainer upload.
+  * Add upstream patch to support Transfer-Encoding: chuncked, necessary for
+OpenStack Glance and Swift over uwsgi.
+
+ -- Thomas Goirand   Fri, 11 Jun 2021 11:08:33 +0200
+
 uwsgi (2.0.19.1-7) unstable; urgency=medium
 
   * add patch cherry-picked upstream
diff --git a/debian/patches/Add_support_for_chunked_encoding.patch 
b/debian/patches/Add_support_for_chunked_encoding.patch
new file mode 100644
index ..496a1e75
--- /dev/null
+++ b/debian/patches/Add_support_for_chunked_encoding.patch
@@ -0,0 +1,241 @@
+Subject: preliminary implementation of #1428
+ This implements support for transfer-encoding: chuncked
+Author: Unbit 
+Date: Thu, 9 Nov 2017 16:40:44 +0100
+Last-Update: 2021-06-11
+
+Index: uwsgi/core/chunked.c
+===
+--- uwsgi.orig/core/chunked.c
 uwsgi/core/chunked.c
+@@ -83,6 +83,83 @@ static ssize_t uwsgi_chunked_readline(st
+ 
+ */
+ 
++struct uwsgi_buffer *uwsgi_chunked_read_smart(struct wsgi_request *wsgi_req, 
size_t len, int timeout) {
++  // check for buffer
++  if (!wsgi_req->body_chunked_buf)
++  wsgi_req->body_chunked_buf = uwsgi_buffer_new(uwsgi.page_size);
++  // first case: asking for all
++  if (!len) {
++  for(;;) {
++  size_t chunked_len = 0;
++  char *buf = uwsgi_chunked_read(wsgi_req, &chunked_len, 
timeout, 0);
++  if (chunked_len == 0) {
++  struct uwsgi_buffer *ret = 
uwsgi_buffer_new(wsgi_req->body_chunked_buf->pos);
++  if (uwsgi_buffer_append(ret, 
wsgi_req->body_chunked_buf->buf, wsgi_req->body_chunked_buf->pos)) {
++  uwsgi_buffer_destroy(ret);
++  return NULL;
++  }
++  
uwsgi_buffer_decapitate(wsgi_req->body_chunked_buf, 
wsgi_req->body_chunked_buf->pos);
++  return ret;
++  }
++  if (uwsgi_buffer_append(wsgi_req->body_chunked_buf, 
buf, chunked_len)) {
++  return NULL;
++  }
++  }