ur5us has quit [Ping timeout: 250 seconds]
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #jruby
ur5us has joined #jruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #jruby
victori has quit [Client Quit]
victori has joined #jruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #jruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #jruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #jruby
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #jruby
victori has quit [Read error: Connection reset by peer]
victori has joined #jruby
sagax has quit [Quit: Konversation terminated!]
ur5us_ has joined #jruby
ur5us has quit [Ping timeout: 250 seconds]
ur5us_ has quit [Ping timeout: 240 seconds]
ur5us_ has joined #jruby
ur5us_ has quit [Ping timeout: 258 seconds]
drbobbeaty has quit [Ping timeout: 246 seconds]
drbobbeaty has joined #jruby
<headius[m]> ok so the ProcessBuilder approach seems like the best option... need to decide if we can drop the native popen3 and also just use ProcessBuilder for that
<headius[m]> I am leaning toward ditching all of our hacked-together logic to make Process and the crappy IO streams it gives us work right... we should just fall back to using them as is and if you want proper functionality you need native support
<headius[m]> i.e. I want to delete ShellLauncher this year
<headius[m]> or strip it down to just a minimal ProcessBuilder wrapper
victori has quit [Ping timeout: 260 seconds]
<headius[m]> enebo: I will push a PR for this shortly... trying to keep this change minimal but these methods did not work at all without native process support
victori has joined #jruby
<headius[m]> darn, all the open3 tests themselves require native file descriptors
<chrisseaton[m]> Does anyone know why Concurrent Ruby bundles `ConcurrentHashMap`? And multiple versions? https://github.com/ruby-concurrency/concurrent-ruby/tree/a5076bf9e977b290cce5a65b7b72810562bca295/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e
<headius[m]> one of those is an interface, the other is the Java 8 version of CHM which does not require setting a concurrency level
<headius[m]> I assume it was included because prior to Java 8, not specifying a low concurrency level would default to # of cores and end up very large in memory
<headius[m]> ah I see what you mean
<headius[m]> Unsafe is being deprecated and removed bit by bit in newer JDKs
<chrisseaton[m]> Ah and this code lives outside the safe bubble as it's been removed from the core.
<headius[m]> I don't know how concurrent-ruby decides to use one or the other
<headius[m]> well, this is public domain code that was implemented outside JDK, but it used Unsafe to avoid the overhead of AtomicReferenceFieldUpdater
<chrisseaton[m]> I was amazed the other day - I was looking into optimising field reads and writes done via unsafe, and the JIT actually turns unsafe reads and writes on objects back into normal field accesses if it can!
<headius[m]> all Unsafe methods are intrinsics on Hotspot and I assume other VMs
<chrisseaton[m]> So for example using unsafe on an object does not stop it being scalar replaced
<headius[m]> ah, sure... I would hope not
<headius[m]> ironically it probably helps escape analysis because it will skip access checks and other branches that confound the simple EA in hotspot
<headius[m]> enebo: so I am running open3 tests with this non-native impl and making pretty good progress
<headius[m]> we may want to start introducing some targeted non-native test runs
<enebo[m]> headius: yeah
<headius[m]> I think I am down to one failure and two hangs but I am rerunning the hangs because other fixes might have resolved them
<headius[m]> ah yes... so the two that hang require passing a file descriptor through to the process launch, which we obviously can't do with Java ProcessBuilder
<headius[m]> so they might pass if not for that
<headius[m]> so
<headius[m]> Finished tests in 88.472445s, 0.3052 tests/s, 1.8537 assertions/s.
<headius[m]> 27 tests, 164 assertions, 1 failures, 0 errors, 0 skips
<headius[m]> with two excluded
<headius[m]> I am pretty amazed
<enebo[m]> nice!
<headius[m]> people asked us to get these methods working years ago... many years
<headius[m]> now I feel bad that I didn't attempt it
<headius[m]> I just assumed it would never work well enough with Process's buffered pipes and such
<enebo[m]> yeah process has been a nightmare in general too
<headius[m]> so my big fix here was realizing that Channels.newChannel(outputStream) does not flush the stream
<headius[m]> which seems like a freaking giant bug since Channels are supposed to be unbuffered
<headius[m]> enebo: so I got the last one to pass but it was due to being unable to unwrap Process to get the pid... we would need to add-opens for java.lang for that and that would need some discussion
<enebo[m]> I am half suprised that is not on the list already
<headius[m]> I was too but I vaguely remember being afraid to open that one up
<headius[m]> I can open an issue for that and we can debate it but I think we need to have a better grip on module visibility before then
<headius[m]> e.g. currently calls from Ruby look like calls from jruby.dist so they gain our add-opens
<headius[m]> it would not be difficult to assign them their own runtime module but some finesse would be needed to keep reflective calls we want to work, working
<headius[m]> I have a gaggle of commits landing momentarily
<enebo[m]> ah I see
<headius[m]> additional fixes have been pushed there
<headius[m]> I don't think there is any rush on this until someone reports that they are having issues with native gem installs on Windows
<enebo[m]> yeah I guess we can figure out how we can harden this so we can include it onto 9.2
<enebo[m]> Not sure how to deal with these sorts of issues because sassc obviously will take ot 9.2 from the windows build matrix
<enebo[m]> but I would hate to break other stuff
<headius[m]> so the open3 changes are pretty low risk... they would have just been hard failures before
<headius[m]> I do flip popen3 to using the new logic but it passes more open3 tests as well
<headius[m]> so the other possibly concerning change would be the new "SyncOutputStreamChannel" where we used the JDK's broken one before
<headius[m]> we should talk through this PR though when you get a chance
<headius[m]> enebo: open3 PR is basically ready... I am bringing up my Windows VM to test that sassc installs ok
<enebo[m]> coolio
<headius[m]> I suppose I should have make installed
<headius[m]> success!
<headius[m]> enebo: I am making one additional change, making this overlay the open3 in stdlib with just the pieces it replaces
<headius[m]> should be zero-sum
<enebo[m]> so the comment changes and stuff to windows_open3 is that you applying some other ruby code?
<headius[m]> it was me updating the copied impls from open3 to open3_windows but now I am just removing anything that is duplicated
<headius[m]> so it will load the default open3.rb and then if on Windows it will load open3_windows to patch over the popen methods
<headius[m]> that is sufficient to get it working
<headius[m]> enebo: I have pushed the change, should reduce the overall diff
<enebo[m]> ok
<headius[m]> oh wait, did not push, one sec
<headius[m]> had to double check passing
<headius[m]> enebo: ok really there now
<headius[m]> come at me
<headius[m]> ahh one thing about this PR... the ShellLauncher changes are good but do not fix anything in here now
<headius[m]> because the open3 popen methods have all been replaced that fix is no longer needed... could be removed but it adds leading env hash support to some non-native process spawns
<headius[m]> it just wasn't sufficient to fix the problem
<enebo[m]> someone pointed out a flush is not needed if 0 bytes are written which may not really be worth it or we are guaranteed to get >0?
<headius[m]> I am on the fence having just dealt with Ruby IO wrappers that lie about how many bytes were written
<headius[m]> only things I can think of that would be a problem would be any locking or overhead from flushing that could be avoided
<headius[m]> but one of my arguments to core-libs-dev was also that this flush adds immediacy to any errors the underlying IO would raise, so that is argument for always flushing
<enebo[m]> environment = builder.environment
<enebo[m]> env.each { |k, v| v.nil? ? environment.remove(k) : environment.put(k, v) }
<enebo[m]> This is because builder will have an existing env from our internal process but the env will essentially merge with it
<headius[m]> this is because of ProcessBuilder API... the way to set env is to get env and then modify it
<headius[m]> it is not a good API
<enebo[m]> ok
<enebo[m]> I don't actually find the mandatory flush to be a significant issue other than perhaps MRI will not flush as much
<headius[m]> well in MRI these would be direct sync IOs so I have to emulate that much
<headius[m]> they do not flush but they do not buffer
<enebo[m]> haha ok well year if it isn't buffered then flushing is pretty needed
<enebo[m]> ok yeah I am not seeing much more here and it looks like an improvement but it is a fair amount of code
<enebo[m]> The fact it fixes the problem on windows and some more stuff works is great
<enebo[m]> but other OSes will experience some of this code right? The ShellLauncher changes
<enebo[m]> and WritableChannel
<headius[m]> heh I guess that did not reduce diff because I deleted a bunch
<headius[m]> look at open3_windows alone and you will see it better
<enebo[m]> well it is still a helpful diff this way
<enebo[m]> it is pretty clear even with the massive emptiness what is happening now
<headius[m]> the open3_windows file was originally used on all platforms but then once Windows was the only one without native processes it got copied over
<headius[m]> so this tidies that up and makes it a simple overlay
<enebo[m]> Other than evaluating non-Windows Channel change I don't see any issue
<enebo[m]> I can hit windows a bit too before release to find issues there
rtyler has joined #jruby
<rtyler> Greetings again friends, I'm having trouble formulating a search query here, but I wonder if there's an environment variable I can pass to a Java process which is running JRuby to execute a referenceed .rb file
<rtyler> almost like a LD_PRELOAD type of deal
<headius[m]> rtyler: hey ltns
<headius[m]> I think we might have something like that
<headius[m]> execute as in $0?
<headius[m]> because requires should honor the usual load path env vars
<headius[m]> dunno why we didn't make this property-customizable but if you can use that name it will pick up the file anywhere in classpath
<rtyler> the name being JAR_BOOTSTRAP?
<headius[m]> jar-bootstrap.rb
<headius[m]> a PR to make this customizable might get released some day
<rtyler> ah
<headius[m]> ahorek: 👍
<rtyler> no quite
<headius[m]> rtyler: other than that I think the other option is going to be JRUBY_OPTS or similar to add -r flags
<headius[m]> without adding something that is
<rtyler> let's see what I can do here with this tool
<rtyler> headius[m]: the jar-bootstrap.rb is only going to work if I can override the main entrypoint for the jar I'm working with though won't it?
<headius[m]> or specify it at some command line, yeah
<headius[m]> this was added primarily for creating executable jars that include a main script
<rtyler> yes, I recall some projects vaguely using this ;)
<headius[m]> I don't think there is another way to force Main to run a specific script
<headius[m]> this could be expanded to support an env or property easily enough but as I say that will trickle down...someday
<headius[m]> enebo: so do I have your approval on that PR? ahorek found a minor issue that I fixed (require 'jruby') and it should be green shortly
<rtyler> I think I might be screwed, because this code is hiding behind Asciidoctor4j too
<rtyler> JRuby is way way way down there
<headius[m]> ah yeah that is deep
<headius[m]> it may honor JRUBY_OPTS or it may not
<rtyler> not as far as I can tell :/
<headius[m]> well poo on that
<rtyler> indeed
<headius[m]> hmmm
<headius[m]> bool(CLI, "cli.rubyopt.enable", true, "Enable/disable RUBYOPT processing at start.")
<headius[m]> I wonder if that have that turned off, and you could use RUBYOPT
<headius[m]> I mean if you turn it on or they don't disable it
<headius[m]> they could certainly be scrubbing env and props though before launching
<headius[m]> enebo: GREEN
<rtyler> I think I'm going to just have to be mad and write some Java code here
ur5us_ has joined #jruby
<headius[m]> hah
<enebo[m]> headius: yeah it is fine by me
<enebo[m]> I will try some windows stuff before next point release too
<headius[m]> ok
<headius[m]> merged
<headius[m]> enebo: with that there are no open items for .18
<enebo[m]> fantastic
<headius[m]> I am returning to 9.3 close-outs
<enebo[m]> I have feelings other things may pop up but we are getting to a trickle hopefully
<headius[m]> hah I sorted 9.3 items by least recently updated and guess what is first on that list
<headius[m]> unsure if we want to attempt to shove this unstarted work in
<headius[m]> the open3 PR does make part of this less urgent
<headius[m]> enebo: perhaps tomorrow we can talk through the remaining items
<headius[m]> byteit101 PR is still out there too but close to finished
<enebo[m]> yeah that sounds good
<enebo[m]> we are close
<headius[m]> yeah very
<headius[m]> some sticky items remain but close
travis-ci has joined #jruby
<travis-ci> jruby/jruby (jruby-9.2:9ec662d by Charles Oliver Nutter): The build is still failing. https://travis-ci.com/jruby/jruby/builds/222331906 [171 min 33 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> byteit101: pinging you here shortly, you have have comments on the Java subclass "leak": https://github.com/jruby/jruby/issues/5143
<byteit101[m]> Oh yay!
<headius[m]> may have
<byteit101[m]> Yes, I changed how it works, but still static references as you though it was fine. Can change if necessary
rtyler1 has joined #jruby
rtyler has left #jruby ["WeeChat 3.0"]
<headius[m]> I think it is ok until we get a report about it. Has not changed substantially in many years
<headius[m]> 90 issues and 30 PRs open for 9.3, gonna be a long week
<headius[m]> I am tossing this because MRI backed off reverse traces and I never like them
<headius[m]> jeremyevans: you said reverse backtraces were reverted here but the referenced hash does not seem to do that... do you have a better link? https://bugs.ruby-lang.org/issues/14558
<byteit101[m]> when testing the interface inheritance, it "works" until I new it after reification, then I get exciting errors: Java::JavaLang::ClassCastException (org.jruby.RubyModule$INVOKER$i$0$0$initialize cannot be cast to org.jruby.internal.runtime.AbstractIRMethod)
<byteit101[m]> I am impressed it got that far though, I think "new" is not the right new
<byteit101[m]> Will investigate later though, gotta run in 3 min
<jeremyevans> headius[m]: 487d0c99d53208594702bb3ce1c657130fb8d65f
<jeremyevans> sorry about that, I'll update the ticket
<headius[m]> great thank you