[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#639300: please build against unixodbc-dev instead of libiodbc2-dev



Hi Sebastian, nice to meet you!

On Tue, Mar 06, 2012 at 01:34:45AM +0100, Pino Toscano wrote:

> Alle martedì 6 marzo 2012, Steve Langasek ha scritto:
> > I'm surprised to say that after sitting on this bug for far too long,
> > it turns out that it's trivial to fix.  Although it had been
> > reported that soprano would not work with unixodbc, once I actually
> > installed virtuoso, which the soprano test suite silently depends
> > on, I get the same results from test/virtuosobackendtest when built
> > against either iODBC or UnixODBC.

> I remember Sebastian Trueg (main soprano upstream) strongly recommending 
> against using unixODBC (e.g. in [2], just last September), so I'm not 
> sure whether this switch would break anything in the semantic desktop 
> stack.
> (Disclaimer: I don't use Nepomuk myself.)

> Sebastian, what is the current status of soprano wrt unixODBC/iODBC?
> Which problems would result in using unixODBC?

> [2] http://trueg.wordpress.com/2011/09/22/about-strigi-soprano-virtuoso-
> clucene-and-libstreamanalyzer/

Right, so I've read the comment in that blog entry about needing libiodbc
because of RDF extensions.  But I've reviewed the libiodbc source, and can't
find any evidence that such extensions exist - there's a single RDF define
in the iodbcext.h header, but a copy of this header is shipped in the
soprano source and there are no uses of the define anyway.  As best as I can
tell, the only extensions are in the virtuoso driver, which libiodbc2 merely
passes the requests through to - and unixodbc would appear to do the very
same.

The one thing I have found that's different between iODBC and UnixODBC (but
not represented in the previous patch) is that UnixODBC will not allow
look-up of a driver by filename alone; it requires that the filename match
the filename for a driver registered with odbcinst.ini.  This seems like a
feature that we could patch into UnixODBC easily enough if needed.  (And
apparently there was something wrong with my previous testing that I didn't
catch this.)

However, I wonder why it makes sense for soprano to use a driver manager at
all, given that it appears soprano can *only* use the virtuoso driver as a
backend.  Wouldn't it be simpler to call into the virtuoso driver directly
and omit the driver manager, on Unix?

Attached is a revised patch to the Debian that implements the above
proposal.  Since UnixODBC is no longer involved (except as a provider of the
sql.h header) there should not be any compatibility issues here.  It may not
be portable to non-Linux systems, but maybe it would be an acceptable distro
patch, Pino?

> > I'm happy to upload this as an NMU if you would like.  It's probably
> > worth an upload ASAP rather than waiting for 2.7.5+dfsg.1-1 to
> > migrate to testing, since it's hard to have usable ODBC drivers for
> > soprano until it's fixed.

> We're currently just started our KDE 4.7 transition, which includes also 
> a soprano update from 2.6 to 2.7; if possible, I think IMHO it would be 
> desiderable to wait for such dependency change, in case, after the 
> transition is over (hopefully in two weeks, if everything goes fine).
> Would this timeframe suit you?

I think it makes perfect sense to not upload this change until we're
confident it's not going to be a problem for the transition.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org
diff -Nru soprano-2.7.5+dfsg.1/debian/changelog soprano-2.7.5+dfsg.1/debian/changelog
--- soprano-2.7.5+dfsg.1/debian/changelog	2012-03-04 20:55:08.000000000 +0000
+++ soprano-2.7.5+dfsg.1/debian/changelog	2012-03-06 07:35:31.000000000 +0000
@@ -1,3 +1,10 @@
+soprano (2.7.5+dfsg.1-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Build without iODBC.  Closes: #639300, LP: #901638.
+
+ -- Steve Langasek <vorlon@debian.org>  Mon, 05 Mar 2012 23:49:13 +0000
+
 soprano (2.7.5+dfsg.1-1) unstable; urgency=low
 
   * Team upload.
diff -Nru soprano-2.7.5+dfsg.1/debian/control soprano-2.7.5+dfsg.1/debian/control
--- soprano-2.7.5+dfsg.1/debian/control	2012-03-04 20:43:25.000000000 +0000
+++ soprano-2.7.5+dfsg.1/debian/control	2012-03-06 07:42:00.000000000 +0000
@@ -6,7 +6,7 @@
 Build-Depends: debhelper (>= 7.4.15), cmake (>= 2.6.2), pkg-kde-tools (>= 0.12),
  dpkg-dev (>= 1.15.5), libclucene-dev (>= 0.9.21b), libqt4-dev (>= 4.5.3),
  libraptor1-dev (>= 1.4.16), librdf0-dev (>= 1.0.13),
- doxygen (>= 1.7.1), graphviz, libiodbc2-dev
+ doxygen (>= 1.7.1), graphviz, libvirtodbc0, unixodbc-dev
 Standards-Version: 3.9.2
 Homepage: http://soprano.sourceforge.net
 Vcs-Browser: http://git.debian.org/?p=pkg-kde/kde-req/soprano.git
@@ -15,7 +15,7 @@
 Package: soprano-daemon
 Section: utils
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: libvirtodbc0, ${shlibs:Depends}, ${misc:Depends}
 Recommends: libsoprano4 (= ${binary:Version})
 Suggests: virtuoso-minimal
 Breaks: libsoprano4 (<< 2.3.0+dfsg.1-1), libsoprano-dev (<< 2.3.0+dfsg.1-1)
diff -Nru soprano-2.7.5+dfsg.1/debian/patches/no-odbc-dm soprano-2.7.5+dfsg.1/debian/patches/no-odbc-dm
--- soprano-2.7.5+dfsg.1/debian/patches/no-odbc-dm	1970-01-01 00:00:00.000000000 +0000
+++ soprano-2.7.5+dfsg.1/debian/patches/no-odbc-dm	2012-03-06 07:37:57.000000000 +0000
@@ -0,0 +1,45 @@
+Description: Build without iODBC
+ Add support for soprano to link directly against virtodbc_r.so instead of
+ using the libiodbc driver manager.  Given that virtuoso is hard-coded as
+ the driver, the use of a driver manager is an unnecessary indirection; and
+ the manner of the hard-coding makes it harder than it ought to be to
+ switch from iODBC to UnixODBC - so just eliminate the DM entirely.
+ .
+ This does mean we're using an rpath, but that's a lesser evil given that
+ the path to the library is otherwise hard-coded in the source anyway.
+Author: Steve Langasek <vorlon@debian.org>
+Bug-Debian: http://bugs.debian.org/639300
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/901638
+
+Index: soprano-2.7.5+dfsg.1/cmake/modules/FindIODBC.cmake
+===================================================================
+--- soprano-2.7.5+dfsg.1.orig/cmake/modules/FindIODBC.cmake
++++ soprano-2.7.5+dfsg.1/cmake/modules/FindIODBC.cmake
+@@ -57,10 +57,11 @@
+   ${iodbc_INCLUDE_DIRS}
+   )
+ 
+-find_library(IODBC_LIBRARIES NAMES iodbc
+-  HINTS
+-  ${iodbc_LIBRARY_DIRS}
+-  )
++#find_library(IODBC_LIBRARIES NAMES iodbc
++#  HINTS
++#  ${iodbc_LIBRARY_DIRS}
++#  )
++set(IODBC_LIBRARIES "/usr/lib/odbc/virtodbc_r.so")
+ 
+ if (IODBC_LIBRARIES AND IODBC_INCLUDE_DIR)
+ #  set(IODBC_INCLUDE_DIR "${IODBC_INCLUDE_DIR}/iodbc")
+Index: soprano-2.7.5+dfsg.1/backends/virtuoso/CMakeLists.txt
+===================================================================
+--- soprano-2.7.5+dfsg.1.orig/backends/virtuoso/CMakeLists.txt
++++ soprano-2.7.5+dfsg.1/backends/virtuoso/CMakeLists.txt
+@@ -37,6 +37,7 @@
+ target_link_libraries(soprano_virtuosobackend odbc32)
+ else(WIN32)
+ target_link_libraries(soprano_virtuosobackend ${IODBC_LIBRARIES})
++SET_TARGET_PROPERTIES(soprano_virtuosobackend PROPERTIES INSTALL_RPATH "/usr/lib/odbc")    
+ endif(WIN32)
+ 
+ if(WIN32)
diff -Nru soprano-2.7.5+dfsg.1/debian/patches/series soprano-2.7.5+dfsg.1/debian/patches/series
--- soprano-2.7.5+dfsg.1/debian/patches/series	2012-03-04 20:33:22.000000000 +0000
+++ soprano-2.7.5+dfsg.1/debian/patches/series	2012-03-06 07:39:51.000000000 +0000
@@ -2,3 +2,4 @@
 disable_usr_lib_install_rpath.diff
 doxyfile_generate_tagfile.diff
 redland_raptor2_support.h
+no-odbc-dm

Attachment: signature.asc
Description: Digital signature


Reply to: