Merge ~utkarsh/ubuntu/+source/phpmyadmin:fix-autopkgtest-on-s390x into ubuntu/+source/phpmyadmin:ubuntu/devel

Proposed by Utkarsh Gupta
Status: Merged
Approved by: Lucas Kanashiro
Approved revision: 2a304fbedc1cf42a67c242a06b020460da3ac868
Merged at revision: 2a304fbedc1cf42a67c242a06b020460da3ac868
Proposed branch: ~utkarsh/ubuntu/+source/phpmyadmin:fix-autopkgtest-on-s390x
Merge into: ubuntu/+source/phpmyadmin:ubuntu/devel
Diff against target: 242 lines (+204/-1)
5 files modified
debian/changelog (+12/-0)
debian/control (+2/-1)
debian/patches/php-8-fixes.patch (+150/-0)
debian/patches/series (+2/-0)
debian/patches/skip-32-bit-incompatible-tests-on-s390x.patch (+38/-0)
Reviewer Review Type Date Requested Status
Lucas Kanashiro Approve
William Desportes (community) upstream Approve
Canonical Server packageset reviewers Pending
Utkarsh Gupta Pending
Ubuntu Server Dev import team Pending
Review via email: mp+403226@code.launchpad.net

Description of the change

Hello,

This MP fixes failures on s390x[1] and thereby would help phpmyadmin to migrate from -proposed[2].

The patch has already been merged upstream[3] and has been sent as a MR to salsa[4] to get uploaded to Debian once the archive opens again after the freeze.

I've tested this and it now builds fine and have also uploaded to the PPA:
https://launchpad.net/~utkarsh/+archive/ubuntu/experimental-dump/

Requesting you to review and sponsor the upload; should you need any other information, please let me know. TIA! \o/

---

[1]: https://autopkgtest.ubuntu.com/packages/p/phpmyadmin/impish/s390x
[2]: https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.html#phpmyadmin
[3]: https://github.com/phpmyadmin/phpmyadmin/pull/16913
[4]: https://salsa.debian.org/phpmyadmin-team/phpmyadmin/-/merge_requests/31

To post a comment you must log in.
Revision history for this message
William Desportes (williamdes) wrote :

LGTM, I approve this change and package change

review: Approve (upstream)
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the MP fixing those issues Utkarsh!

As a side note, I'd enable non-amd64 architectures in your PPA to make sure it builds fine in all of them. Apart from that, LGTM. There is a small typo in the changelog, I added an inline comment for that.

review: Needs Fixing
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Thanks, Lucas.

All architectures are already enabled. It's arch: all, that's why it didn't build on other architectures.

That said, fixed the typo. Requesting for a re-review, thanks!

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks. Package uploaded:

$ git push pkg upload/4%5.0.4+dfsg2-2ubuntu1
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 32 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 4.84 KiB | 1.61 MiB/s, done.
Total 21 (delta 14), reused 0 (delta 0)
remote: Checking connectivity: 21, done.
To ssh://git.launchpad.net/ubuntu/+source/phpmyadmin
 * [new tag] upload/4%5.0.4+dfsg2-2ubuntu1 -> upload/4%5.0.4+dfsg2-2ubuntu1
$ dput ubuntu ../phpmyadmin_5.0.4+dfsg2-2ubuntu1_source.changes
Checking signature on .changes
gpg: ../phpmyadmin_5.0.4+dfsg2-2ubuntu1_source.changes: Valid signature from F823A2729883C97C
Checking signature on .dsc
gpg: ../phpmyadmin_5.0.4+dfsg2-2ubuntu1.dsc: Valid signature from F823A2729883C97C
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading phpmyadmin_5.0.4+dfsg2-2ubuntu1.dsc: done.
  Uploading phpmyadmin_5.0.4+dfsg2-2ubuntu1.debian.tar.xz: done.
  Uploading phpmyadmin_5.0.4+dfsg2-2ubuntu1_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index f738c9f..ec589d7 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,15 @@
6+phpmyadmin (4:5.0.4+dfsg2-2ubuntu1) impish; urgency=medium
7+
8+ * d/p/skip-32-bit-incompatible-tests-on-s390x.patch: Add patch
9+ to fix autopkgtest on s390x by disabling testImportOsm and
10+ testDoImport as these two tests fail on s390x machines, which
11+ looks like some 32-bit issues we already have.
12+ * d/p/php-8-fixes.patch: Add patch fixes build & tests against
13+ PHP 8. This will help unblock the ongoing PHP transition.
14+ Thanks, William Desportes, for your help! \o/
15+
16+ -- Utkarsh Gupta <utkarsh@debian.org> Tue, 25 May 2021 03:03:46 +0530
17+
18 phpmyadmin (4:5.0.4+dfsg2-2) unstable; urgency=medium
19
20 * Add a patch for CVE-2021-21252
21diff --git a/debian/control b/debian/control
22index d52a15c..d32eb05 100644
23--- a/debian/control
24+++ b/debian/control
25@@ -1,5 +1,6 @@
26 Source: phpmyadmin
27-Maintainer: phpMyAdmin Packaging Team <team+phpmyadmin@tracker.debian.org>
28+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
29+XSBC-Original-Maintainer: phpMyAdmin Packaging Team <team+phpmyadmin@tracker.debian.org>
30 Uploaders: Felipe Sateler <fsateler@debian.org>,
31 Matthias Bl├╝mel <debian@blaimi.de>,
32 William Desportes <williamdes@wdes.fr>
33diff --git a/debian/patches/php-8-fixes.patch b/debian/patches/php-8-fixes.patch
34new file mode 100644
35index 0000000..7761e8a
36--- /dev/null
37+++ b/debian/patches/php-8-fixes.patch
38@@ -0,0 +1,150 @@
39+Description: This patch fixes build & tests against PHP 8.
40+Author: Utkarsh Gupta <utkarsh.gupta@canonical.com>
41+Origin: upstream
42+Applied-Upstream: [v5.1.0] cabe45f5a44bec8b91f7cee463db4899555ac771
43+ [v5.1.0] b8e4d932b7bebcd1e4371c608117b1336fff8d99
44+ [v5.1.0] 0e728a67c5fd30fb15085b80e22d2b4fc48dee4a
45+ [v5.1.0] ff52752bc0c457154dfb9cdcb56d77a9a603fb18
46+ [v5.1.0] 00b419afe147624238d44dc5fe62a7cf07b14134
47+ [v5.1.0] bdc8760bc350b8422cf7ac722ccfa5b9ef268ac4
48+Forwarded: https://salsa.debian.org/phpmyadmin-team/phpmyadmin/-/issues/49
49+Last-Updated: 2021-05-25
50+
51+--- a/libraries/classes/Plugins/Import/ImportOds.php
52++++ b/libraries/classes/Plugins/Import/ImportOds.php
53+@@ -131,9 +131,11 @@
54+ unset($data);
55+
56+ /**
57+- * Disable loading of external XML entities.
58++ * Disable loading of external XML entities for PHP versions below 8.0.
59+ */
60+- libxml_disable_entity_loader();
61++ if (PHP_VERSION_ID < 80000) {
62++ libxml_disable_entity_loader();
63++ }
64+
65+ /**
66+ * Load the XML string
67+--- a/libraries/classes/Plugins/Import/ImportXml.php
68++++ b/libraries/classes/Plugins/Import/ImportXml.php
69+@@ -88,9 +88,11 @@
70+ unset($data);
71+
72+ /**
73+- * Disable loading of external XML entities.
74++ * Disable loading of external XML entities for PHP versions below 8.0.
75+ */
76+- libxml_disable_entity_loader();
77++ if (PHP_VERSION_ID < 80000) {
78++ libxml_disable_entity_loader();
79++ }
80+
81+ /**
82+ * Load the XML string
83+--- a/libraries/classes/Setup/ConfigGenerator.php
84++++ b/libraries/classes/Setup/ConfigGenerator.php
85+@@ -52,7 +52,7 @@
86+ $persistKeys = $cf->getPersistKeysMap();
87+
88+ foreach ($conf as $k => $v) {
89+- $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
90++ $k = preg_replace('/[^A-Za-z0-9_]/', '_', (string) $k);
91+ $ret .= self::_getVarExport($k, $v, $crlf);
92+ if (isset($persistKeys[$k])) {
93+ unset($persistKeys[$k]);
94+@@ -169,7 +169,7 @@
95+ . "*/" . $crlf
96+ . '$i++;' . $crlf;
97+ foreach ($server as $k => $v) {
98+- $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
99++ $k = preg_replace('/[^A-Za-z0-9_]/', '_', (string) $k);
100+ $ret .= "\$cfg['Servers'][\$i]['$k'] = "
101+ . (is_array($v) && self::_isZeroBasedArray($v)
102+ ? self::_exportZeroBasedArray($v, $crlf)
103+--- a/test/classes/HeaderTest.php
104++++ b/test/classes/HeaderTest.php
105+@@ -71,6 +71,7 @@
106+ */
107+ public function testEnable()
108+ {
109++ $GLOBALS['server'] = 0;
110+ $header = new Header();
111+ $this->assertStringContainsString(
112+ '<title>phpMyAdmin</title>',
113+@@ -85,6 +86,7 @@
114+ */
115+ public function testSetBodyId()
116+ {
117++ $GLOBALS['server'] = 0;
118+ $header = new Header();
119+ $header->setBodyId('PMA_header_id');
120+ $this->assertStringContainsString(
121+--- a/libraries/classes/Util.php
122++++ b/libraries/classes/Util.php
123+@@ -1312,6 +1312,10 @@
124+ return null;
125+ }
126+
127++ if (is_string($value)) {
128++ $value = (float) $value;
129++ }
130++
131+ $byteUnits = [
132+ /* l10n: shortcuts for Byte */
133+ __('B'),
134+@@ -1397,6 +1401,10 @@
135+ return '0';
136+ }
137+
138++ if (is_string($value)) {
139++ $value = (float) $value;
140++ }
141++
142+ $originalValue = $value;
143+ //number_format is not multibyte safe, str_replace is safe
144+ if ($digits_left === 0) {
145+--- a/libraries/classes/Controllers/Setup/HomeController.php
146++++ b/libraries/classes/Controllers/Setup/HomeController.php
147+@@ -32,7 +32,7 @@
148+ $pages = $this->getPages();
149+
150+ // Handle done action info
151+- $actionDone = Core::isValid($params['action_done'], 'scalar') ? $params['action_done'] : null;
152++ $actionDone = Core::isValid($params['action_done'], 'scalar') ? $params['action_done'] : '';
153+ $actionDone = preg_replace('/[^a-z_]/', '', $actionDone);
154+
155+ // message handling
156+--- a/libraries/classes/Table.php
157++++ b/libraries/classes/Table.php
158+@@ -578,7 +578,7 @@
159+ $query .= ' DEFAULT 0';
160+ } elseif ($type == 'BIT') {
161+ $query .= ' DEFAULT b\''
162+- . preg_replace('/[^01]/', '0', $default_value)
163++ . preg_replace('/[^01]/', '0', (string) $default_value)
164+ . '\'';
165+ } elseif ($type == 'BOOLEAN') {
166+ if (preg_match('/^1|T|TRUE|YES$/i', (string) $default_value)) {
167+--- a/libraries/classes/Gis/GisMultiPoint.php
168++++ b/libraries/classes/Gis/GisMultiPoint.php
169+@@ -215,7 +215,7 @@
170+
171+ $row = '';
172+ foreach ($points_arr as $point) {
173+- if ($point[0] != '' && $point[1] != '') {
174++ if (((float) $point[0]) !== 0.0 && ((float) $point[1]) !== 0.0) {
175+ $row .= '<circle cx="' . $point[0] . '" cy="'
176+ . $point[1] . '" r="3"';
177+ $point_options['id'] = $label . mt_rand();
178+--- a/libraries/classes/Gis/GisPoint.php
179++++ b/libraries/classes/Gis/GisPoint.php
180+@@ -224,7 +224,7 @@
181+ $points_arr = $this->extractPoints($point, $scale_data);
182+
183+ $row = '';
184+- if ($points_arr[0][0] != '' && $points_arr[0][1] != '') {
185++ if (((float) $points_arr[0][0]) !== 0.0 && ((float) $points_arr[0][1]) !== 0.0) {
186+ $row .= '<circle cx="' . $points_arr[0][0]
187+ . '" cy="' . $points_arr[0][1] . '" r="3"';
188+ foreach ($point_options as $option => $val) {
189diff --git a/debian/patches/series b/debian/patches/series
190index 65ffb18..5b74ba5 100644
191--- a/debian/patches/series
192+++ b/debian/patches/series
193@@ -9,3 +9,5 @@ Fix-test-for-Debian-versions-on-Debian-CI.patch
194 Remove-dfsg-zxcvbn-js.patch
195 CVE-2021-21252.patch
196 Remove-metro-fonts.patch
197+skip-32-bit-incompatible-tests-on-s390x.patch
198+php-8-fixes.patch
199diff --git a/debian/patches/skip-32-bit-incompatible-tests-on-s390x.patch b/debian/patches/skip-32-bit-incompatible-tests-on-s390x.patch
200new file mode 100644
201index 0000000..f33995a
202--- /dev/null
203+++ b/debian/patches/skip-32-bit-incompatible-tests-on-s390x.patch
204@@ -0,0 +1,38 @@
205+Description: Skip testImportOsm and testDoImport on 32-bit/s390x arch
206+Origin: upstream
207+Applied-Upstream: https://github.com/phpmyadmin/phpmyadmin/pull/16913
208+Forwarded: [Debian] https://salsa.debian.org/phpmyadmin-team/phpmyadmin/-/merge_requests/31
209+Last-Updated: 2021-05-25
210+
211+From c309b96edd98bdce18506b6dfee1f3209bf6748f Mon Sep 17 00:00:00 2001
212+From: Utkarsh Gupta <utkarsh@debian.org>
213+Date: Mon, 24 May 2021 19:38:36 +0530
214+Subject: [PATCH] Skip testImportOsm and testDoImport on 32-bit/s390x arch
215+
216+These two tests fail on s390x machines, looks like some
217+32-bit issues we already have. Probably worth skipping
218+these on 32-bit/s390x arch.
219+
220+Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
221+---
222+ test/classes/Plugins/Import/ImportShpTest.php | 2 ++
223+ 1 file changed, 2 insertions(+)
224+
225+--- a/test/classes/Plugins/Import/ImportShpTest.php
226++++ b/test/classes/Plugins/Import/ImportShpTest.php
227+@@ -128,6 +128,7 @@
228+ * @return void
229+ *
230+ * @group medium
231++ * @group 32bit-incompatible
232+ */
233+ public function testImportOsm()
234+ {
235+@@ -164,6 +165,7 @@
236+ * @return void
237+ *
238+ * @group medium
239++ * @group 32bit-incompatible
240+ */
241+ public function testDoImport()
242+ {

Subscribers

People subscribed via source and target branches