Sujet : Re: tcl 9 and tclkits
De : et99 (at) *nospam* rocketship1.me (et99)
Groupes : comp.lang.tclDate : 27. Apr 2025, 02:22:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vuk0sd$3jpuj$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 4/25/2025 8:11 PM, Ashok wrote:
You might find Section 25.3 in the second edition useful for single file deployment with Tcl 9.
Alternatively, for an illustrative script, see https://wiki.tcl-lang.org/page/Single+file+applications+in+Tcl+9
/Ashok
On 4/22/2025 7:31 AM, et99 wrote:
I also see that in his tcl programming language book version 2, tcl 9, the chapter on tclkits is removed. Does this mean tclkits are not a part of tcl 9?
>
If not, is there an equivalent functionality.
>
>
Thanks for those links. I will look at your book.
I think we need a script to use existing .vfs directories, and do the equivalent of an [sdx.kit wrap name.exe -runtime ....exe] to use with the new zipfs code.
I have over a dozen such directories. This would save a lot of work.
I would try to write this myself, however, at present I'm now holding off using tcl 9 because of failures I get combining threads and package require commands. My test cases involve [package require Tk] and [package require math]. This is all on windows 10.
In the bawt tclkit, I actually get an access violation crash, likely on the Tk, since the temp folder doesn't have the dll for tk when it fails. In magicsplat and full install of bawt, no crashes, but errors trying package commands from within threads. The more threads I launch (with the same script) the more often it fails.
Since it's only a sometimes fails, I tend to think it's a race condition. This never failed in 8.6. Perhaps some attempt at performance increase is at issue here.
Unfortunately, I thus far can't get the failures with small core only code test cases, so I don't think it would be worth a ticket.
Also, with the tclkits, some failures indicate that the package command is trying to load the tk dll before it's fully setup in the temp folder - as the error was some kind of a no permission message.
I don't know how tcl 9 zipfs handles packages with dlls; I suspect they still will need to be exported to a temp folder, similar to tclkits.
I do have a somewhat of a workaround in magicsplat and bawt full, I simply issue
catch {package require Tk} ; package require Tk
catch {package require math} ; package require math
And then it takes many more tries to get the failures. This also indicates a timing problem. When it does fail, and the thread is still alive, I examine the value of auto_path and math is missing when it's the one that fails. When it works, there's an entry in the auto_path for math.
However, this is hack I'd rather not have to do.