Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLAMP java libs routing is messed up. #11

Open
smaudet opened this issue Mar 7, 2014 · 2 comments
Open

CLAMP java libs routing is messed up. #11

smaudet opened this issue Mar 7, 2014 · 2 comments

Comments

@smaudet
Copy link

smaudet commented Mar 7, 2014

CLAMP's find_jython_jars routine is messed up (and completely bogus against current jython-ssl tree).

Instead of implementing bad logic to find jars based upon an arbitrary executable path, just search the current classpath. It is not clamp's responsibility to call jython correctly - this is already done by the callee or wrapper script, and everything necessary is already on that classpath.

@jimbaker
Copy link
Member

jimbaker commented Mar 7, 2014

find_jython_jars is based on comparable functionality in the jython shell script/jython.bat for setting up the classpath. At least in my testing on Ubuntu and OSX, it works with the jython-ssl branch, since Clamp is not so useful without at least easy_install support (currently, only jython-ssl supports easy_install, although https://github.com/jimbaker/socket-reboot should hopefully fix this real soon now :), just a bit more work).

But what I think will be a much better solution is if the desired jars to be copied in are passed into the singlejar command. There is in fact some support for this idea in the current --classpath option, but it's not really the right approach as used there. In particular, Clamp now picks up all jars that are included in the clamped code through a discovery approach and ensures these are added to sys.path.

So let's take advantage of the warning about being "pre-alpha, API subject to change" and have the --classpath option set exclusively all jars to be included besides what's discovered in clamped packages. In particular, with --classpath set the find_jython_jars function will not be run.

@smaudet
Copy link
Author

smaudet commented Mar 11, 2014

There were three problem areas I noted after I managed to get this working (currently shim fixes only in my local branch):

find_jython_jars && find_jython_lib_files in clamp.build

The third area was a general set of pathing problems in Jython, I will report an issue against Jython rather than against clamp. However the functions in question are:

isStandalone in org.python.core.PySystemState
and
makeBundle in org.python.modules.zipimport.zipimporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants