ur5us has joined #jruby
<headius[m]> ahorek: sorry we hijacked your PR for a spec debate
ur5us_ has joined #jruby
ur5us has quit [Ping timeout: 260 seconds]
jeremyevans has quit [Ping timeout: 265 seconds]
ur5us_ has quit [Ping timeout: 240 seconds]
jeremyevans has joined #jruby
<ahorek[m]> <headius[m] "ahorek: sorry we hijacked your P"> no problem at all 🙂
ur5us_ has joined #jruby
<headius[m]> 👍
nakilon has joined #jruby
<nakilon> hello
<headius[m]> Greetings
<nakilon> I'm trying to shrink the .jar file created by the warbler gem -- I'm removing some files one by one to reduce the size from 27 to 17 MB already, but I don't know how to understand what some files are for
<nakilon> for example, org/jruby/ext/ripper/YyTables.class and org/jruby/parser/YyTables.class -- is it something vital?
ur5us_ has quit [Remote host closed the connection]
ur5us_ has joined #jruby
ur5us_ has quit [Remote host closed the connection]
<headius[m]> Things under the ext dir can go unused and aren't loaded unless requested... So if app works without it you are probably ok
<headius[m]> bigdecimal is a notable exception
<headius[m]> Outside of that it gets muddy
<headius[m]> I am sure the parser uses the yytables for loading code
<headius[m]> I do wonder if those could be compiled better to not use so much room
<nakilon> removed jline with no idea if I need it; seems ok
<nakilon> there is something about asm: com/kenai/jnr/x86asm/SerializerIntrinsics.class and jnr/x86asm/SerializerIntrinsics.class
kares[m] has quit [Quit: Idle for 30+ days]
<nakilon> alright, I broke it finally ) ERROR: java.lang.reflect.InvocationTargetException
<nakilon> seems like org/jruby/ir/IRBuilder.class is vital but from the name I could only suppose it's about IRB
<headius[m]> Jline is for readline support at console, like in irb
<headius[m]> Haha
<headius[m]> Yeah no, Intermediate Representation Builder
<headius[m]> Turns parsed code into our compiler IR
<nakilon> I would automatically run the whole test suite of mine after each big file deletion but java -jar starts so slow it would take ages
<nakilon> removed a bunch of rdoc and even ttf files so the largest files now are these: https://dpaste.org/DwU3
<nakilon> resulting jar is 15MB but I need 10MB, hope is disappearing
<headius[m]> Hmmm
<headius[m]> 10 is pretty small
<headius[m]> There are told you can run to strip debug symbols and such from the jar
<headius[m]> Zopfli my be able to shrink it more
<headius[m]> It might be disable
<headius[m]> Ugh I mean it might be doable
<headius[m]> bbl
<nakilon> $ brew search advzip
<nakilon> Error: No formulae or casks found for "advzip".
<nakilon> oh there is zopfli formula
<headius[m]> Huh I think I just ran zoplfi
<headius[m]> Ah yeah
<nakilon> saved only 50kb
<headius[m]> Drat
<nakilon> I wonder if it's possible to split one jar into two jars
drbobbeaty has quit [Read error: No route to host]
drbobbeaty has joined #jruby
havenwood has quit [Quit: ZNC - https://znc.in]
havenwood has joined #jruby
havenwood has joined #jruby
<Freaky> headius[m]: Dir.each_child second argument appears to expect an Encoding rather than a keyword
<Freaky> didn't Dir.entries used to do that?
<headius[m]> Freaky: ahh looks like we missed that one
<headius[m]> might be worth looking at specs and tests to see if we are skipping some we should implement
<headius[m]> yeah how odd
<Freaky> I have a broken test for encoding on JRuby, come to think of it
<headius[m]> looks like neither the Ruby specs nor the CRuby test suite covers this keyword
<headius[m]> at least for each_child
<Freaky> it doesn't appear to actually *do* anything :)
<Freaky> or does it, this output sucks, yeah I'll just manually diff this giant single line by sight shall I minitest
<headius[m]> haha
<Freaky> yeah, think it's always returning UTF-8 paths despite the encoding parameter
<headius[m]> yeah so looks like we punted because a contrib was doing something and then that work never materialized
<headius[m]> gotta love oss
<headius[m]> hmm might be improved on master for 9.3, I did some work recently on Dir encoding stuff
<headius[m]> master does not have the keyword logic though, I can confirm that
<enebo[m]> Freaky: Last night I started moving frmo String to OsString. As you say some of it is finicky and some parts are pretty transparent
<headius[m]> there are some dir encoding tests that weren't running right and we mostly don't pass them
<headius[m]> but this at least aligns the acquisition of the encoding across those methods
<headius[m]> lots of copypasta in there
<headius[m]> enebo: hey did you see what I mentioned yesterday about moving snapshot deploys to GHA
<headius[m]> both master and 9.2 have that weird error now
<enebo[m]> headius: yeah I am happy to move everything to GHA since I do not expect travis to stick around much longer
<enebo[m]> I just don't know how that changes overall run times of stuff
<headius[m]> actually I'm wrong I guess master doesn't have it
<headius[m]> maybe some maven plugin got upgrade on master that fixed it
<headius[m]> I will poke at it a bit today then
<enebo[m]> my brain has spaced this out but I don't recall whether we figured out the travis 9.2 issue from the other week
<enebo[m]> On my machine deploy did not work with the racc gem reversal
<enebo[m]> Although it was not the same error as travis
<enebo[m]> I am doing the parsing work we talked about yesterday
<Freaky> headius[m]: \o/
<enebo[m]> It will take more than a day. A lot of small changes
<Freaky> enebo[m]: os_str_bytes might be of use if you need to portably poke at them
<enebo[m]> Freaky: ah yeah that might be way better than using lossy...but I only spent a few minutes last night
<headius[m]> enebo: so you still can't do a release or deploy of 9.2 right now?
<headius[m]> I think you were going to try a clean clone
<Freaky> enebo[m]: I threw https://gist.github.com/Freaky/b33547d80102a55c5f665c2a4355be6b together a while back for clap, though it didn't end up being used
<enebo[m]> Freaky: At arg processing all we really care about is comparing the front as ascii and I was concerned bytes with wide string would not be comparable
<headius[m]> the error on Travis makes no sense... can't fine ScriptingEngine or somesuch
<headius[m]> find
<enebo[m]> Freaky: so I thought using lossy would work well for that but then I still need the bytes after the key
<Freaky> enebo[m]: yeah, you could use the lossy function to find the index given you know the prefix is all bytes, but then you'd want to go via encode_wide/from_wide if it doesn't convert
<enebo[m]> UCS2/UTF16-LE is like '\0a\0b\0c' right?
<enebo[m]> I can make the string I am comparing into a wide one I guess
<enebo[m]> Freaky: anyways I will look at that code and I know it will help me to better grok how to handle this
<Freaky> I think os_str_bytes works much the same as my code there
<enebo[m]> yeah if it just gives back the raw bytes I am sure
<Freaky> if it can be represented as utf-8, it does that, if it's unix it can convert to raw bytes, and it only has to make an owned wide Vec<u16> on Windows if it's some weird encoding
<enebo[m]> but I don't think I know if on windows I will see A or W from a console will I?
<enebo[m]> ah ok
<enebo[m]> perfect
<enebo[m]> I just want ascii when it is and not ascii if it isn't and to keep the value part of OsString
<enebo[m]> Rust is pretty well thought out but I found this initial should I use String or OsString difficult because you cannot just use OsString and get the same level of utility as String
<enebo[m]> That makes sense but it definitely influenced me down the simpler path at first (realizing in the back of my mind I would end up having to change it)
<Freaky> yeah, it can certainly be fiddly
<Freaky> clap was using unsafe code and making assumptions about storage
<Freaky> transmute to bytes, assume it's WTF-8 on Windows
<Freaky> dodgy thing for such a big part of the ecosystem to be doing :)
<enebo[m]> In retrospect I liked my instincts because I got something working with Strings I suspect faster than I would have been yakking on the OsString version
<enebo[m]> yeah
<enebo[m]> In Rust's defense it evolves over poor use cases and generally eventually fixes them. Some internal unsafe code perhaps won't always be
<Freaky> get there eventually
<enebo[m]> Freaky: yeah. It is fun to see how the process plays out
<enebo[m]> Freaky: I plan on using Xargo for linux build with musl but the RFC side of what that can do is nowhere near it and probably won't be for years :|
<Freaky> not familiar with xargo or building with musl
<Freaky> does it not just work with the appropriate target?
<enebo[m]> Freaky: oh it works but musl means no linking to libc and xargo will generate 100k vs 300k binary
<enebo[m]> Xargo will conditionally compile in std so it omits things not used
<headius[m]> We don't want to require that users have rust set up so we want to ship binaries for a number of platforms in the gem
<headius[m]> The smaller the better
<enebo[m]> There is some partial support for this in nightly but it does not really make a big difference
<enebo[m]> headius: although even the stripped 300k binary x 3 (linux/macos) + windows 200k is smaller than our existing jruby.exe (much less jrubyw.exe and jruby.dll) which are all about 900k a piece
<enebo[m]> err x2
<Freaky> enebo[m]: significantly more effective than LTO?
<enebo[m]> yeah the 300k is with LTO and a couple of other options
<enebo[m]> xargo is doing all of that and grabbing source of std
<Freaky> opt-level = s, codegen-units = 1, debug = false, panic = abort I guess
<enebo[m]> opt-level = z
<enebo[m]> codegen-units = 1
<enebo[m]> and yeah abort
<enebo[m]> There are crazier levels to take it but at this point I will have 100k + 300k + 200k as the three platform binaries
<enebo[m]> later we can add *BSDs but it is a bit of a pain to setup and I got tired of messing with GHA
<enebo[m]> and archs
<enebo[m]> It might be 200k * 2 for windows for jrubyw.exe but I think I can do argv0 sort of compare on name and have it just launch as windows config
<enebo[m]> if it is jrubyw.exe
<headius[m]> that would be really nice
<headius[m]> jrubyw.exe and jruby.exe will share code in a dll or what?
<headius[m]> enebo: ^
<enebo[m]> headius: they will be the same excutable copied as different named files
<headius[m]> copied on install
<enebo[m]> yeah
<headius[m]> ok cool
<enebo[m]> I cannot remember what the program was but an ancient unix utility used to work this way
<headius[m]> well bash does this to switch to sh emulation
<enebo[m]> thanks this will bug me all day now :)
<headius[m]> so that's one example
<enebo[m]> yeah sh does do that too ... it is not what I was thinking of
<enebo[m]> It was something which sent in one command and recieved in another
<enebo[m]> my brain cannot remember what I am thinking of uucp?
<headius[m]> hmm beats me
<enebo[m]> oh what are some old revision control systems
<enebo[m]> rcs?
<enebo[m]> AHA!
<enebo[m]> ci and co of RCS worked like this
<enebo[m]> I think that was it
<enebo[m]> I think I discovered this by accident by cp'ing one to another name and it started doing the other action
<enebo[m]> It blew my mind when I realized how it worked (mind you this was in the 80s :) )
drbobbeaty has quit [Read error: Connection reset by peer]
drbobbeaty has joined #jruby
<headius[m]> wow weird
<headius[m]> I did not know that
<headius[m]> I started with cvs
drbobbeaty has quit [Ping timeout: 276 seconds]