<GitHub135>
[jruby] eregon pushed 1 new commit to truffle-head: https://git.io/v12n0
<GitHub135>
jruby/truffle-head efb62cd Benoit Daloze: [Truffle] Simplify String#initialize and make it a primitive.
olle has quit [Ping timeout: 248 seconds]
olle has joined #jruby
thedarkone2 has joined #jruby
AckZ has quit []
donV has joined #jruby
olle has quit [Quit: olle]
<eregon>
ebarrett: Hello
<eregon>
ebarrett chrisseaton: I added a tag graal-vm-0.18 for jruby-build-pack
<eregon>
ebarrett: The tag in the jruby repo contains the wrong truffle version though, since it's overriden in the build process for GraalVM
<eregon>
You can build offline with: ./mvnw -Dtruffle.version=0.19 -Dmaven.repo.local=/path/to/jruby-build-pack/maven --offline package
tcrawley is now known as tcrawley-away
<eregon>
ebarrett: BTW, do you need changes in jruby-truffle? Otherwise using GraalVM's bin/ruby would be easier :)
<eregon>
If it's just something like CLOCK_MONOTONIC_RAW, we could easily add support for it (actually that particular one is already in as Process.clock_gettime(Process::CLOCK_MONOTONIC_RAW) )
AckZ has joined #jruby
<GitHub83>
[jruby] enebo closed issue #4344: Can't call a `Proc` which has a required keyword argument and a positional argument https://git.io/v1t5Q
<GitHub107>
[jruby] enebo closed issue #4308: New syntax errors in 2.3.1/2.3.2 tests. https://git.io/vX9z3
claudiuinberlin has quit []
<GitHub11>
[jruby] herwinw opened pull request #4368: Implemented Hash#compact and Hash#compact! (ruby-2.4...hash_compact) https://git.io/v121r
<headius>
nice
<GitHub26>
[jruby] headius pushed 2 new commits to ruby-2.4: https://git.io/v121N
<GitHub26>
jruby/ruby-2.4 b76218b Charles Oliver Nutter: Merge pull request #4368 from herwinw/hash_compact...
<GitHub26>
jruby/ruby-2.4 8d3cd0c Herwin Weststrate: Implemented Hash#compact and Hash#compact!...
shellac has quit [Quit: Computer has gone to sleep.]
herwin has joined #jruby
riddley has joined #jruby
<riddley>
Hi, I'm seeing some UTF-8 strings get mangled in Jruby and the web is ALIVE with "solutions." What's the best solution?
<Aethenelle>
mangled how? What's the evironment you're seeing this in?
bbrowning has quit [Quit: Leaving]
<riddley>
Aethenelle, I'm reading messaes off a Kafka queue and ü is coming out as ü
<riddley>
using jruby-kafka
<GitHub172>
[jruby] amarkowitz opened issue #4369: break within a block throws LocalJumpError in JRuby but succeeds in MRI Ruby https://git.io/v1aGf
<headius>
riddley: what versions of things?
<Aethenelle>
I get proper behavior in irb on the console in 9.1.6.0.....
<riddley>
headius, Jruby 9.1.5.0 and 2.2.2. of kafka-ruby and 0.8 of Kafka itself
<headius>
riddley: ok...sometimes that's our bug and sometimes it's some JRuby extension not handling encodings right
<headius>
you should report it with a way for us to reproduce
<Aethenelle>
my guess so far is that kafka-ruby is doing the mangling.
<headius>
do check 9.1.6.0 if you can
<headius>
Aethenelle: yeah likely
<headius>
we haven't had a major encoding issue in a long time
<riddley>
I've opened an issue with jruby-kafka, but so far the maintainer has been very slow to respond.
<Aethenelle>
every way I can think of that might result in mangling hasn't
<riddley>
ok thanks guys
<headius>
riddley: while you're waiting you could try to reduce down what it's doing and see if it's JRuby or not
<Aethenelle>
i forget, is kafka considered binary safe?
<headius>
keep us posted
<riddley>
I know nothing about Java, and the jruby-kafka is a very thin veneer on Java
<riddley>
headius, sadly I don't have the resources or time to re-create/reduce it... I was supposed to go production with my jruby-kafka based code yesterday when this issue was discovered so I'm in a bad spot
<riddley>
why my company chose to go production with Kafka 0.8 is baffling to me
claudiuinberlin has quit []
<headius>
riddley: well, open an issue with us anyway and maybe it will be something easy
<riddley>
ok will do ty
<Aethenelle>
riddley: what calls are you seeing this in?
<Aethenelle>
I have some time and can help chase this a bit
<riddley>
I've modified message = it.next.message.to_s to remove the call to #to_s
<riddley>
and when i write 'message' to a file with 'wb' I get those whacky chars
<riddley>
I'm hooking into a huge production system and the messages I'm consuming have NFS paths in them and when I call FileTest.exists?(path) it of course says no
<Aethenelle>
what happens if you leave the to_s there? same thing? Have you tried a pure Java write to file?
<riddley>
same thing. I don't know Java
<Aethenelle>
What do you see if you do: java.lang.System.out.println message
<Aethenelle>
to answer your question in that issue, open another issue for a separate problem... not my library, but it's a good default.
<riddley>
Aethenelle, I'm happy to try that (won't it say that local var 'java' isn't defined?) but the sad news is that it takes about 20 minutes to get a message through the system
<Aethenelle>
java, com, org, and possibly one other are automatic namespace/package resolver mechanisms... java.lang.System creates the proxy class Java::JavaLang::System
<riddley>
hmm so messages that don't have multi-byte characters printed with that java.lang.... look like [B@3b809870
<riddley>
is that expected?
<Aethenelle>
what class is message?
<Aethenelle>
byte[] ?
<riddley>
the strings are about 1k JSON. earlier when I did 'pp message.class' it said #<Class:0x4e3f1bba>
<riddley>
but I can do something else if that's the wrong thing to do
<Aethenelle>
lopex: yes but when passing eeither of those results back to System.out.println, you get the mangled char
<Aethenelle>
riddley: you're seeing these mangled chars in the resque queues?
<lopex>
Aethenelle: maybe external encoding is not being set ?
<lopex>
Aethenelle: or, still it breaks at JI
<riddley>
Aethenelle, seeing them anywhere I try to use those strings. even File.open('/tmp/bobo','wb'){|f| f.write(message)}
<Aethenelle>
lopex: maybe... there's definitely at least some wacky interaction between the ruby string in BINARY and the UTF-16 that Java uses internally
<lopex>
ruby -> java definitely needs an encoding info
<Aethenelle>
riddley: can you add: puts [message.length, message.to_a.size, message.to_s.bytesize].inspect
<riddley>
this is something I'm not doing with magic comments or somethign?
<Aethenelle>
preferably as soon as you get the thing in your callback
<riddley>
do you want that on any message? or just messages with multi-bytes?
<Aethenelle>
riddley: this is an irritating edge case either in kafka or jruby string handling
<riddley>
multibyte chars*
<Aethenelle>
multibyte chars
<riddley>
ok, it'll be minute
<riddley>
I have to request a support pack from a customer appliance from a customer with multi-byte chars in their name
<riddley>
and that takes a bit
<riddley>
the excitement of coding to a production system
<Aethenelle>
riddley: you mean you don't have a staging system to test this against?
<riddley>
Aethenelle, good joke :)
<Aethenelle>
ouch
shellac has quit [Quit: Computer has gone to sleep.]
<headius>
default logic seems wrong...uses default encoding in ByteList, so that's ASCII-8BIT
<riddley>
it seems hung up again with message = java.lang.String.new(it.next.message, "utf-8")
<lopex>
headius: yeah
<Aethenelle>
riddley: how compatible is that with 0.8.2?
<lopex>
headius: but the right logic should do what ?
<lopex>
headius: also look at java external ?
<lopex>
headius: since java does it
<headius>
file.encoding probably
<headius>
yeah
<headius>
external
<lopex>
right
<riddley>
Aethenelle, sorry I missed the detail of the trailing .0 we may very well be running 0.8.2 -- when I asked the devs, they weren't very specific
shellac has quit [Quit: Computer has gone to sleep.]
<headius>
that's all it does
<headius>
if it's an Encoding it uses it, otherwise it looks it up as a string
<lopex>
yes
<riddley>
works fine with the string
<lopex>
no loops there
<riddley>
but still shows the wrong characters
<lopex>
and no exception
<lopex>
er, actually, what the reduced case now ?
<riddley>
I'm new to jruby, so I don't know how to run it in some way that shows exceptions, but it doesn't crash in either case... with the constant it just sits there
<lopex>
we just need to reduce it properly
<lopex>
w/o kafka
<headius>
yeah
<headius>
or with kafka and complete instructions on how to set it up :-D
<riddley>
that's with message.to_s.force_encoding(Encoding::UTF8)
<riddley>
fixing it up to add the _ it works just fine
<riddley>
(in that it doesn't appear to hang)
<riddley>
but if it really is just the same thing as the string "UTF-8" being handed to force_encoding, I knew that didn't work before I asked for help