[5.8-stable] sqlite3-tcl problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[5.8-stable] sqlite3-tcl problem

Adam Jensen
$ pkg_info | grep -i tcl
sqlite3-tcl-3.8.0.2p1 TCL bindings for Sqlite3
tcl-8.5.18          Tool Command Language
tcl-8.6.4           Tool Command Language
tk-8.5.18           graphical toolkit for Tcl
tk-8.6.4            graphical toolkit for Tcl


I'm too deeply invested in my system's configuration to uninstall software and reinstall to verify this properly but I think the sqlite3-tcl package might be associated with tcl-8.5.18 as a dependency. However,

$ tclsh8.5                                                                                
% package require sqlite3
couldn't load file "/usr/local/lib/tcl/sqlite3/libtclsqlite3.so": Cannot load specified object

But,

$ tclsh8.6  
% package require sqlite3
3.8.0.2
%

It looks like sqlite3-tcl is built specifically for tcl-8.6.4.

Question: How might sqlite3-tcl be built for tcl-8.5.18?

Problem: The Tcl-version-specific sqlite3-tcl is installed in a Tcl-version-neutral location,

$ ls /usr/local/lib/tcl
modules/ sqlite3/ tcl8.5/  tcl8.6/  tk8.5/   tk8.6/

$ ls /usr/local/lib/tcl/sqlite3/                                                    
libtclsqlite3.so   pkgIndex.tcl

Reply | Threaded
Open this post in threaded view
|

Re: [5.8-stable] sqlite3-tcl problem

Juan Francisco Cantero Hurtado
On Thu, Feb 18, 2016 at 12:27:03PM -0500, Adam Jensen wrote:

> $ pkg_info | grep -i tcl
> sqlite3-tcl-3.8.0.2p1 TCL bindings for Sqlite3
> tcl-8.5.18          Tool Command Language
> tcl-8.6.4           Tool Command Language
> tk-8.5.18           graphical toolkit for Tcl
> tk-8.6.4            graphical toolkit for Tcl
>
>
> I'm too deeply invested in my system's configuration to uninstall software and reinstall to verify this properly but I think the sqlite3-tcl package might be associated with tcl-8.5.18 as a dependency. However,
>
> $ tclsh8.5                                                                                
> % package require sqlite3
> couldn't load file "/usr/local/lib/tcl/sqlite3/libtclsqlite3.so": Cannot load specified object
>
> But,
>
> $ tclsh8.6  
> % package require sqlite3
> 3.8.0.2
> %
>
> It looks like sqlite3-tcl is built specifically for tcl-8.6.4.
>
> Question: How might sqlite3-tcl be built for tcl-8.5.18?
>
> Problem: The Tcl-version-specific sqlite3-tcl is installed in a Tcl-version-neutral location,
>
> $ ls /usr/local/lib/tcl
> modules/ sqlite3/ tcl8.5/  tcl8.6/  tk8.5/   tk8.6/
>
> $ ls /usr/local/lib/tcl/sqlite3/                                                    
> libtclsqlite3.so   pkgIndex.tcl


Thanks for the report but you're slightly wrong in the diagnostic :)

sqlite3-tcl is built against tcl-8.5. The real problem is that
sqlite3-tcl requires a tcl interpreter with threads support. Tcl 8.5
threads support is disabled by default (upstream's decision, not
ours).

I made this patch for you but we can't commit it because this type of
change could to break old tcl packages.


diff --git Makefile Makefile
index a2722f0..8eec3d1 100644
--- Makefile
+++ Makefile
@@ -12,7 +12,7 @@ MAINTAINER = Stuart Cassoff <[hidden email]>
 # BSD
 PERMIT_PACKAGE_CDROM = Yes
 
-WANTLIB = c m
+WANTLIB = c m pthread
 
 MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=tcl/}
 DISTFILES = ${DISTNAME}-src.tar.gz
@@ -35,6 +35,7 @@ CONFIGURE_ARGS += ${CONFIGURE_SHARED} \
  --mandir="${PREFIX}/lib/tcl/tcl8.5/man" \
  --sysconfdir="${SYSCONFDIR}" \
  --enable-man-symlinks \
+ --enable-threads \
  --disable-rpath \
  EXTRA_INSTALL="install-private-headers" \
  SHLIB_VERSION="${LIBtcl85_VERSION}"

Reply | Threaded
Open this post in threaded view
|

Re: [5.8-stable] sqlite3-tcl problem

Adam Jensen
On Thu, 18 Feb 2016 20:48:01 +0100
Juan Francisco Cantero Hurtado <[hidden email]> wrote:

> Thanks for the report but you're slightly wrong in the diagnostic :)

Ah, cool. Glad to hear that there were/are considered design decisions behind the implementation.

> sqlite3-tcl is built against tcl-8.5. The real problem is that
> sqlite3-tcl requires a tcl interpreter with threads support. Tcl 8.5
> threads support is disabled by default (upstream's decision, not
> ours).
>
> I made this patch for you but we can't commit it because this type of
> change could to break old tcl packages.

That's good to know when evaluating the portability of TCL-8.5 scripts [on/in]to the OpenBSD platform.

I built SQLite3 (with fts5 support) for my local development. I might build a local Tcl-8.5 with threads support. If Tcl-8.5 and Tcl-8.6 can use the same SQLite [executable] library, it might make sense to use a custom/local Tcl-8.5.

Thanks for the informative response! :)

How might the Tcl and SQLite-Tcl ports/packages change in the near future? Or is it highly probable that they will remain fairly similar to the way they are in 5.8-stable?


Reply | Threaded
Open this post in threaded view
|

Re: [5.8-stable] sqlite3-tcl problem

Juan Francisco Cantero Hurtado
On Thu, Feb 18, 2016 at 05:35:18PM -0500, Adam Jensen wrote:

> On Thu, 18 Feb 2016 20:48:01 +0100
> Juan Francisco Cantero Hurtado <[hidden email]> wrote:
>
> > Thanks for the report but you're slightly wrong in the diagnostic :)
>
> Ah, cool. Glad to hear that there were/are considered design decisions behind the implementation.
>
> > sqlite3-tcl is built against tcl-8.5. The real problem is that
> > sqlite3-tcl requires a tcl interpreter with threads support. Tcl 8.5
> > threads support is disabled by default (upstream's decision, not
> > ours).
> >
> > I made this patch for you but we can't commit it because this type of
> > change could to break old tcl packages.
>
> That's good to know when evaluating the portability of TCL-8.5 scripts [on/in]to the OpenBSD platform.
>
> I built SQLite3 (with fts5 support) for my local development. I might build a local Tcl-8.5 with threads support. If Tcl-8.5 and Tcl-8.6 can use the same SQLite [executable] library, it might make sense to use a custom/local Tcl-8.5.
>
> Thanks for the informative response! :)
>
> How might the Tcl and SQLite-Tcl ports/packages change in the near future? Or is it highly probable that they will remain fairly similar to the way they are in 5.8-stable?

CCing to MAINTAINER. He knows better than me.


--
Juan Francisco Cantero Hurtado http://juanfra.info

Reply | Threaded
Open this post in threaded view
|

Re: [5.8-stable] sqlite3-tcl problem

Adam Jensen
In reply to this post by Adam Jensen
On Thu, 18 Feb 2016 21:26:11 +0100
Giovanni Bechis <[hidden email]> wrote:

> Does LD_PRELOAD=/usr/lib/libpthread.so tclsh8.5 works ?


Yes!

$ LD_PRELOAD=/usr/lib/libpthread.so tclsh8.5
% package require sqlite3
3.8.0.2
%

That might be a usable workaround for someone who needs to run a Tcl8.5+SQLite3 script on OpenBSD-5.8 but doesn't want to operate outside of the packages system.

Thanks!