You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible to unconstrain strscan or fallback if not available? #132
Hello, as I understand it, strscan is a standard gem which means Ruby will always include some version of it. One can update the version via gem, but then it must be compiled on the target system as it isn't provided as a binary gem. Recent versions of strscan seem to require a Ruby compiled with libonig support[1], which may not be available. If I'm understanding all of this correctly, this effectively limits the kinds of Ruby installs where rexml can be used. (EDIT: I misinterpreted log output. libonig is optional. As mentioned here, workarounds include ensuring build-essential is installed (gcc and make) or using an earlier version of rexml as mentioned below.)
If your gem directly requires rexml, the easiest way to get around this is to require an earlier version of rexml that doesn't use strscan (e.g., 3.2.6). This isn't a great solution as we miss out on updates. And if rexml is further down the dependency chain, even this may not be viable.
Does rexml need to constrain the version of strscan? Could we leave it unpinned for better compatibility? (Potentially related to 372daf1)
If the version constraint is needed, can rexml fallback to the old routines if the correct strscan version is unavailable? (or something that uses an earlier version of strscan?)
Apologies if I'm off the mark. By no means a Ruby expert.
Sorry, just saw #131 which is exactly what prompted this issue on our end. Feel free to close, but I'm still curious about the questions I raised. Thanks.
I think that JRuby users can use the latest strscan or upgrade JRuby itself. strscan gem for JRuby is a fat gem. So JRuby users don't need to build it.
I think that JRuby users can use the latest strscan or upgrade JRuby itself. strscan gem for JRuby is a fat gem. So JRuby users don't need to build it.
Activity
adsr commentedon May 17, 2024
Sorry, just saw #131 which is exactly what prompted this issue on our end. Feel free to close, but I'm still curious about the questions I raised. Thanks.
kou commentedon May 17, 2024
@naitoh Can we use old strscan? See also: #105 (comment)
kou commentedon May 21, 2024
I've implemented this.
naitoh commentedon May 21, 2024
@kou
I fixed the problem with
StringScanner#capturesat ruby/strscan#72.So you will need to use StringScanner that incorporates this fix, but I think f1df7d1 should be fine.
Thank you!
However, I am concerned about the impact of the ruby/strscan#79 modification on JRuby, is that a problem?
See: https://github.com/ruby/rexml/pull/105/files#r1451192655
kou commentedon May 21, 2024
I think that JRuby users can use the latest strscan or upgrade JRuby itself. strscan gem for JRuby is a fat gem. So JRuby users don't need to build it.
naitoh commentedon May 22, 2024
@kou
OK.
I see.
Thanks!
Add support for old strscan