CargoBuilder JRuby support
rb_sys/mkmf can be used to compile not only rb_sys-based gems, but any gem that contains Rust code. I've found it useful to compile rust code used in JRuby through JNI, but it can also be used to compile Rust libraries called through FFI in both MRI and JRuby. However, I needed to make a small patch to make it compile on JRuby. So, the question is: would you accept a PR with these changes? It actually can require more patches as I only tested them on Ubuntu, dynamically linked Ruby 3.2.
I’m not opposed to the idea, the patch is hard to review though. If you can make a prototype PR with the code that would be great! If that looks solid, we can polish it up to ship.
I need your help, I updated oxi-test gem to work with jruby for rb-sys CI tests, but env preparation fails and I don't understand why.
UPD: Just cargo-binstall action doesn't work on jruby
I tried to debug:
File.write 'tmp1', response.body.bytes.inspect
File.write 'tmp2', pipe_command("#{RbConfig.ruby} -e 'puts STDIN.read.bytes.inspect'", stdin: response.body)
and appears it can't handle long stdins:
3.0.2 :002 > arr1 = eval(File.read 'tmp1'); nil
=> nil
3.0.2 :003 > arr2 = eval(File.read 'tmp2'); nil
3.0.2 :006 > arr1.size
=> 6290974
3.0.2 :007 > arr2.size
=> 98304
3.0.2 :010 > arr1[0...arr2.size] == arr2
=> true
And this problem reproduces only from time to time