2017-10-24

The ActiveState of Tcl: TEApot and TEAcup Are Now Open Source

The ActiveState of Tcl: TEApot and TEAcup Are Now Open Source


所以 ActiveState 開源了  TEApot 和 TEAcup。Source code 放在 Gihub:
https://github.com/ActiveState/teapot


使用 Magicsplat Tcl/Tk for Windows 執行時出現問題。

比對:
tcllib 1.18 下載以後解壓縮,modules\fumagic,pkgIndex.tcl
if {![package vsatisfies [package provide Tcl] 8.4]} {return}

# Recognizers
package ifneeded fileutil::magic::filetype 1.0.2 [list source [file join $dir filetypes.tcl]]
package ifneeded fileutil::magic::mimetype 1.0.2 [list source [file join $dir mimetypes.tcl]]

# Runtime
package ifneeded fileutil::magic::rt 1.0 [list source [file join $dir rtcore.tcl]]

# Compiler packages
package ifneeded fileutil::magic::cgen   1.0 [list source [file join $dir cgen.tcl]]
package ifneeded fileutil::magic::cfront 1.0 [list source [file join $dir cfront.tcl]]

與 Magicsplat Tcl/Tk for Windows 的版本:
if {![package vsatisfies [package provide Tcl] 8.6]} {return}
# Recognizers
package ifneeded fileutil::magic::filetype 1.2.0 [list source [file join $dir filetypes.tcl]]

# Runtime
package ifneeded fileutil::magic::rt 1.2.0 [list source [file join $dir rtcore.tcl]]

# Compiler packages
package ifneeded fileutil::magic::cgen   1.2.0 [list source [file join $dir cgen.tcl]]
package ifneeded fileutil::magic::cfront 1.2.0 [list source [file join $dir cfront.tcl]]

在比對完 github 的 check-in 記錄以後,應該是有人直接修改了 tcllib 的部份,所以如果是從 github 或者是 1.18 release 之後(精確的說是 2016 年 6 月 13 日)從 trunk 拿的版本,就可能會出現這個問題。

* 即使 fileutil::magic::mimetype 問題解決,還是需要 Trf 套件
* 有 Trf 套件還是無法執行,需要修改 Trf 套件的 pkgIndex.tcl 版本號(ActiveTcl 8.6.6 issue)
* 改了版號還是無法執行,pref-devkit.tm 需要 projectInfo 套件
* 移除掉 package require projectInfo 也無法正確執行,沒有 jobs-async.tm 檔案


更新:
看起來我的做法錯誤, 下載 ActiveTcl 8.6.6 以後重做一次。

can't find package fileutil::magic::mimetype
    while executing
"package require fileutil::magic::mimetype   "
    (file "C:/Temp/teapot/lib/metadata/teapot-metadata-read.tm" line 38)


ActiveTcl 使用 Tcllib 1.18,所以不會有這個問題,如果有遇到;
更新 mimetype 變成 filetype (不知道這個做法會不會影響程式執行)
然後

attempt to provide package Trf 2.1 failed: package Trf 2.1.4 provided instead
    ("package ifneeded Trf 2.1" script)


ActiveTcl 會遇到這個問題,把版本修正為精確版本。
更新 C:/ActiveTcl/lib/trf21/pkgIndex.tcl, 修改 2.1 為 2.1.4.
然後

couldn't read file "C:/Temp/teapot/lib/misc/jobs-async.tm": no such file or dire
ctory
    while executing
"source C:/Temp/teapot/lib/misc/jobs-async.tm"
    ("package ifneeded jobs::async 0.1" script)
    invoked from within
"package require jobs::async"
    (file "C:/Temp/teapot/lib/tap/tap-db-files.tm" line 31)


更新 C:/Temp/teapot/lib/tap/tap-db-files.tm,
修改 jobs::async 變成 jobs

can't find package projectInfo
    while executing
"package require projectInfo     "
    (file "C:/Temp/teapot/lib/prefdk/pref-devkit.tm" line 44)


重做以後遇到這個問題,目前的暫時解法是移除掉package require projectInfo 這一行。

然後終於有一個可以正確執行的東西。


不過可惜的是到這裡還沒有結束,使用 tclsh main.tcl list [package name] 以後,會出現

Bad configuration
No archives known

的訊息,有可能是需要一些其它設定,那麼即使修改到可以執行,還是沒用(PS. 已經使用有包含 mimetype 的 1.18 版測試過,看起來不是這個套件的問題)。所以有可能需要包裝為 teapot 的工具並且經過適當設定才能夠使用。

外部的開發者無法在自己環境使用的工具等於沒有開源一樣,而等於沒有開源的意思就是還是只有 ActiveState 自己的人在開發。經過測試,雖然 ActiveState 開源了 teapot,但是就目前的有限資訊下,對於非 ActiveState 的人(甚至是 ActiveTcl 8.6.6 的使用者)來說是個沒有用的工具。

更新:
我發了一個訊息到 comp.lang.tcl,這樣如果有使用 fileutil::magic::mimetype 的人在 Tcllib 被修改以後的版本遇到問題,他們才知道發生了什麼情況。

沒有留言: