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

Subscribers

People subscribed via source and target branches