Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2025-05-06
13:31 • Ticket [fc35093cef] Better error-message than "interpreter uses an incompat... artifact: a1c591e4d7 user: dgp
09:27 • Closed ticket [fc35093cef]. artifact: 4f91ddb809 user: jan.nijtmans
09:05 • Open ticket [fc35093cef]. artifact: 9f6a55a523 user: sbron
2025-01-07
12:31 • Closed ticket [fc35093cef]. artifact: 9221409742 user: jan.nijtmans
10:06
Fix [fc3509]: Better error-message than "interpreter uses an incompatible stubs mechanism" check-in: 7704f91f2e user: jan.nijtmans tags: trunk, main
09:53
Fix [fc35093ce]: Better error-message than "interpreter uses an incompatible stubs mechanism" check-in: d9f0a470f3 user: jan.nijtmans tags: core-8-branch
2025-01-06
17:10
Fix [fc35093ce] for Tcl 8.6: Better error-message than "interpreter uses an incompatible stubs mecha... check-in: 08a5a7d4e1 user: jan.nijtmans tags: core-8-6-branch
2025-01-03
16:52 • Ticket [fc35093cef] Better error-message than "interpreter uses an incompat... artifact: 00f24cc602 user: jan.nijtmans
15:47
Proposed fix for [fc35093ce]: Better error-message than "interpreter uses an incompatible stubs mech... check-in: 4260a19710 user: jan.nijtmans tags: bug-fc35093ce
15:02 • New ticket [fc35093cef] Better error-message than "interpreter uses an inco... artifact: b274b92a72 user: jan.nijtmans

Better error-message than "interpreter uses an incompatible stubs mechanism"

Closed / Fixedfc35093cef269e906512ad028d7590f883edb0feCreated 2 years agoUpdated 2 years ago
Descriptionwiki2025-01-03 15:02:11
If a shared library compiled for Tcl 8.x is loaded in Tcl 9.0, the error-message is: "interpreter uses an incompatible stubs mechanism".

We can do better than that, because Tcl 9.0 has a different 'magic' value which is unique compared to other possible error-situations.

Proposal: "this extension is compiled for Tcl 8.x"

jan.nijtmanswiki2025-01-03 16:52:05

Implementation giving the improved error-message: [here]

jan.nijtmanswiki2025-01-07 12:31:48

Fixed [here]

sbronwiki2025-05-06 09:05:33

The current fix will produce the "this extension is compiled for Tcl 8.x" error message for any library with an incompatible stubs mechanism. While that describes the only reason that can happen at present, it fails to take into account that there may be incompatible changes to the stubs mechanism in the future. I can imagine that at some point in the future there may be a Tcl 10 with yet another change to the stubs mechanism. Loading an extension compiled for Tcl 10 into Tcl 9 would then also give the (misleading) indication that the extension was compiled for Tcl 8.x.

I suppose the easiest fix is to change the message to "this extension is compiled for a different Tcl major version", assuming incompatible changes to the stubs mechanism only happen in a major version. Alternative, in case "major version" is considered jargon that may not be clear to the average user, "this extension is not compiled for Tcl 9.x"

jan.nijtmanswiki2025-05-06 09:27:41

Don't worry, all you are mentioning is already taken into account.

See: https://core.tcl-lang.org/tcl/file?name=generic/tclStubLib.c&ci=399d648cc325acd7&ln=80-97

dgpmarkdown2025-05-06 13:31:07

Related background is found here [3588687]

Log in (anonymous is fine) to add a comment.