|
From: <bc...@wo...> - 2001-10-18 16:19:25
|
[Alexandre Petit-Bianco]
>OK. With a bit of help from hacking our runtime and trying things out,
>I found out that if I have in my local directory all the files found
>in Lib *and* a symlink called `java' pointing to the `java' directory
>containing the class files hierarchy resulting from the build of our
>clean-room Java run time, I can run testall.py.
>
>There's something wrong with the way things are searched (if you have
>insight on where in the code this is done, it would be cool -- I just
>started to read PySystemState.java.) so I'm guessing our runtime
>doesn't setup the same environment than a regular interpreter. It also
>transpires in our VM (gij), since it runs things if the `java' symlink
>is made (no needs for local copies of the *.py in that case.)
It sound like a problem in Jython's java package loading. Java package
loading is the feature that allow jython to do a
import java.awt
and know that java.awt is a java package. In a normal setup jython
detects that java.awt is a java package by scanning all the .jar (and
.zip) files it can find in the classpath. Directories in the .jar files
with .class files in it is indexesd as a java package. This index is
cached in {python.home}/cachedir.
This is all implemented in the *PackageManager.java files.
In addition to loading of java packages from .jar files, jython also
accept directories in the filesystem found on the CLASSPATH as java
packages. This is why your symlink helps.
I'm not at all sure how this scanning of .jar files can/should be done
in the gcj environment. Does the rt.jar (or classes.zip) file still
exists as a file? If it is replaced by something else (maybe a rt.so
library) is there any way to query its contents?
>On the good side of things, testall reports good results. It crashed
>in serialization because of bug in our runtime error most likely. And
>then there where some other tests that I had to disable (for example,
>exit doesn't behave the same way) but otherwise it brought me fairly
>quickly to getting the same crash that I got with the install JDK
>based version (ImportError: No module named AnonInner.)
The AnonInner.java source in Lib\test\javatests must be compiled
manually. The output .class files should just be placed the same
directory.
>Soon I hope to be able to hack the hooks to run the native compiler on
>jython generated classes.
How exactly would that work? Would a foo$py.class file be dynamicly
compiled into a foo$py.so library and loaded by the gij VM?
Do you have some web links that would allow us to read about the
enviroment that gij is running with?
regards,
finn
|