From owner-freebsd-python@FreeBSD.ORG Thu Mar 31 03:20:10 2011 Return-Path: Delivered-To: freebsd-python@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8564D106566C; Thu, 31 Mar 2011 03:20:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 617868FC18; Thu, 31 Mar 2011 03:20:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2V3KAmm002894; Thu, 31 Mar 2011 03:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2V3KA4S002893; Thu, 31 Mar 2011 03:20:10 GMT (envelope-from gnats) Resent-Date: Thu, 31 Mar 2011 03:20:10 GMT Resent-Message-Id: <201103310320.p2V3KA4S002893@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-python@FreeBSD.org Resent-Cc: Matthias Andree Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Pan Tsu Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B8F61065670 for ; Thu, 31 Mar 2011 03:12:27 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1AB738FC0C for ; Thu, 31 Mar 2011 03:12:26 +0000 (UTC) Received: by bwz12 with SMTP id 12so1742448bwz.13 for ; Wed, 30 Mar 2011 20:12:26 -0700 (PDT) Received: by 10.204.82.166 with SMTP id b38mr1777800bkl.207.1301541146170; Wed, 30 Mar 2011 20:12:26 -0700 (PDT) Received: from localhost ([95.143.193.145]) by mx.google.com with ESMTPS id q18sm431515bka.3.2011.03.30.20.12.21 (version=SSLv3 cipher=OTHER); Wed, 30 Mar 2011 20:12:23 -0700 (PDT) Message-Id: <86y63wm19o.fsf@gmail.com> Date: Thu, 31 Mar 2011 07:12:19 +0400 From: Pan Tsu To: FreeBSD-gnats-submit@FreeBSD.org X-GNATS-Notify: Matthias Andree Cc: Subject: ports/156076: [patch] databases/py-sqlite3: Undefined symbol "sqlite3_load_extension" X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2011 03:20:10 -0000 >Number: 156076 >Category: ports >Synopsis: [patch] databases/py-sqlite3: Undefined symbol "sqlite3_load_extension" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-python >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 31 03:20:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Anonymous >Release: FreeBSD 9.0-CURRENT amd64 >Organization: >Environment: Move py-sqlite3 fix to its own PR after silence on python@ for ~2 days, cf. http://docs.freebsd.org/cgi/mid.cgi?86tyem8iz9.fsf tested on www/firefox (PGO build, r64446), www/py-flexget (via sqlalchemy) tested on lang/python27, lang/python32 $ ./sqlite3_compileoption_get ENABLE_COLUMN_METADATA ENABLE_FTS3 ENABLE_FTS3_PARENTHESIS ENABLE_UNLOCK_NOTIFY OMIT_LOAD_EXTENSION SECURE_DELETE TEMP_STORE=1 THREADSAFE=1 >Description: Don't define HAVE_LOAD_EXTENSION when sqlite3 is compiled with EXTENSION option turned off. see also ports/149842, ports/155971, neither cites exact error message >How-To-Repeat: 1. install databases/sqlite3 without EXTENSION support 2. install databases/py-sqlite3 3. try to import py-sqlite3 $ python -c 'import sqlite3' Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in from dbapi2 import * File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 27, in from _sqlite3 import * ImportError: /usr/local/lib/python2.7/site-packages/_sqlite3.so: Undefined symbol "sqlite3_load_extension" >Fix: No need to go overkill and iterate sqlite3_compileoption_get() to populate macros, testing existence of the symbol is enough. $ grep -r '#if.*[[:blank:]]SQLITE_' $(make -V WRKSRC) | fgrep -iv version WRKSRC/_sqlite/connection.c:#ifndef SQLITE_OMIT_LOAD_EXTENSION --- a.diff begins here --- Index: databases/py-sqlite3/Makefile =================================================================== RCS file: /a/.cvsup/ports/databases/py-sqlite3/Makefile,v retrieving revision 1.8 diff -u -p -r1.8 Makefile --- databases/py-sqlite3/Makefile 28 Oct 2010 21:00:08 -0000 1.8 +++ databases/py-sqlite3/Makefile 29 Mar 2011 07:40:40 -0000 @@ -7,7 +7,7 @@ PORTNAME= sqlite3 PORTVERSION= ${PYTHON_PORTVERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases python MASTER_SITES= ${PYTHON_MASTER_SITES} MASTER_SITE_SUBDIR= ${PYTHON_MASTER_SITE_SUBDIR} Index: databases/py-sqlite3/files/setup.py =================================================================== RCS file: /a/.cvsup/ports/databases/py-sqlite3/files/setup.py,v retrieving revision 1.2 diff -u -p -r1.2 setup.py --- databases/py-sqlite3/files/setup.py 7 Aug 2006 02:23:05 -0000 1.2 +++ databases/py-sqlite3/files/setup.py 29 Mar 2011 07:38:29 -0000 @@ -32,6 +32,12 @@ sqlite_srcs = [ '_sqlite/statement.c', '_sqlite/util.c'] +try: + import ctypes + ctypes.CDLL('libsqlite3.so').sqlite3_load_extension +except AttributeError: + macros.append(('SQLITE_OMIT_LOAD_EXTENSION', '1')) + setup(name = "_sqlite3", description = "SQLite 3 extension to Python", Index: databases/py-sqlite3/files/setup3.py =================================================================== RCS file: /a/.cvsup/ports/databases/py-sqlite3/files/setup3.py,v retrieving revision 1.1 diff -u -p -r1.1 setup3.py --- databases/py-sqlite3/files/setup3.py 30 Jun 2009 21:51:53 -0000 1.1 +++ databases/py-sqlite3/files/setup3.py 29 Mar 2011 07:40:50 -0000 @@ -31,6 +31,12 @@ sqlite_srcs = [ '_sqlite/statement.c', '_sqlite/util.c'] +try: + import ctypes + ctypes.CDLL('libsqlite3.so').sqlite3_load_extension +except AttributeError: + macros.append(('SQLITE_OMIT_LOAD_EXTENSION', '1')) + setup(name = "_sqlite3", description = "SQLite 3 extension to Python", --- a.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: