Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tclkit 8.6.10 for windows 64bit with threads

285 views
Skip to first unread message

P8j6

unread,
Aug 26, 2020, 3:59:37 PM8/26/20
to
Hi,

i.m looking for tclkit with Tcl 8.6.10 + Tk + Threads. For windows 64 bit.
Does anyone know where to get one?

Itried 8.6.10 from there: https://tclkits.rkeene.org/fossil/wiki/Downloads
But it looks like they are without threads support.

I also tried generate one there: http://kitcreator.rkeene.org/kitcreator
But they dont works. It throws errors.

P8j6

unread,
Aug 28, 2020, 11:39:31 AM8/28/20
to
Dne středa 26. srpna 2020 v 21:59:37 UTC+2 uživatel P8j6 napsal:
Ok, i found out, that basekits generated from kitcreator actually works.
But when i use this basekit as runtime for my starpack and put windows EV certificate onto it. It stop working. Certificate corrupts filesystem.

Until now, i used old 32bit 8.6.3 basekit from ActiveState. And it worked, even with EV certificate. Old basekits from ActiveState probably used some different basekit format.
Sadly, i recent ActiveState distributions there are no basekits anymore.

So, does someone know, where i can get any 64bit ActiveState format basekit? Or how to generate one?

Christian Gollwitzer

unread,
Aug 28, 2020, 1:39:43 PM8/28/20
to
Am 28.08.20 um 17:39 schrieb P8j6:
I haven't tried the codesigning thing myself; but on this page:

https://wiki.tcl-lang.org/page/SDX+under+Windows

they claim, that vq based tclkits can be signed (as opposed to metakit
based). You could try my fork of kbskit to build one yourself.

1) Install the 64bit git SDK
https://github.com/git-for-windows/build-extra/releases

2) In the git command prompt, clone kbskit

git clone https://github.com/auriocus/kbskit.git

cd kbskit

./kbs.tcl install kbskit8.6


That should run, donwload and compile all the stuff, in the end result
in buildWindows/bin/kbsvq*.exe

Feel free to report any errors you may encounter.

Christian

P8j6

unread,
Aug 28, 2020, 2:58:19 PM8/28/20
to
Dne pátek 28. srpna 2020 v 19:39:43 UTC+2 uživatel Christian Gollwitzer napsal:
Hi Christian,

thanks for help. I tried the building script, but it failed with this error:

=== Package eval: kbskit8.6
=== Configure C:/git-sdk-64/kbskit/buildWindowsNT/kbskit8.6
configure: error: /c/git-sdk-64/kbskit/buildWindowsNT/lib directory doesn't contain tclConfig.sh
Error in execution of 'install kbskit8.6':
=== Package failed for: kbskit8.6
child process exited abnormally


So i tried to copy missing tclConfig.sh into mentioned directory and rerun command:

./kbs.tcl install kbskit8.6

But then it failed with:

=== Package eval: kbskit8.6
=== Make C:/git-sdk-64/kbskit/buildWindowsNT/kbskit8.6
make: *** No rule to make target 'all-vq-cli'. Stop.
Error in execution of 'install kbskit8.6':
=== Package failed for: kbskit8.6
child process exited abnormally

Christian Gollwitzer

unread,
Aug 28, 2020, 3:20:49 PM8/28/20
to
Am 28.08.20 um 20:58 schrieb P8j6:
>> ./kbs.tcl install kbskit8.6
>>
>>
>> That should run, donwload and compile all the stuff, in the end result
>> in buildWindows/bin/kbsvq*.exe
>>
>> Feel free to report any errors you may encounter.
>>
>> Christian
>
>
> Hi Christian,
>
> thanks for help. I tried the building script, but it failed with this error:
>
> === Package eval: kbskit8.6
> === Configure C:/git-sdk-64/kbskit/buildWindowsNT/kbskit8.6
> configure: error: /c/git-sdk-64/kbskit/buildWindowsNT/lib directory doesn't contain tclConfig.sh
> Error in execution of 'install kbskit8.6':
> === Package failed for: kbskit8.6
> child process exited abnormally

I just realised that the switch "-r" was missing. It should have been

./kbs.tcl -r install kbskit8.6

Before you start over, it's best to remove the whole buildWindowsNT
folder to start over, otherwise the build system may get confused.

Christian

P8j6

unread,
Aug 28, 2020, 4:38:49 PM8/28/20
to
Dne pátek 28. srpna 2020 v 21:20:49 UTC+2 uživatel Christian Gollwitzer napsal:
Thanks! With -r, compilation was finsihed without errors.

Is it possible that threads are not enabled? My programn now crashing with message "Thread ... does not exists".
Or maybe is in 8.6.10 something new with threads that i missed?
With 8.6.3 threads works normally.

Christian Gollwitzer

unread,
Aug 29, 2020, 2:05:12 AM8/29/20
to
Am 28.08.20 um 22:38 schrieb P8j6:
> Dne pátek 28. srpna 2020 v 21:20:49 UTC+2 uživatel Christian Gollwitzer napsal:
>> I just realised that the switch "-r" was missing. It should have been
>>
>> ./kbs.tcl -r install kbskit8.6
>>
>> Before you start over, it's best to remove the whole buildWindowsNT
>> folder to start over, otherwise the build system may get confused.
>>
>
> Thanks! With -r, compilation was finsihed without errors.
>
> Is it possible that threads are not enabled? My programn now crashing with message "Thread ... does not exists".
> Or maybe is in 8.6.10 something new with threads that i missed?
> With 8.6.3 threads works normally.

That would be strange. I don't have Windows here to test now, but on OSX
Thread works as expected:

% Apfelkiste:kbskit chris$ buildDarwin/bin/kbsvq8.6-gui
% info patchlevel
8.6.10
% Apfelkiste:kbskit chris$ buildDarwin/bin/kbsvq8.6-gui
% info patchlevel
8.6.10
% package require Thread
2.8.5
% package ifneeded Thread 2.8.5
load
/Users/chris/Programmieren/kbskit/buildDarwin/bin/kbsvq8.6-gui/lib/thread2.8.5/libthread2.8.5.dylib


Also, the error message is strange. If I try to load a non-existent
package, it says:

Apfelkiste:kbskit chris$ buildDarwin/bin/kbsvq8.6-gui
% package require mist
can't find package mist

So where does the error message come from?

Christian


P8j6

unread,
Aug 29, 2020, 4:16:35 AM8/29/20
to
Dne sobota 29. srpna 2020 v 8:05:12 UTC+2 uživatel Christian Gollwitzer napsal:
It's not, that package cannot be loaded. Problem is, that thread dies, even if is ordered to wait in event loop.

There, i've made screenshot of error: https://photos.app.goo.gl/F8Df2q6DCvUbtALZ9

Code in my program is this

proc create_thread {} {
if {[info exists starkit::mode] && $starkit::mode ne "unwrapped"} {
set self $starkit::topdir
append data "vfs::mk4::Mount \"$self\" \"$self\" -readonly\n"
}

append data "set ::auto_path [list $::auto_path]\n"
append data "set vfs_path [list $starkit::topdir]\n"
append data "namespace eval ::starkit { variable topdir $self}\n"
append data "::tcl::tm::path add \{[file join $starkit::topdir tmlib]\}\n"
append data "thread::wait"

return [thread::create $data]
}

....

set worker_thread_id [create_thread]

....

thread::send $worker_thread_id {
...
}

First i create thread with some paths for VFS and put it to "wait". Then when i need to use this thread, thread is dead and error occurs.

As i said. On old 5.6.3 basekit, that worked. So i dont know if this problem is with my code. Or with this basekit.


Christian Gollwitzer

unread,
Aug 29, 2020, 4:48:40 AM8/29/20
to
Am 29.08.20 um 10:16 schrieb P8j6:
What is this thing: vfs::mk4::Mount ??? Seems quite fishy to me. Are you
sure you need to care about the internals of the tclkit file system?


> }
>
> append data "set ::auto_path [list $::auto_path]\n"
> append data "set vfs_path [list $starkit::topdir]\n"
> append data "namespace eval ::starkit { variable topdir $self}\n"
> append data "::tcl::tm::path add \{[file join $starkit::topdir tmlib]\}\n"
> append data "thread::wait"
>
> return [thread::create $data]
> }
>
> ....
>
> set worker_thread_id [create_thread]
>
> ....
>
> thread::send $worker_thread_id {
> ...
> }
>
> First i create thread with some paths for VFS and put it to "wait". Then when i need to use this thread, thread is dead and error occurs.

I guess that there was an error in the startup code of the thread.


Christian

P8j6

unread,
Aug 29, 2020, 5:19:37 AM8/29/20
to
Dne sobota 29. srpna 2020 v 10:48:40 UTC+2 uživatel Christian Gollwitzer napsal:
You are right! That was the problem.
I removed that mounting and now it works.

FYI - This vfs mounting was necessary for 8.6.3.

if {[info exists starkit::mode] && $starkit::mode ne "unwrapped"} {
set self $starkit::topdir
append data "vfs::mk4::Mount \"$self\" \"$self\" -readonly\n"
}
append data "set ::auto_path [list $::auto_path]\n"


Because, when program was started in folder that has some whitespaces and/or diakritics characters in path, then it failed to load packages from VFS and throwed this error:
https://photos.app.goo.gl/RtGCJvFfQZ1749qFA
So it was workaround. But it looks like, on 8.6.10 it's no longer necessary.

Anyway, thanks for all your help! You saved me from sleepless nights :)
Thanks!

Christian Gollwitzer

unread,
Aug 29, 2020, 5:47:28 AM8/29/20
to
Am 29.08.20 um 11:19 schrieb P8j6:
> FYI - This vfs mounting was necessary for 8.6.3.
>
> if {[info exists starkit::mode] && $starkit::mode ne "unwrapped"} {
> set self $starkit::topdir
> append data "vfs::mk4::Mount \"$self\" \"$self\" -readonly\n"
> }
> append data "set ::auto_path [list $::auto_path]\n"
>
>

> Because, when program was started in folder that has some whitespaces and/or diakritics characters in path, then it failed to load packages from VFS and throwed this error:
> https://photos.app.goo.gl/RtGCJvFfQZ1749qFA
> So it was workaround. But it looks like, on 8.6.10 it's no longer necessary.

Are you sure there is not a similar error still? This line

> append data "namespace eval ::starkit { variable topdir $self}\n"

looks bad to me, if $self contains list metacharacters.

FWIW, this is how I do it:

variable basedir [file normalize [file dirname [info script]]]
lappend auto_path [file join $basedir lib]

proc createThread {} {
variable basedir
variable tid [thread::create]
set mainid [thread::id]
Worker set mainid $mainid
Worker set auto_path $::auto_path
Worker source [file join $basedir models.tcl]
}

proc Worker {args} {
variable tid
thread::send $tid $args
}


"models.tcl" is the thing that runs in the thread. No other trickery
with starkit::topdir etc. The Worker proc ensures that all single
commands are correctly transferred / listified before handed down to the
worker thread.

Christian

P8j6

unread,
Aug 29, 2020, 8:18:49 AM8/29/20
to
Dne sobota 29. srpna 2020 v 11:47:28 UTC+2 uživatel Christian Gollwitzer napsal:
So far, i tested various obscure folder names and it works.
But you are right, it need rewrite. It was hacked because this bug in 8.6.3, and never refactored since then.

I will try your approach. It looks more cleaner and solid.

0 new messages