Skip to content

Is it possible to unconstrain strscan or fallback if not available? #132

Closed

Description

@adsr

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.

[1] https://github.com/ruby/strscan/blob/ca66d48c47d2b17753a660c628606f0bf788d594/ext/strscan/extconf.rb#L5-L6

Activity

  1. adsr commented on May 17, 2024

    @adsr
    Author

    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.

  2. kou commented on May 17, 2024

    @kou
    Member

    Does rexml need to constrain the version of strscan? Could we leave it unpinned for better compatibility?

    @naitoh Can we use old strscan? See also: #105 (comment)

  3. kou commented on May 21, 2024

    @kou
    Member

    I've implemented this.

  4. naitoh commented on May 21, 2024

    @naitoh
    Contributor

    Does rexml need to constrain the version of strscan? Could we leave it unpinned for better compatibility?

    @naitoh Can we use old strscan? See also: #105 (comment)

    @kou

    I fixed the problem with StringScanner#captures at 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

  5. kou commented on May 21, 2024

    @kou
    Member

    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.

  6. naitoh commented on May 22, 2024

    @naitoh
    Contributor

    @kou

    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.

    OK.
    I see.
    Thanks!

  7. added a commit that references this issue on Jun 2, 2024
    f1df7d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions