Error running starpack on Mac when tcl files are compiled

Posted by wcf3 on 2012-02-23 14:23
Forums: TDK support | OS: OS X 10.7 (Lion)

I'm trying to generate a standalone Tcl application using tclapp. The generated runtime works as long as I don't compile the Tcl code.

The error I get when I run the compiled runtime is:

test.tcl: The TclPro ByteCode Loader is not available or does not support the correct version -- dlopen(/var/tmp/tclwNROwK, 6): no suitable image found. Did find:
/var/tmp/tclwNROwK: file too short
while executing
"source $startup"
(file "main.tcl" line 38)

I'm using TDK 5.3 build 295349 (but tclapp reports it is build 295336) and I have reinstalled it and verified the files were updated properly. I have tried several different prefix files all with the same result.

I also tried running tclvfse an received the following error:

can't find package splash
while executing
"# Compiled -- no source code available
error "called a copy of a compiled script""
(procedure "::splash_hook" line 1)
invoked from within
"# Compiled -- no source code available
error "called a copy of a compiled script""
(procedure "go" line 1)
invoked from within
"# Compiled -- no source code available
error "called a copy of a compiled script""
invoked from within
"tbcload::bceval {
TclPro ByteCode 2 0 1.7 8.5
27 0 232 35 0 0 120 0 9 27 31 -1 -1
232
w0E6#2)>6#3,>6#6G:3w<&5p..."
(file "/Applications/ActiveState ActiveTcl/tclvfse.app/Contents/MacOS/tclvfse/main.tcl" line 7)
invoked from within
"source {/Applications/ActiveState ActiveTcl/tclvfse.app/Contents/MacOS/tclvfse/main.tcl}"
("uplevel" body line 1)
invoked from within
"uplevel [list source [file join $self main.tcl]]"

I'm running on Lion 10.7.3 and have run teacup update for the latest versions.

Chuck

andreas.kupries
ActiveState Staff
Mon, 2012-02-27 12:18

The prefix is not relevant here.
The issue is something with the "tbcload" package.

The package is found during wrapped, and also found in the wrapped executable, as your code apparently tries to load it.

The path is /tmp/ because the Tcl runtime has copy the library to disk to load it properly. Then the OS claims that the file is too short. "no suitable image found" usually implies that the library did not contain the binaries for the specific architecture in question.

This could happen if you have an ix86/ppc tbcload wrapped, and are running with architecture x86_64.

If you are using TDK's verbose mode (option -v, or the checkbox under Advanced in the GUI) it should tell you where it gets the tbcload package from, and for what platform this binary is.

If you have a (Snow) Leopard machine it might also be useful to try to run the wrapped executable there as well, to check if the issue is specific to Lion, or not.

wcf3 | Sun, 2012-03-04 11:28

I don't get teacup/teapot at all...

It turns out the tbcload package in the repository was for win32 (the only way I figured that out was by reading the .tap file in the repository). I had to remove tbcload, then reinstall it and it picked up the macosx10.5-i386-x86_64 architecture.

I had attempted to install all architectures in the repository so I could wrap whatever architecture I wanted, but it appears that a repository can only support one package architecture at a time!!! Or I just don't get how to use it (most likely the problem). Documentation for teacup is less than ideal in my opinion.

How do I set the repository to allow any architecture? My repository doesn't even allow macosx-universal...

confused,
Chuck

P.S. Just tried this and got the following error. Really confused now...

$ sudo teacup install tbcload
Resolving tbcload ... [package tbcload 1.7 macosx10.5-i386-x86_64 ... Already installed in repository, probing dependencies]
Resolving Tcl 8.4 -is package ... [package Tcl 8.5.10 _ ... Installed outside repository, probing dependencies]

$ sudo teacup install --arch macosx10.5-i386-x86_64 tbcload
The requested architecture "macosx10.5-i386-x86_64" is not
supported by the repository at "/Library/Tcl/teapot".

andreas.kupries
ActiveState Staff
Wed, 2012-03-07 11:48

> It turns out the tbcload package in the repository was for win32

In what directory is your repository ?

> (the only way I figured that out was by reading the .tap file

.tap files are 'clpp

ackage' definition files which precede teacup/teapot.

They cannot really appear in a proper teapot repository. Although TDK has some code to make a directory of .tap files appear to it like a teapot repository.

And .tap files with a win32 architecture should occur only in ActiveTcl for Win32, which cannot be installed on an OS X machine.

Which is why I am now confused how you managed that for your machine.
And it ties to my question above about what directory your "repository" was in.

It would also be useful to know the exact settings of your global TAP search path, and global TEAPOT search path. Both are available in the menu 'Edit -> Preferences' of TclApp.

> I had attempted to install all architectures in the repository so I could wrap whatever
> architecture I wanted, but it appears that a repository can only support one package
> architecture at a time!!!

Yes. This is what we call an 'installation repository'. It supports the architectures of the tclsh/wish shells connected to it.

Have you seen your local equivalent of
http://docs.activestate.com/activetcl/8.5/tpm/toc.html
(referenced by http://docs.activestate.com/activetcl/8.5/at.pkg_index.html)
or http://docs.activestate.com/tdk/5.3/TEA_Apps.html
(referenced by http://docs.activestate.com/tdk/5.3/#tpm_summary)
?

(Link titles are all 'TEAPOT Package Management' or similar)

> Or I just don't get how to use it (most likely the problem).
> Documentation for teacup is less than ideal in my opinion.

Well, documentation exists, see above. Is that the documentation you have read and consider less than ideal ? If not, what do you think could be done to point you better to it ? (I thought that the links for that were fairly prominent).

> How do I set the repository to allow any architecture?

You need an archive repository (see glossary), which you can create and manage via teapot-admin (in TDK).

> My repository doesn't even allow macosx-universal...

> P.S. Just tried this and got the following error. Really confused now...

> $ sudo teacup install tbcload
> Resolving tbcload ... [package tbcload 1.7 macosx10.5-i386-x86_64 ...
> Already installed in repository, probing dependencies]

Well, from the last you said, you had tbcload installed, so that is correct.

> $ sudo teacup install --arch macosx10.5-i386-x86_64 tbcload
> The requested architecture "macosx10.5-i386-x86_64" is not
> supported by the repository at "/Library/Tcl/teapot".

Hm. This is a bit weird, yes.

Have a look into the following files:

* /Library/Tcl/teapot/teapot.local-ma.config
* [info library]/teapot-link.txt (for your tclsh)

What is reported by

platform::identify

when run from your tclsh ?

hanifnoor | Sun, 2014-11-23 20:15

Then the OS claims that the file is too short. "no suitable image found" usually implies that the library did not contain the binaries for the specific architecture in question.

This could happen if you have an ix86/ppc tbcload wrapped, and are running with architecture x86_64.

If you are using TDK's verbose mode (option -v, or the checkbox under Advanced in the GUI) it should tell you where it gets the tbcload package from, and for what platform this binary is.

_____
hanif