TIP 595 did more than it talks about
Closed / Rejected9e4edfc3ff6a1485b2ea86d5bc1f7201cfe34e3aCreated 4 years agoUpdated 4 years ago
Descriptionplain2023-01-27 01:13:35
Until [828291fc64] the following worked as intendet and expected (any other sane binary extension should also do it in the example): load ./libtdom0.9.3.so set i [interp create] load {} tdom $i Since the next trunk commit [cbc50b67b9] this does not work anymore: load {} tdom $i => no library with prefix "tdom" is loaded statically The commit [cbc50b67b9] implements TIP 595, The TIP has noble aims but does not, at least explicitly, talk about changing the above behaviour. The message to the newly introduced error case tells some truth. If the extension used in the pattern above is build-in then this still works (as it do in Tcl 8). A short search on the wiki tells that the pattern above is in some use. The behaviour seems pretty orthogonal to what TIP 595 is about. So, without going to deep or more into arguing this could perhaps restored to the familiar behhavior?
jan.nijtmansplain2023-01-27 08:26:15
Please change this to:
<pre>
load {} Tdom $i
</pre>
Then it will work in both Tcl 8.x and Tcl 9.
The way the 2nd argument of "load" was handled in Tcl 8.x was horrible, there is no way to fix that in a 100% compatible way. Unfortunately.
jan.nijtmansplain2023-01-27 08:47:34
B.T.W: I had a short look at the tdom code. Please update the ./tclconfig/ directory to contains the latest TEA files. It will help making tdom fully work with Tcl 9.0.
jan.nijtmanswiki2023-01-27 15:27:57
> The TIP has noble aims but does not, at least explicitly, talk about changing the above behaviour
Looking again, the TIP does mention this here
The TIP didn't mention the _interp_ argument, I added that now.
pointsmanplain2023-01-27 17:03:34
Well, it's not only about compatibility Tcl 8 / Tcl 9 but also about build-in versus dynamic loaded.
Since almost ever tdom has
Tcl_StaticPackage(interp, "tdom", Tdom_Init, Tdom_SafeInit);
in its tclAppInit.c used to build a tclsh with tdom build in.
So while with a dynamic loaded tdom
load {} Tdom $interp
infact works after the TIP 595 this does not work with build-in tdom, for which this must still read
load {} tdom $interp.
Loading tdom into a child interp is done in the test suite, which I regulary run with standard tclsh as well as tclsh build-in with tdom. And I'm aware that there are folks out there which does use tclsh with statically build-in tdom.
So changing the second argument of Tcl_StaticPackage() in my tclAppInit.c just to "Tdom" has the risk that current working code of Tcl 8 users which uses tdom build in will fail.
So I'm looking out for the most simple way to make this work not only for Tcl 8 and Tcl 9 but also for dynamic loaded versus build-in.
Last invasive would perhaps to just register "tdom" as well as "Tdom" as build in. So just do both
Tcl_StaticPackage(interp, "tdom", Tdom_Init, Tdom_SafeInit);
Tcl_StaticPackage(interp, "Tdom", Tdom_Init, Tdom_SafeInit);
I would still have to change the test suite but with this at least current working Tcl 8 code will still work regardless of tDOM loaded dynamically or build-in.
Do you see any problem with this double announce with two names of one build-in extension?
jan.nijtmanswiki2023-01-27 20:06:34
> Do you see any problem with this double announce with two names of one build-in extension?
No, I don't see a problem with that.
Hope this helps, Jan Nijtmans
jan.nijtmanswiki2023-01-30 19:32:00
It looks like this one is fixed in tdom.
Therefore, closing
Log in (anonymous is fine) to add a comment.