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

[truffle] shaded jars in jruby-truffle.jar #3587

Closed
mkristian opened this issue Jan 8, 2016 · 9 comments
Closed

[truffle] shaded jars in jruby-truffle.jar #3587

mkristian opened this issue Jan 8, 2016 · 9 comments
Assignees
Milestone

Comments

@mkristian
Copy link
Member

with jruby-9k we do not shade jline:jline:jar:2.11 and org.yaml:snakeyaml:jar:1.14 anymore but the jars are packed as they are into the jruby-stdlib and required as jar via jar-dependencies. requiring jars means they go into the jruby-classloader which has the application classloader as parent. if the parent has already those jars loaded then the jruby-classloader will take the one from the parent.

without the jruby-truffle.jar it would be possible via jar-dependencies or jbundler to use org.yaml:snakeyaml:jar:1.15 or org.yaml:snakeyaml:jar:1.16 but with the jruby-truffle.jar this is NOT possible. same story for jline:jline:jar:2.11 and all the other jars which get embedded.

jruby-truffle.jar comes with rvm and rbenb and ideally jruby would come without any dependency so each jruby runtime can pick and use the jars its application needs (as each runtime has its own jruby-classloader).

@chrisseaton
Copy link
Contributor

Just clarifying the problem - even if you don't use Truffle, the fact that our jars come first on the classpath means they override anyone else trying to use their own version of those classes?

@chrisseaton
Copy link
Contributor

Maybe a solution is to only put the Truffle jars on the class path when the launcher sees -X+T.

@mkristian
Copy link
Member Author

@chrisseaton yes those jars in the truffle jar just forces everyone to use those versions of the libraries.

to add the truffle jar only on -X+T is one short term solution to make jruby and jruby-complete.jar and any embedded jruby behave the same way again. but in the long run truffle should use those jars in the same manner as the current jruby stdlib, i.e. require them, like jline and snakeyaml. not sure whether truffle core needs antlr itself - then there is no way around it.

@chrisseaton
Copy link
Contributor

Or we could re-namespace everything, or just Antlr.

I'll look into this options and update you here.

@chrisseaton chrisseaton self-assigned this Jan 9, 2016
@chrisseaton chrisseaton added this to the truffle-dev milestone Jan 9, 2016
@mkristian
Copy link
Member Author

mkristian commented Jan 9, 2016 via email

@mkristian
Copy link
Member Author

the snakeyaml is a different story as it implements psych and regular jruby uses the psych gem as default gem. truffle as it is right now does not allow to "overwrite" psych by installing the psych gem. not sure how much of it is a "temporary" solution to get yaml working.

@chrisseaton
Copy link
Contributor

I'll do the only adding Truffle to the classpath when -X+T is set today. That should fix all problems for anyone not using Truffle, right?

@mkristian
Copy link
Member Author

mkristian commented Jan 11, 2016 via email

@chrisseaton
Copy link
Contributor

Fixed in e84c5e6.

I don't think we want to do any other shading or lazy loading at the moment, as the expected use-case for Truffle does not involve any user jars at the moment, so there's nothing to conflict with.

@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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

3 participants