|
2010-06-01
| ||
| 05:45 | • Ticket [2965424fff] Tcl_OOInitStubs has no version parameter status still Cl... artifact: 080a960398 user: dkf | |
| 05:04 | • Ticket [2965424fff]: 4 changes artifact: 9c5ef5e491 user: nijtmans | |
|
2010-05-31
| ||
| 20:51 | • Closed ticket [2965424fff]. artifact: aa85ce1cbc user: dkf | |
| 18:45 | • Ticket [2965424fff]: 4 changes artifact: ccc6620328 user: nijtmans | |
| 17:38 | • Ticket [2965424fff]: 4 changes artifact: af4f26dcfc user: dkf | |
| 15:07 | • Ticket [2965424fff]: 4 changes artifact: 0a29278b83 user: nijtmans | |
| 00:15 | • Ticket [2965424fff]: 4 changes artifact: a98322b761 user: jenglish | |
|
2010-03-08
| ||
| 20:56 | • Ticket [2965424fff]: 4 changes artifact: 5dcc963869 user: nijtmans | |
| 20:55 | • Ticket [2965424fff]: 4 changes artifact: e85735e46e user: nijtmans | |
| 20:55 | • Add attachment 2965424-2.patch to ticket [2965424fff] artifact: 571c3b8747 user: nijtmans | |
| 20:43 | • Ticket [2965424fff] Tcl_OOInitStubs has no version parameter status still Op... artifact: 67349dfc04 user: nijtmans | |
| 20:38 | • Ticket [2965424fff]: 4 changes artifact: a544370c26 user: dkf | |
| 20:27 | • Ticket [2965424fff]: 4 changes artifact: 71f7bd32df user: nijtmans | |
| 20:24 | • Ticket [2965424fff]: 4 changes artifact: 2847104c33 user: nijtmans | |
| 20:24 | • Add attachment 2965424.patch to ticket [2965424fff] artifact: 8e37b50f59 user: nijtmans | |
| 13:08 | • New ticket [2965424fff] Tcl_OOInitStubs has no version parameter. artifact: b4ad0b2c2d user: nijtmans | |
Tcl_OOInitStubs has no version parameter
Closed / Rejected2965424fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-03-08 13:08:51
Compare the following: Tcl_InitStubs(interp, "8.5", 0) with Tcl_OOInitStubs(interp) The version parameter of XX_InitStubs means the lowest version supported by this extension. However, in TclOO this value is already filled in being TCLOO_VERSION, which is the "compiled-against" version. The problem with this is, when someone compiles an extension using TCLOO_VERSION = "0.6.3", but runs it with Tcl 8.6b1, the XXInitStubs call will fail, even though it should run perfectly. There is a difference between the "lowest supported version", and the "compiled against" version. It should be possible to compile a TclOO extesion against TclOO 0.6.3 and run it using TclOO 0.6.2: As long as no 0.6.3-specific features are used (and the extension developer is the only one knowing this), everything should be fine. More specific, I suggest to change: #define Tcl_OOInitStubs(interp) \ Tcl_PkgRequire((interp),"TclOO",TCLOO_VERSION,0) to #define Tcl_OOInitStubs(interp, version) \ Tcl_PkgRequire((interp),"TclOO", version, 0) Maybe we should even have an "exact' parameter, just as the other *StubInit functions. This needs to be coordinated with Itcl and tdbc, because it introduces a source incompatiblility! Binary compatibility is not affected, except for the "exact" parameter! B.T.W: Tdbc_InitStubs has the same problem, but Itcl_InitStubs is O.K. B.T.W.: Personally, I don't mind very much about the "exact' parameter, but I could imagine the desire to keep it exactly the same as Tcl.
nijtmansplain2010-03-08 20:24:46
File Added - 365821: 2965424.patch
nijtmansplain2010-03-08 20:27:11
The proposed patch has the 'feature' that binary compatibility is guaranteed, but source compatibility is affected. However, TclOO extensions which are modified, immediately are binary compatible with 'the right way'. See the TODO in the patch.
dkfplain2010-03-08 20:38:47
I make no deep guarantees until version 1.0, which will correspond exactly with Tcl 8.6.0
nijtmansplain2010-03-08 20:43:53
In that, case, you can still use my patch, but set "exact' to 1. Then, at least, Tcl_OOInitStubs has the right signature.
nijtmansplain2010-03-08 20:55:40
File Added - 365822: 2965424-2.patch
nijtmansplain2010-03-08 20:56:23
OK, here is a new patch, being more strict in requiring 'exact' version match.
jenglishplain2010-05-31 00:15:41
For what it's worth, I believe the one-argument form XXX_InitStubs(interp); is to be preferred for all new stubs-supplying extensions. The three-argument form XXX_InitStubs(interp, version, exact); is error-prone and incorrectly couples the package release version to the ABI version.
nijtmansplain2010-05-31 15:07:48
Thanks for your reaction. Where can I find more about this? Is it ever discussed anywhere? (I happen to disagree, but I know that more people in the TCT vary in opinion about this). My view: Indeed, the package release version is different from an ABI. But because Tcl promises to keep the ABI upwards compatible in minor releases, there would never exist different ABI versions for equal package versions. I never saw an ABI version other than 0 anywhere. So, yes, I would like to couple the ABI version to the package version: Any ABI incompatible change should lead to a new major package version. That's what Tcl has done always, and extensions should do the same.
dkfplain2010-05-31 17:38:15
My position is clear. With TclOO I support using an extension compiled against one version of TclOO with later versions of TclOO. I also only support it if it is compiled with stub support; people building statically are unsupported (and there's certainly no ABI migration strategy there in any case). Because of this, there is no reason for people to select any API version other than the current (and with the "or later" option enabled) in the call to the *InitStubs call, so I removed the choice and made the API much simpler. Note that I'm being stricter about how I update the TclOO API and ABI than even Tcl normally is. I'm pretty sure that I've got the structures well-designed enough to support that from the beginning. (The exception is if they work with TclOO's internal API, but in that case there's *no* version guarantee beyond "I won't break things gratuitously".)
nijtmansplain2010-05-31 18:45:38
>Note that I'm being stricter about how I update the .... Full agreement here! >Because of this, there is no reason for people to select any API version.... The only reason there is, is someone compiling a TclOO extension against Tcl 8.7 (including TclOO 1.1), which only uses the TclOO 1.0 API, and then expecting it to run with Tcl 8.6 as well. That wouldn't work. If TclOO 1.1 is upwards compatible with TclOO 1.0, there is no reason that would not work, except from the explicit check in TclOO_InitStubs().
dkfplain2010-05-31 20:51:07
allow_comments - 1 Compile against 8.7 and load into 8.6? That's crazy talk! U.N.S.U.P.P.O.R.T.E.D!
nijtmansplain2010-06-01 05:04:42
How about compiling against 8.6.1 and load into 8.6.0? Is that supported? (the way it is now, that wouldn't work either) ...
dkfplain2010-06-01 05:45:20
Depends on whether they've both got the same version of TclOO's ABI; the TclOO version is not required to be lock-stepped to Tcl's. The only thing I'll guarantee is that TclOO 1.0 will correspond to Tcl 8.6.0, when that happens, but 8.6.1 might still correspond to 1.0.
Log in (anonymous is fine) to add a comment.
Attachments:
- 2965424-2.patch [download] added by nijtmans on 2010-03-08 20:55:39. [details]
- 2965424.patch [download] added by nijtmans on 2010-03-08 20:24:46. [details]