andreas-kupries / critcl

Critcl lets you easily embed C code in Tcl. Online documentation at
http://andreas-kupries.github.io/critcl
Other
72 stars 19 forks source link

Configure of TEA package generated via critcl fails #86

Closed apnadkarni closed 6 years ago

apnadkarni commented 6 years ago

Re. critcl 3.1.17

Attempt to configure a TEA based package generated using the -tea option to critcl fails with the following message:

couldn't read file "./critcl/lib/util84/lassign.tcl": no such file or directory
    while executing
"source [file dirname [info script]]/lib/$p.tcl"
    ("foreach" body line 2)
    invoked from within
"foreach p {
        util84/lassign
        util84/dict
        stubs/container
        stubs/reader
        stubs/genframe
        stubs/gen_decl
        stubs/gen_macro
        stubs/gen_slot
        stubs/gen_he..."
    (file "./critcl/main.tcl" line 4)

The util84 directory in the generated TEA package only contains dict.tcl, thus attempt to load lassign.tcl fails.

The fix is either to modify ::critcl::app::PlaceCritclSupport in file critcl.tcl to copy the lassign84* directory to util84 (just as for the dict84 dir on line 1640) OR to remove the attempt to load util84/lassign (see lappend to pfiles, line 1657).

Not sure what the right fix you want is - depends on whether 8.4 compat is still desired. Personally, I think it should be purged simply to avoid similar issues in the future.

/Ashok

apnadkarni commented 6 years ago

OK, now I'm thoroughly confused and perhaps my analysis was wrong. Fixing the code for lassign leads to similar errors for reader.tcl and then for the stubs files except container.tcl which is explicitly included. Since I'm sure an older version (3.12 or 3.13 I think) worked fine, and that shows no diffs in that particular proc (PlaceCritclSupport) I assume the missing files are intended to be copied by some other means. But I can't figure out where that is supposed to happen.

apnadkarni commented 6 years ago

Further investigation reveals that while the PlaceCritclSupport proc has not changed between 3.12 and 3.17, the critcl directory structure has changed. 3.12 had lassign.tcl and dict.tcl both under the util84 and all the stubs related files under the stubs directory. 3.17 on the other hand breaks these out into separate directories and consequently only the dict.tcl and container.tcl files get copied as the other directories are not listed in the Place* command.

I'm not sure whether this means the -tea option has not worked in the last few critcl releases or if I'm missing something.

apnadkarni commented 6 years ago

I've submitted a pull request that addresses this issue.

andreas-kupries commented 6 years ago

I'm not sure whether this means the -tea option has not worked in the last few critcl releases or if I'm missing something.

I am pretty sure it means that -tea did not work since the restructuring.

andreas-kupries commented 6 years ago

Merged.