<boc_tothefuture[>
Is it possible to create a ScriptEngine instance using the OSGIContainer? Looking at the code, JRubyEngine constructor is protected so I don't see a way.
<boc_tothefuture[>
The above question is on JSR223 scope.
<headius[m]>
Good morning
<headius[m]>
I will have a look at your example today
<headius[m]>
I am not super familiar with the osgi side of that stuff
<boc_tothefuture[>
Well, I am trying to troubleshoot based on a different approach.. I htink part of the issue is because this is running in an OSGI context. However, I can't see how to create an OSGI based ScriptEngine.
<headius[m]>
There might be some docs on the wiki
<headius[m]>
Most of the embedding stuff has extensive if slightly dated documentation
<boc_tothefuture[>
Yeah, looking through the docs you can create the context, but I don't see a way to get the context into the ScriptEngine.. but I will keep probing.
<headius[m]>
boc_tothefuture: I see your gist code but can you show me the java logic you are using to launch it?
<headius[m]>
I just want to make sure I'm running it the same way you are
<boc_tothefuture[>
Unfortunately, it is part of a 3rd party system i am trying to integrate with. Fairly complex to setup.
<headius[m]>
hmm ok
<headius[m]>
I will just do a generic JSR223 thing then
<headius[m]>
boc_tothefuture: unfortunately it works fine for me
<mariuszcwikla[m]>
When working on this I also found that previous "hash" (now moved to "hash_old") was also not 100% consistent with Ruby. Ruby calculates it on "unsigned int" while JRuby on "int". So for some cases it is generating inconsistent old hash. Do you think it it's ok to fix in the same PR or submit new one?
<mariuszcwikla[m]>
in other words: jruby sometimes calculates negative hash_old, but ruby only positive
<boc_tothefuture[>
headius: so my guess is the framework it is running in is either causing the issue or the fact that its an OSGI based system.
<boc_tothefuture[>
I am trying to test those out..
<headius[m]>
Ok. We could also try to make a build of 9.2.13 that would log more, like printing a stack trace when the File constant gets overwritten
<headius[m]>
Perhaps there is some shared jsr 223 code that binds the Java File class into the engine?
<headius[m]>
That might be fine for the other languages but since Ruby has a top level File it breaks
<boc_tothefuture[>
Where would I find the code that notes when a constant is overwritten? I have teh source here so I can build and test.
<headius[m]>
[mariuszcwikla](https://matrix.to/#/@mariuszcwikla:matrix.org): sorry I missed your message above earlier. I would say we should try to match as much as possible since people may need to compare results between jruby and C Ruby instances
<headius[m]>
It would be better to do as a separate PR please
<headius[m]>
If the signed int bits end up matching the unsigned int bits we can just & with 0xffffffffL to get the unsigned value. If the calculation is actually off because it is signed then we may need to do the calculation with a long, or worst case a BigInteger
<headius[m]>
There are plenty of techniques out there for handling unsigned values in Java
<mariuszcwikla[m]>
long will be fine. In my PR you will see that "hash" method already uses long.
<mariuszcwikla[m]>
But "hash_old" (previous "hash") was using int.
<mariuszcwikla[m]>
Ok, I'll prepare fix tmr for this.
<headius[m]>
Excellent! Are you satisfied with your current pr?
<mariuszcwikla[m]>
yes, but 5 mins ago I found one issue. Here:
<mariuszcwikla[m]>
sha.update(bytes, 2, bytes.length - 2); //canonical form does not include leading SEQUENCE Tag-Length
<mariuszcwikla[m]>
assumption that tag is 1 byte and Length is 1 byte is wrong. Length may be coded in 4 bytes.
<mariuszcwikla[m]>
1-4 bytes
<mariuszcwikla[m]>
basically need to apply logic from org.bouncycastle.asn1.ASN1InputStream.readLength
<headius[m]>
Hmmm ok
<mariuszcwikla[m]>
Prob. rare case. I cross-checked my fix with Ruby on couple of cases + globalsign root r1 cert from issue #209 and it was all fine. Rare or not, it remains.
<boc_tothefuture[>
headius: I have narrowed it down to a set of scriptEngine.put items.
<headius[m]>
that would make sense
<boc_tothefuture[>
It loads a set of things for easy access.. but somehow in doing so causing a whole set of issues with the loadpath, access to others on the classpath, etc.
<boc_tothefuture[>
Which doesn't seem to impact Groovy, Jython or JS, but not playing well here.
<boc_tothefuture[>
I will try and see if its a specific item or just any item.
<headius[m]>
Could be a flaw in how we bind things or could just be that File binding screwing up a bunch of things (which would not be surprising)
<boc_tothefuture[>
Yep.. it explicitly sends in a mapping of "File" -> java.io.File
<headius[m]>
I figured it would be something like that
<boc_tothefuture[>
Is that something I can "unset" within ruby?
<headius[m]>
once it has been wiped out I'm not sure how to recover it
<headius[m]>
a hacky way is possible
<boc_tothefuture[>
ok, let me see if I remove File from the importPreset if everything else works, then I can raise a PR and see why we need to send file in.
<headius[m]>
yeah that would be best... it seems an odd thing to do in the binding and not just in the code that boots up each specific language
<boc_tothefuture[>
Thanks for all your help.. I will take a deeper dive here and see.
<headius[m]>
sounds good
ur5us has quit [Remote host closed the connection]
ur5us has joined #jruby
<lopex>
bleh
<lopex>
I was too fast merging that platform travis thingy
<lopex>
headius[m]: you were right too many ppl want credits for contribution
<lopex>
is that a fad now ?
<headius[m]>
I think it is just part of the ever-evolving landscape of OSS funding
<lopex>
I thought repo as my CV is a past thing
<lopex>
well, github
<headius[m]>
If I were in a position to make hiring decisions, I would frown upon someone with no GitHub profile whatsoever
<headius[m]>
Or rather by GitHub I mean any of the OSS hosting sites
<lopex>
right, but it cant go to extremes
<headius[m]>
It is always shocking when I find a tech colleague who has almost no OSS participation, not even bug reports
<headius[m]>
Right, I would not call it disqualifying but it gives a lot of insight into someone's technical ability and interest
<lopex[m]>
doh, why do I always land on irc these days
<headius[m]>
Well I am glad to see the bridge still works
<lopex[m]>
hey, do you know how well screen sharing works on matrix/jitsi now ?
<headius[m]>
I wish the gitter bridge worked better, if only so we could tell people not to use it when they pop in
<headius[m]>
I have never tried
<lopex[m]>
I heard gitter is merging with matrix ?