[PATCH 0/3] Fix python-mysqlclient segfault

  • Done
  • quality assurance status badge
Details
2 participants
  • Hilton Chain
  • rimarko
Owner
unassigned
Submitted by
rimarko
Severity
normal
R
R
rimarko wrote on 18 Feb 22:54 +0100
(address . guix-patches@gnu.org)(name . Marco Rimoldi)(address . rimarko@libero.it)
cover.1708293210.git.rimarko@libero.it
From: Marco Rimoldi <rimarko@libero.it>

This patch is divided in three steps:

1. enable tests for python-mysqlclient (sigh!); check phase now fails (see https://issues.guix.gnu.org/69064)
2. work around the bug by changing input library
3. update the package to the latest version available

Cheers,
Marco

Marco Rimoldi (3):
gnu: python-mysqlclient: Enable selected tests.
gnu: python-mysqlclient: A test highlights segfault bug in mariadb:
apply workaround.
gnu: python-mysqlclient: Update to version 2.2.4.

gnu/packages/databases.scm | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)


base-commit: fdbf4192f5eaa7fdb5e6e2e98ada0726c8104824
--
2.41.0
R
R
rimarko wrote on 18 Feb 23:12 +0100
[PATCH 1/3] gnu: python-mysqlclient: Enable selected tests.
(address . 69260@debbugs.gnu.org)(name . Marco Rimoldi)(address . rimarko@libero.it)
0bcd19d4aed0a520fb3686b297a9d095f5bea441.1708293210.git.rimarko@libero.it
From: Marco Rimoldi <rimarko@libero.it>

* gnu/packages/databases.scm (python-mysqlclient)
[build-system]: Change to pyproject-build-system.
[arguments]
<#:phases>: Add 'fix-test phase.
<#:test-flags>: Specify tests to run.
[native-inputs]: Add python-pytest.
[homepage]: Updated.

Change-Id: I5ae0873155f9a7cc90a318762b77864665fadc01
---
gnu/packages/databases.scm | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5169795404..4bb992c97c 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -4155,15 +4155,24 @@ (define-public python-mysqlclient
(method url-fetch)
(uri (pypi-uri "mysqlclient" version))
(sha256
- (base32
- "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
- (build-system python-build-system)
- (arguments '(#:tests? #f)) ;XXX: requires a live database
- (inputs
- `(("mysql-dev" ,mariadb "dev")))
- (home-page "https://github.com/PyMySQL/mysqlclient-python")
- (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
- (description "MySQLdb is an interface to the popular MySQL database server
+ (base32 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
+ (build-system pyproject-build-system)
+ (arguments
+ '(#:phases (modify-phases %standard-phases
+ (add-before 'check 'fix-test
+ (lambda _
+ (substitute* "tests/test_MySQLdb_times.py"
+ (("^import mock")
+ "from unittest import mock")))))
+ #:test-flags '("tests/test__mysql.py" ;tests not needing a live db
+ "tests/test_MySQLdb_times.py")))
+ (native-inputs (list python-pytest))
+ (inputs `(("mysql-dev" ,mariadb "dev")))
+ (home-page "https://github.com/PyMySQL/mysqlclient")
+ (synopsis
+ "MySQLdb is an interface to the popular MySQL database server for Python")
+ (description
+ "MySQLdb is an interface to the popular MySQL database server
for Python. The design goals are:
@enumerate
@item Compliance with Python database API version 2.0 [PEP-0249],
--
2.41.0
R
R
rimarko wrote on 18 Feb 23:12 +0100
[PATCH 2/3] gnu: python-mysqlclient: A test highlights segfault bug in mariadb: apply workaround.
(address . 69260@debbugs.gnu.org)(name . Marco Rimoldi)(address . rimarko@libero.it)
43476a737fa34fc12962943944349e8fc301e0fc.1708293210.git.rimarko@libero.it
From: Marco Rimoldi <rimarko@libero.it>

* gnu/packages/databases.scm (python-mysqlclient):
[inputs]: Change mariadb:dev to mariadb-connector-c, which also provides libmariadb.so.3.

Change-Id: I8adf277c2c9aae637aef8994b149b3b696bfe790
---
gnu/packages/databases.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 4bb992c97c..c252738533 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -4167,7 +4167,7 @@ (define-public python-mysqlclient
#:test-flags '("tests/test__mysql.py" ;tests not needing a live db
"tests/test_MySQLdb_times.py")))
(native-inputs (list python-pytest))
- (inputs `(("mysql-dev" ,mariadb "dev")))
+ (inputs (list mariadb-connector-c))
(home-page "https://github.com/PyMySQL/mysqlclient")
(synopsis
"MySQLdb is an interface to the popular MySQL database server for Python")
--
2.41.0
R
R
rimarko wrote on 18 Feb 23:12 +0100
[PATCH 3/3] gnu: python-mysqlclient: Update to version 2.2.4.
(address . 69260@debbugs.gnu.org)(name . Marco Rimoldi)(address . rimarko@libero.it)
d604384c53353b6f420507476d6f5d51339e62d8.1708293210.git.rimarko@libero.it
From: Marco Rimoldi <rimarko@libero.it>

* gnu/packages/databases.scm (python-mysqlclient)
[version]: 2.0.1 -> 2.2.4.
[arguments] <#:phases> Remove 'fix-test phase (fixed upstream).
[native-inputs]: Add pkg-config.

Change-Id: I57a0b84eb0d56f9cea619b226090cc1ccd84812b
---
gnu/packages/databases.scm | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

Toggle diff (35 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c252738533..c035a05e74 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -4149,24 +4149,18 @@ (define-public yoyo-migrations
(define-public python-mysqlclient
(package
(name "python-mysqlclient")
- (version "2.0.1")
+ (version "2.2.4")
(source
(origin
(method url-fetch)
(uri (pypi-uri "mysqlclient" version))
(sha256
- (base32 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
+ (base32 "0hdznfz9095d2qhl7awbp39s7wpqbxn37xzan487qzaf8srrzg1k"))))
(build-system pyproject-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
- (add-before 'check 'fix-test
- (lambda _
- (substitute* "tests/test_MySQLdb_times.py"
- (("^import mock")
- "from unittest import mock")))))
- #:test-flags '("tests/test__mysql.py" ;tests not needing a live db
+ '(#:test-flags '("tests/test__mysql.py" ;tests not needing a live db
"tests/test_MySQLdb_times.py")))
- (native-inputs (list python-pytest))
+ (native-inputs (list pkg-config python-pytest))
(inputs (list mariadb-connector-c))
(home-page "https://github.com/PyMySQL/mysqlclient")
(synopsis
--
2.41.0
H
H
Hilton Chain wrote on 27 Mar 16:21 +0100
Re: [bug#69260] [PATCH 0/3] Fix python-mysqlclient segfault
(name . Marco Rimoldi)(address . rimarko@libero.it)(address . 69260-done@debbugs.gnu.org)
87cyrfn1ik.wl-hako@ultrarare.space
Hi Marco,

On Mon, 19 Feb 2024 05:54:35 +0800,
Marco Rimoldi via Guix-patches via wrote:
Toggle quote (26 lines)
>
> From: Marco Rimoldi <rimarko@libero.it>
>
> This patch is divided in three steps:
>
> 1. enable tests for python-mysqlclient (sigh!); check phase now fails (see https://issues.guix.gnu.org/69064)
> 2. work around the bug by changing input library
> 3. update the package to the latest version available
>
> Cheers,
> Marco
>
> Marco Rimoldi (3):
> gnu: python-mysqlclient: Enable selected tests.
> gnu: python-mysqlclient: A test highlights segfault bug in mariadb:
> apply workaround.
> gnu: python-mysqlclient: Update to version 2.2.4.
>
> gnu/packages/databases.scm | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>
>
> base-commit: fdbf4192f5eaa7fdb5e6e2e98ada0726c8104824
> --
> 2.41.0

I have merged patch 01 and 02 into one commit, used gexps for arguments,
adjusted commit messages, and applied the series as 5a41d4a56d0d...517c13624a96.

Thanks!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 69260@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 69260
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch