lopex has quit [Quit: Connection closed for inactivity]
mkristian has joined #jruby
lopex has joined #jruby
claudiuinberlin has joined #jruby
shellac has joined #jruby
drbobbeaty has joined #jruby
<kares> enebo: think I nailed down why (arg1), (arg1, arg2) method root-ing isn't working properly
<kares> its an edge case but we've hit it previously with AR-JDBC and simply ignored it - so this is the second time
<kares> reproducable from the following case, suppose I have 4 methods: (arg1), (arg1, arg2), (arg1, arg2, arg3) and (arg[])
<kares> interpreter properly handles (arg1) and (1, 2) but not (1, 2, 3) - it will always route through (arg[])
<kares> this has been working in 1.7 I believe the IR interpreter needs a ThreeOperandArg instr
<kares> is there any reason why it was left-out?
<kares> guess the 3 args cases supported in native methods always goes through allocating an IRubyObject[]
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ebarrett has joined #jruby
drbobbeaty has joined #jruby
rdubya1 has quit [Quit: Leaving.]
rdubya has joined #jruby
mkristian has quit [Quit: This computer has gone to sleep]
Puffball has joined #jruby
mila has joined #jruby
<mila> what does JRUBY_OPTS='--1.9' or JRUBY_OPTS='--2.0' do?
Puffball has quit [Quit: Puffball]
Puffball has joined #jruby
<nirvdrum> mila: Those are old options from JRuby 1.7.x that allow changing out the Ruby compatibility level.
<nirvdrum> They don't do anything with JRuby 9.x.
<nirvdrum> Since 9.x only supports a single version of the Ruby runtime.
mkristian has joined #jruby
mila has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
<enebo> lopex: hey 'character class has duplicated range' you know where a message like that comes from?
<lopex> enebo: yeah
<enebo> lopex: Saw like 6 of them running some basic rails testing on windows
<lopex> enebo: we need the warn callback to be more -w aware
<enebo> lopex: neither of the commands I saw those for were with -w nor -v enabled
<lopex> enebo: I know
<enebo> lopex: maybe MRI does the same thing?
<lopex> enebo: you see two part of that condition ?
<lopex> two parts
<lopex> onig_warn == onig_null_warn || !RTEST(ruby_verbose)
<enebo> yeah
<enebo> I love how !RTEST is true in their C
<enebo> I get it too but it always messes my head up when I see it
<enebo> oh wait I am misreading even this :)
<lopex> enebo: there's onig_set_warn_func(re_warn); in re.c
<lopex> maybe we miss that ?
<enebo> I don't know
<lopex> actually it's more complex
<enebo> I think this if is weird
<lopex> for example \X will always have duplicated range (due to the data they use)
<lopex> so we need to silence that
<lopex> it's all weird
<enebo> lopex: so do you think you can repro this...I don't actually know why it is happening
<lopex> enebo: we have two cases
<lopex> enebo: one is ruby -W2 -e '/[aa]/
<lopex> enebo: another is ruby -W2 -e '/\X/'
<lopex> the second one needs to be silences
<lopex> silenced
<enebo> yeah this is a blocker for 9.1.16.0 now since we will get this reported immediately
<enebo> and sonatype is mega mega mega slow today
<enebo> took like 1.5 hours to upload to staging (and a close on repo has been going for like an hour now)
<enebo> jruby -e '"A" =~ /\X/'
<enebo> I just did this to see difference
<enebo> if you omit the string for the regexp is just warns on no result and not the mismatched char type
<lopex> and not during parse since Regexp.new("\\X") is silent on mri too
<lopex> what ?
<lopex> why jruby -e "/\X/" is silent ?
<lopex> and [aa] is not ?
<lopex> now I'm confused
<enebo> mri23 -e '"A" =~ /[aa]/'
<enebo> this is silent
<enebo> -W2 changes it for [aa]
<enebo> but not for \X
<enebo> with or without -W2 MRI will not warn on \X
<lopex> yeah
<enebo> [aa] sort of makes sense it would
<lopex> \X internally duplicates too
<enebo> lopex: ah so maybe internal duplication is not warned
<lopex> yes
<enebo> lopex: since the programmer did not actually do it
<lopex> and I am condused how
<lopex> yes yes
<lopex> but how
<enebo> heh yeah
<enebo> how indeed
<lopex> let me reproduce that intenal on onigmo again
<lopex> git df
<lopex> er
<lopex> YEAH
<lopex> or not ?
<enebo> lopex: holy crap
<lopex> no it's to_s
<enebo> lopex: if that is it then that scares the crap out of me :)
<enebo> rando global symbol toggles :)
<lopex> yep
<lopex> but it's to_s so it's not our case
<enebo> If they do that somewhere else (since they do it here) then we may need something a bit more sophisticated than just porting logic
<lopex> enebo: and same thing for encoding loading
<lopex> enebo: just grep for ruby_verbose =
<lopex> enebo: CC_DUP_WARN is called 18 times for \X in onigmo
<enebo> afk a few minutes...brb
<lopex> enebo: it must be if (onig_warn == onig_null_warn || !RTEST(ruby_verbose)) return ; then
<lopex> enebo: and they default to rb_warn("%s", s);
<lopex> but I still dont get itt
mkristian has quit [Quit: This computer has gone to sleep]
mkristian has joined #jruby
mkristian has quit [Client Quit]
<enebo> hmm
<enebo> lopex: so I have two comments
<enebo> lopex: we can see this warning happen and we can make changes to our code to not display in the cases we can observe. If they are doing stuff like to_s we probably have to do it a different way.
<enebo> lopex: unfortunately, just fixing the observable cases we know about might not be enough to know if we fixed the problem completely
<lopex> enebo: no no, I said they do use verbose in to_s but it's not our case
<enebo> lopex: I know. I am just saying if they do that in one place they may do it in others
<lopex> enebo: I searched the code
<lopex> only two places except setting options
<enebo> lopex: so it was only one place then and not our case
<enebo> ok
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<lopex> well, that's just a trail
<lopex> and it's already insane
<enebo> does pattern warning call this method?
<lopex> but it still doesnt explain the difference between [aa] and \X
<lopex> onig_syntax_warn ?
<enebo> I looked at where ccDuplicateWarn is called I don't see how [aa] and \X could be differentiated
<enebo> I mean the places where it calls it \X must have already been duplicated
<lopex> enebo: it's the only place for me
<lopex> but afaik I've already checked that
<lopex> and it is a difference
<lopex> since [aa] uses bitset
<lopex> and \X uses code range
<lopex> and there's two warning paths for them
<enebo> lopex: ok so if from this place where \X is processed we can suppress the warning we might be ok
<enebo> which cannot be a static field or n threads might get confused but we probably need some out of band field that our warn method can look at to ignore if the field is set
<enebo> (OR pass something down the callstack as method params)
<enebo> lopex: so is our equivalent code anything in CodeRangeBuffer?
<lopex> enebo: and CClassNode
<lopex> enebo: but I'm still confused since onigmo calls that dup check function
<lopex> for \X
<enebo> lopex: you're confused because MRI never warns for that case
<enebo> lopex: so why have C call some warn function?
<lopex> no idea
<enebo> I have to say if we cannot figure this out easily I think our workaround is to disable this warning altogether
<enebo> I do not think it is likely to be an important warning
<enebo> but with that said it would be nice to give the warning at the same time MRI does
shellac has quit [Quit: Leaving]
<enebo> [aa] does just work anyways...it is not invalid
<ChrisBr> enebo: java question -> do you have a "simple" idea how to dry these two functions https://gist.github.com/ChrisBr/1856b76b25d3663c2819bfbd37a3dc49 (only difference is the if start vs end and the beginning character for the substring call)
claudiuinberlin has joined #jruby
<GitHub80> [jruby] ChrisBr opened pull request #5055: [ruby-2.5] Implement String#delete_suffix (ruby-2.5...ruby25/delete_suffix) https://git.io/vABfI
<enebo> ChrisBr: I think you can RubyString prefix = arg.convertToString() and get rid of a few lines
<enebo> ChrisBr: I think if you get rid of those three lines the DRY shared version is not as compelling
<enebo> or merge the three lines into a single one
<enebo> ChrisBr: This is slightly more me style but once you pare this down the need to DRY seems less neccesary: https://gist.github.com/enebo/1266a5c2f6d09c2f38b83a83f758ac20
<enebo> Are those semantics right though? If the entire string is the suffix it returns itself?
<enebo> I half expected at least a dup()
<enebo> heh I did prefix but same question
rubierer has joined #jruby
rubierer has left #jruby [#jruby]
<enebo> ChrisBr: mri25 -e 'p "aaa".delete_prefix("aaa")' -> ""
<enebo> lopex: do you think onig_null_warn == onig_warn?
<enebo> but I guess we do see MRI warn sometimes though
<enebo> lopex: I am super confused as well. I don't see how this works in MRI at all
<lopex> enebo: welcome
<lopex> to the club
<enebo> yeah
<lopex> but yeah onig_null_warn == onig_warn
<lopex> since DEFAULT_WARN_FUNCTION is undefined
<lopex> er, onig_set_warn_func(re_warn);in re.c
<enebo> yeah so ruby sets that
<enebo> but where is re_warn?
<lopex> in ruby.c ?
<enebo> Could it be onig_null_warn?
<lopex> onig_set_verb_warn_func(re_warn); too
<lopex> onig_verb_warn doesnt seem to be used at all though
<lopex> enebo: actually no. it's set in re.c
<enebo> oh it is func
<enebo> rb_warn()
<enebo> hmm
<lopex> er, it's in error.c
<lopex> enebo: it all begins with add_ctype_to_cc
<lopex> then its' add_ctype_to_cc_by_range
<lopex> then add_code_range_to_buf
<lopex> which does return add_code_range_to_buf0(pbuf, env, from, to, 1);
<lopex> 1 is for true
<enebo> co checkdup as 1 is because if you are in verbose it should print out
<enebo> so that field should be 1 or true
<enebo> but something else is making it not happen
<enebo> as you say MRI has this extra conditional we do not
<lopex> but checkdup seems to be 1
<enebo> but I don't see how onig_warn could be conditionally set
<enebo> lopex: yeah I am just saying it has to be 1
<enebo> lopex: otherwise -W2 -v or whatever would never print out
<enebo> lopex: and it should if that is set
<enebo> lopex: so checkdup is not worth looking at more
<enebo> lopex: it has to be 1
<enebo> (or true for us)
<lopex> and BITSET_SET_BIT_CHKDUP does basically same thing
<lopex> enebo: and even if there's difference why /[\p{Han}\p{Han}]/ triggers the warning
<enebo> should that not trigger it?
<enebo> Isn't that just [aa] more or less?
<lopex> it should
<enebo> It doesn't?
<lopex> it does
<lopex> but it's the same path \X does
<lopex> and \X doesnt
<enebo> oh I see it is a coderange path
<lopex> yes
<enebo> haha so two things using C coderange path has different behavior
<enebo> That is really weird
<lopex> well
<lopex> enebo: did you look at node_extended_grapheme_cluster ?
<lopex> it's a series of add_ctype_to_cc
<lopex> so maybe there's some difference in char class parser
<lopex> let me see
Antiarc_ has joined #jruby
Antiarc_ has quit [Client Quit]
Antiarc has quit [Remote host closed the connection]
Antiarc has joined #jruby
Antiarc has quit [Client Quit]
Antiarc has joined #jruby
Antiarc has quit [Client Quit]
Antiarc has joined #jruby
Antiarc has quit [Client Quit]
Antiarc has joined #jruby
Antiarc has quit [Remote host closed the connection]
Antiarc has joined #jruby
<ChrisBr> enebo: thank you! You're right, if getting rid of the first three lines, it does not look that compelling to dry it
<ChrisBr> and btw: you're right, you found a bug as well
<ChrisBr> the empty check was initially to not return broken multibyte strings but is a bug if suffix == whole string
<enebo> coolio
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
clayton has quit [Quit: ZNC - http://znc.in]
bbrowning is now known as bbrowning_away
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]