★ wanayoo — archive 1999 https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/pull/223Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sqlite3 import by matching upstream build option for load_extension #223

Merged
merged 1 commit into from May 16, 2018

Conversation

@ihnorton
Copy link
Contributor

@ihnorton ihnorton commented May 15, 2018

Per upstream documentation:

The sqlite3 module is not built with loadable extension support by
default, because some platforms (notably Mac OS X) have SQLite
libraries which are compiled without this feature. To get loadable
extension support, you must modify setup.py and remove the line that
sets SQLITE_OMIT_LOAD_EXTENSION.

which means that SQLITE_OMIT_LOAD_EXTENSION is added as a compile
definition by default in the upstream build system. We match that
here to fix import sqlite3.

Per upstream documentation:

> The sqlite3 module is not built with loadable extension support by
> default, because some platforms (notably Mac OS X) have SQLite
> libraries which are compiled without this feature. To get loadable
> extension support, you must modify setup.py and remove the line that
> sets SQLITE_OMIT_LOAD_EXTENSION.

which means that SQLITE_OMIT_LOAD_EXTENSION is added as a compile
definition by default in the upstream build system. We match that
here to fix `import sqlite3`.
@ihnorton
Copy link
Contributor Author

@ihnorton ihnorton commented May 15, 2018

Slicer issue: https://issues.slicer.org/view.php?id=4555

>>> import sqlite3
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/opt/worksw/Slicer-4.9.0-20180425.app/Contents/lib/Python/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/opt/worksw/Slicer-4.9.0-20180425.app/Contents/lib/Python/lib/python2.7/sqlite3/dbapi2.py", line 28, in <module>
    from _sqlite3 import *
ImportError: dlopen(/opt/worksw/Slicer-4.9.0-20180425.app/Contents/lib/Python/lib/python2.7/lib-dynload/_sqlite3.so, 2): Symbol not found: _sqlite3_enable_load_extension
  Referenced from: /opt/worksw/Slicer-4.9.0-20180425.app/Contents/lib/Python/lib/python2.7/lib-dynload/_sqlite3.so
  Expected in: flat namespace
 in /opt/worksw/Slicer-4.9.0-20180425.app/Contents/lib/Python/lib/python2.7/lib-dynload/_sqlite3.so
>>> 
@jcfr jcfr merged commit c3b8d53 into python-cmake-buildsystem:master May 16, 2018
3 checks passed
3 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jcfr
Copy link
Contributor

@jcfr jcfr commented May 16, 2018

Thanks @ihnorton 👍

@ihnorton ihnorton deleted the ihnorton:fix_sqlite3 branch May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.