Man, I really wish I had more time to work on all this, but I can at least
provide a bit more of an info dump on the current state, and what I'm
working on to improve it for the future.

So, I mentioned that the require 'openssl' test is failing.  It's failing
with felix, because we currently assume we can translate an OSGi Bundle
Entry into a File that can be used in RubyInstanceConfig as JRubyHome.
There's a comment indicating belief that earlier versions of Felix simply
returned file:// URLs for bundle entries anyway, but that doesn't appear to
be the case with either our felix2 or felix4 profiles.  There's some kludge
code in place that still appears to work with recent versions of Equinox to
translate their bundle*:// URLs to Files.

The fix that I want to work on is giving RubyInstanceConfig an additional
setJRubyHome(URL) method.  If we could simply use the URLs returned from
OSGi directly, a simple URL#openStream() would allow us to read the
contents, rather than needing JRuby to figure out how to translate OSGi
URLs to paths.  And, turning simple File objects into URLs strikes me as
easier than trying to figure out how to properly map arbitrary bundle*://
URLs to Files.

All of this is a very long winded way of saying that loading embedded gems
is a bit broken on non-Equinox OSGi containers currently, but the fix (at
least the fix that I have in mind) is non-trivial.


On Sun, Sep 22, 2013 at 3:26 PM, christian <m.krist...@web.de> wrote:

> not sure but
> $ mvn clean install -Pcomplete
> from the main directory should work (and works for me).
>
> -christian
>
>
>
> On Sun, Sep 22, 2013 at 7:43 PM, Anthony Juckel <ajuc...@gmail.com> wrote:
>
>> First, to answer our question, we don't need any OSGi metadata in any
>> jars embedded in jruby-complete in order for it to be a well-behaved
>> bundle.  Even so, my require 'openssl' test is failing under OSGi, and I
>> think it's because a bundle:// URI is getting passed through to
>> RubyInstanceConfig, but I'm having trouble rebuilding jruby-complete with
>> my changes.  The jruby-core artifact in my maven repository has my changes
>> to RubyInstanceConfig, but somehow in the building of jruby-complete, my
>> updated RubyInstanceConfig is not being used.
>>
>> What am I missing in the build to make sure that updated jruby-core
>> classes are included in the jruby-complete build?
>>
>> $ jar xf
>> $MVN_REPO/org/jruby/jruby-core/1.7.5.dev/jruby-core-1.7.5.dev.jar
>> org/jruby/RubyInstanceConfig.class
>> $ mv org/jruby/RubyInstanceConfig.class
>> org/jruby/RubyInstanceConfig_core.class
>> $ jar xf
>> $JRUBY_SRC/maven/jruby-complete/target/jruby-complete-1.7.5.dev.jar
>> org/jruby/RubyInstanceConfig.class
>> $ diff org/jruby/RubyInstanceConfig_core.class
>> org/jruby/RubyInstanceConfig.class
>> Binary files org/jruby/RubyInstanceConfig_core.class and
>> org/jruby/RubyInstanceConfig.class differ
>>
>> Using javap to disassemble the two classes, I see that the jruby-core
>> artifact does have my changes, but the jruby-complete artifact does not.
>>
>>
>> On Tue, Sep 17, 2013 at 10:58 AM, christian <m.krist...@web.de> wrote:
>>
>>> hi
>>>
>>> is there a chance to get the modular jruby artifacts running on osgi -
>>> do all the dependent jar be osgi for that ? I am rather new to osgi ;) so
>>> excuse my ignorance !
>>>
>>> On Tue, Sep 17, 2013 at 4:49 PM, Anthony Juckel <ajuc...@gmail.com>wrote:
>>>
>>>> Ah, very right. Now I see your commits from last week.  I am surprised
>>>> that Felix 2 is apparently broken now.  I can try looking at that, time
>>>> permitting, but that's pretty low on my list.
>>>>
>>>
>>> I am happy to add felix2 and equinox to the ITs
>>>
>>>  the equinox not sure if I just deleted it or whether it was still there
>>> when I touched the pom.xml
>>>
>>>
>>>> I believe the OSGi jruby classloader will handle embedded jars just
>>>> fine, but if there's a particular class or gem you'd like tested, I could
>>>> add that.
>>>>
>>> the helloworld test just "require 'openssl'" to ensure the ssl stuff is
>>> in place - might me an addition to the osgi test as well
>>>
>>> - christian
>>>
>>> The current test simply ensures we can:
>>>>
>>>> 1)  Load OSGiScriptingContainer
>>>> 2)  Can java_import a class not shipped with JRuby (as long as a bundle
>>>> that can see it was given as a parameter to the scripting container).
>>>> 3)  Can actually call a method on that imported class.
>>>>
>>>> Also, the profiles on the original jruby-osgi-test allowed running the
>>>> tests under either equinox, felix4 or felix2.
>>>>
>>>  On Sep 17, 2013 9:37 AM, "christian" <m.krist...@web.de> wrote:
>>>>
>>>>> great that there is someone with osgi knowhow looking at that ;)
>>>>>
>>>>> but I have the feeling you missed the current state of osgi:
>>>>>
>>>>> $ mvn -Pcomplete
>>>>>
>>>>>  will run the osgi IT which is now in
>>>>> maven/jruby-complete/src/it/osgi-test
>>>>> which is just copy and paste of the old code with some adjustments to
>>>>> get it pass. whether passing that test means a lot I do not know.
>>>>>
>>>>> the bouncy-castle jars are bundled within the META-INF/jruby.home
>>>>> along with a number of other jars - not sure what the issue there is but
>>>>> any gem with jars will have the same issue - the jruby-classloader loading
>>>>> a vendored jar.
>>>>>
>>>>>
>>>>> so it would be great to use the integration test from jruby-complete
>>>>> as a starting point.
>>>>>
>>>>> - christian
>>>>>
>>>>>
>>>>>
>>>
>>
>

Reply via email to