Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492710 - dev-lang/gnu-smalltalk-3.2.4 with dev-lang/tcl-8.6 - BloxTK.c:176:55: erreur: ‘Tcl_Interp’ has no member named ‘result’
Summary: dev-lang/gnu-smalltalk-3.2.4 with dev-lang/tcl-8.6 - BloxTK.c:176:55: erreur:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Panagiotis Christopoulos (RETIRED)
URL:
Whiteboard:
Keywords: InVCS, PATCH
Depends on:
Blocks: tcltk-8.6
  Show dependency tree
 
Reported: 2013-11-27 15:23 UTC by Ludovic Bellier
Modified: 2016-09-12 08:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gnu-smalltalk-3.2.5 ebuild with support for Tcl_Interp (gnu-smalltalk-3.2.5.ebuild,1.53 KB, text/plain)
2016-06-21 00:34 UTC, zlg (RETIRED)
Details
Fixes Tcl_Interp *result issues. (gnu-smalltalk-3.2.5_use-result.patch,725 bytes, patch)
2016-06-21 00:35 UTC, zlg (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Bellier 2013-11-27 15:23:38 UTC
the gnu-smalltalk compilation failed with blox part with the "'Tcl_Interp' has no member named 'result'" message.

See emerge --info as attachement

See build.log : http://home.zyrianes.net/gnu-smalltalk-3.2.4_build.txt


Reproducible: Always

Steps to Reproduce:
1. check dev-lang/gnu-smalltalk-3.2.4 will use tk
2. emerge =dev-lang/gnu-smalltalk-3.2.4
3. Check the compilation failed with the below error
Actual Results:  
Compilation failed with 
XZIP="/usr/bin/zip"  ./gst-tool gst-package --kernel-dir "./kernel" --image gst.im --srcdir=. --target-directory=. packages/blox/browser/package.xml
BloxTK.c: In function ‘tclInit’:
BloxTK.c:176:55: erreur: ‘Tcl_Interp’ has no member named ‘result’
BloxTK.c:181:54: erreur: ‘Tcl_Interp’ has no member named ‘result’
mkdir /var/tmp/portage/dev-lang/gnu-smalltalk-3.2.4/temp/gstar-uZTpck
mkdir /var/tmp/portage/dev-lang/gnu-smalltalk-3.2.4/temp/gstar-uZTpck/BLOXBrowser
ln -s -f /var/tmp/portage/dev-lang/gnu-smalltalk-3.2.4/work/smalltalk-3.2.4/packages/blox/browser/Load.st /var/tmp/portage/dev-lang/gnu-smalltalk-3.2.4/temp/gstar-uZTpck/BLOXBrowser/Load.st
[...]
Makefile:440: recipe for target 'BloxTK.lo' failed
make[3]: *** [BloxTK.lo] Error 1
make[3]: Leaving directory '/var/tmp/portage/dev-lang/gnu-smalltalk-3.2.4/work/smalltalk-3.2.4/packages/blox/tk'
Makefile:1497: recipe for target 'BloxTK.star' failed
make[2]: *** [BloxTK.star] Error 2


Expected Results:  
compilation works

I search and find that the might come from tcl. Compilation works for tcl and tk 8.5.13-r1 but fails with my current version : 8.6.1.
I continue searching, the possible origin is a usage of:
(Tcl_Interp *) interp->result
which is deprecated in tcl 8.6

Basic solution, add "-DUSE_INTERP_RESULT" to CPPFLAGS, by updating config.h.in like this:
$ cat ../TclUseInterpResult-3.2.4.patch 
--- config.h.in.orig    2013-11-27 15:51:02.420432280 +0100
+++ config.h.in 2013-11-27 15:53:38.720441684 +0100
@@ -870,6 +870,11 @@
    #define below would cause a syntax error. */
 #undef _UINT8_T
 
+/* Compilation error with tcl >= 8.6, 'Tcl_Interp' has no member named 'result'
+   gnu-smalltalk should update the deprecated code like 
+   (Tcl_Interp *) interp->result */
+#define USE_INTERP_RESULT 1
+
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const

This works for me.

Complete solution : update the tcl code in gnu-smalltalk for a tcl 8.6 compatibility
Comment 1 Jeroen Roovers gentoo-dev 2013-11-28 12:33:49 UTC
Please attach the entire build log to this bug report.
Comment 2 Panagiotis Christopoulos (RETIRED) gentoo-dev 2013-11-29 16:50:44 UTC
Yes, I hit that too. I'm working on a new smalltalk ebuild (for 3.2.5) but don't have an ETA yet for this. The bad thing if I remember correctly is that gnu-smalltalk's build system suffers from automagic dependencies.
Comment 3 zlg (RETIRED) gentoo-dev 2016-06-21 00:34:10 UTC
Created attachment 438230 [details]
gnu-smalltalk-3.2.5 ebuild with support for Tcl_Interp

So I looked into this since we're looking to stabilize tcl-8.6.5

* The first error I found is it's not checking for tcl support in sqlite. Adding `tcl` to USE in dev-db/sqlite fixed that. (This needs to be fixed in the ebuild but I'm not sure how, since GST builds fine with `dev-db/sqlite -tk -tcl`, `dev-lang/tcl abi_x86_32`, and `dev-lang/gnu-smalltalk -tk`. Checking the build log after building, it seems that GST has a built-in sqlite plugin.)

* There's a new version of gnu-smalltalk available (3.2.5). Building it had the same problems as this version, but it's 2 years newer so it's worth fixing and updating.

* As mentioned in comment #0, this issue is related to Tcl_Interp. I did some digging in Tcl's generic/tclInt.h file and learned that not only is the 'result' member deprecated, but it's not suggested to access it directly in the first place. Thus, the bug lies squarely with upstream misusing the API (i.e. dev-lang/tcl's stabilization doesn't rely on this). They're meant to use Tcl_SetObjResult, Tcl_GetObjResult, and Tcl_GetStringResult.

That said, it would be non-trivial to patch that ourselves, so the best solution here is indeed setting the variable in the build system. It's a hack and a workaround, but it's all GNU has given us to work with. Ideally, they will adopt the new function calls as they depend on later versions of Tcl.

I've confirmed that the patch in comment #0 works and gnu-smalltalk finishes compiling. There is a QA warning regarding the gst-{re}load manpages but that's a separate concern.

I'll attach a better-commented patch (to be used with gnu-smalltalk-3.2.5) and the version-bumped gnu-smalltalk ebuild that works. Note that I didn't add the sqlite dependency, as it's not clear exactly what caused my original build problem, and building sqlite without tcl and tk didn't seem to affect it. I'd rather defer treatment of dependencies to a developer familiar with this package.

I'll mark this as in-progress.
Comment 4 zlg (RETIRED) gentoo-dev 2016-06-21 00:35:59 UTC
Created attachment 438232 [details, diff]
Fixes Tcl_Interp *result issues.

This patch is meant for gnu-smalltalk-3.2.5, but may apply for 3.2.4 as well; I have not tested it on that version.

It's necessary due to upstream's continued use of direct access to the Tcl_Interp.result member, which is not allowed in Tcl >=8.6.
Comment 5 Ludovic Bellier 2016-07-03 22:38:56 UTC
I tested the Daniel's patch with the 3.2.4 version, it works for me. Now gst-blox launches and works.
Comment 6 zlg (RETIRED) gentoo-dev 2016-09-12 08:19:44 UTC
(In reply to Ludovic Bellier from comment #5)
> I tested the Daniel's patch with the 3.2.4 version, it works for me. Now
> gst-blox launches and works.

The patch has been added in 3.2.4-r1, and 3.2.5 is now available in tree. Marking as RESOLVED. Please reopen if this wasn't fixed!