unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Allan Webber <cwebber@dustycloud.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: [PATCH] Add and use sqlite-legacy-for-python
Date: Fri, 12 Feb 2016 16:13:52 -0800	[thread overview]
Message-ID: <87h9hd8o2k.fsf@dustycloud.org> (raw)
In-Reply-To: <87ziv9poua.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

Ludovic Courtès writes:

> Pjotr Prins <pjotr.public12@thebird.nl> skribis:
>
>> Patch b24765139c8940541b23f84592d3580d53f71d71
>>
>>  (define-public sqlite
>>    (package
>>     (name "sqlite")
>> -   (version "3.8.11.1")
>> +   (version "3.10.0")
>>     (source (origin
>>
>> is the cause of python(2|3)-sqlalchemy breaking. I confirmed that by
>> regressing to the original sqlite package. Since the python binding is
>> part of the interpreter, I suspect there may be more python modules
>> vulnerable. I updated python-sqlalchemy to latest and that makes no
>> difference. Its tests fail on sqlite 3.10.0 and pass on 3.8.11.1.
>>
>> What do we do? Revert on this sqlite patch for the new guix release?
>> Or add a second sqlite package and have that as a python dependency?
>
> I would do the latter, assuming that soon a new python-sqlalchemy
> release would solve the problem.  WDYT?
>
> This is probably OK since python-sqlalchemy is a leaf, and so we’re
> unlikely to end up mixing two different SQLite versions.
>
> Ludo’.

Will sqlalchemy really remain a leaf node?  I hope not, since I'm
working on packaging MediaGoblin now :)

Regardless, I agree that the second approach seems to be the right one.
I've built a modified package, sqlite-legacy-for-python, and put it to
use.  I built it and confirmed it builds fine and that the tests pass,
and with it, the tests pass in python-sqlalchemy too.

Ok to push?


[-- Attachment #2: 0001-gnu-Add-sqlite-legacy-for-python-and-use-it-in-pytho.patch --]
[-- Type: text/x-patch, Size: 3333 bytes --]

From 20b9e3ac19b77b33f88d45e33ad9ceafacbdb1bd Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Fri, 12 Feb 2016 16:09:52 -0800
Subject: [PATCH] gnu: Add sqlite-legacy-for-python and use it in python's
 definition.

* gnu/packages/database.scm (sqlite-legacy-for-python): New variable.
* gnu/packages/python.scm (python): Use sqlite-legacy-for-python.
---
 gnu/packages/databases.scm | 30 ++++++++++++++++++++++++++++++
 gnu/packages/python.scm    |  3 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index b36f5d8..c00cbb4 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -388,6 +389,35 @@ widely deployed SQL database engine in the world.  The source code for SQLite
 is in the public domain.")
    (license public-domain)))
 
+;; Python packages (well, at least python-sqlalchemy) break with the latest
+;; release of sqlite, so we need to keep this around for legacy purposes...
+(define-public sqlite-legacy-for-python
+  (package
+    (inherit sqlite)
+    (version "3.8.11.1")
+    ;; Repeating a lot of the above definition... there's no way around it!
+    (source (origin
+              (method url-fetch)
+              (uri (let ((numeric-version
+                          (match (string-split version #\.)
+                            ((first-digit other-digits ...)
+                             (string-append first-digit
+                                            (string-pad-right
+                                             (string-concatenate
+                                              (map (cut string-pad <> 2 #\0)
+                                                   other-digits))
+                                             6 #\0))))))
+                     (list
+                      (string-append
+                       "https://fossies.org/linux/misc/sqlite-autoconf-"
+                       numeric-version ".tar.gz")
+                      (string-append
+                       "http://distfiles.gentoo.org/distfiles/"
+                       "/sqlite-autoconf-" numeric-version ".tar.gz"))))
+              (sha256
+               (base32
+                "1dnkl4qr1dgaprbyf3jddfiynkhxnin86qabni47wjlc0fnb16gv"))))))
+
 (define-public tdb
   (package
     (name "tdb")
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 3758eed..8d6f520 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -233,7 +233,8 @@
      `(("bzip2" ,bzip2)
        ("gdbm" ,gdbm)
        ("libffi" ,libffi)                         ; for ctypes
-       ("sqlite" ,sqlite)                         ; for sqlite extension
+       ;; Hopefully soon we'll have this back at vanilla sqlite
+       ("sqlite" ,sqlite-legacy-for-python)       ; for sqlite extension
        ("openssl" ,openssl)
        ("readline" ,readline)
        ("zlib" ,zlib)
-- 
2.6.3


  reply	other threads:[~2016-02-13  0:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 16:46 sqlite update causes failure of python-sqlalchemy Pjotr Prins
2016-02-09 21:15 ` Ludovic Courtès
2016-02-13  0:13   ` Christopher Allan Webber [this message]
2016-02-13  0:23     ` [PATCH] Add and use sqlite-legacy-for-python Thompson, David
2016-02-13  1:09       ` Christopher Allan Webber
2016-02-15  2:40         ` Christopher Allan Webber
2016-02-15 19:38           ` Christopher Allan Webber
2016-02-15 20:13             ` Christopher Allan Webber
2016-02-15 21:03               ` Pjotr Prins
2016-02-21 21:11               ` Ludovic Courtès
2016-02-13  7:59     ` Andreas Enge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9hd8o2k.fsf@dustycloud.org \
    --to=cwebber@dustycloud.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).