Skip to content
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
This repository was archived by the owner on Sep 15, 2026. It is now read-only.

Release non-java 0.2.2.pre.1 #12

Closed

Description

@deivid-rodriguez

Current there's 0.2.2.pre.1 that includes java support, but there's no corresponding 0.2.2.pre.1 version that can be installed outside of JRuby? So, since the previous 0.2.1 version has the opposite issue (works outside of JRuby, but not on JRuby), it's no possible to use any version that works with both.

Could 0.2.2.pre.1 (non java) be released, or alternatively java and non java variants of a new 0.2.2 version?

Thanks!

Activity

  1. hsbt commented on Mar 6, 2022

    @hsbt
    Member

    @headius Can you push 0.2.2.pre.1 tag into GitHub?

  2. headius commented on Mar 10, 2022

    @headius
    Contributor

    The preview release was pushed for testing purposes and because I am not comfortable pushing a full release without buying from the other maintainers. I'd be happy to push a tag for the preview today but perhaps we should discuss getting a proper 0.2.2 release out.

  3. headius commented on Mar 10, 2022

    @headius
    Contributor

    I pushed a commit updating the gemspec version and tagged it as v0.2.2.pre1.

  4. deivid-rodriguez commented on Mar 10, 2022

    @deivid-rodriguez
    Author

    I was actually aiming for a rubygems.org release, but it's fine. In any case, io-wait might be moved right into core: https://bugs.ruby-lang.org/issues/18566. So this gem will get emptied eventually, right?

  5. headius commented on Mar 10, 2022

    @headius
    Contributor

    It does appear that will happen, but 3.1 will still be using the default gem and JRuby 9.4 will target 3.1 so we will follow suit.

    I'm not sure what the migration path is going forward, since an empty gem would break Ruby 3.1 users (the gem will be activated and may interfere with the shipped default gem).

  6. deivid-rodriguez commented on Mar 10, 2022

    @deivid-rodriguez
    Author

    It does appear that will happen, but 3.1 will still be using the default gem and JRuby 9.4 will target 3.1 so we will follow suit.

    Yep, makes sense.

    I'm not sure what the migration path is going forward, since an empty gem would break Ruby 3.1 users (the gem will be activated and may interfere with the shipped default gem).

    If guess this empty gem won't support 3.1, it will have required_ruby_version >= 3.2?

  7. headius commented on Mar 10, 2022

    @headius
    Contributor

    If guess this empty gem won't support 3.1, it will have required_ruby_version >= 3.2?

    Yeah that is probably an option. I assume RubyGems won't attempt to install such a gem on an earlier version, so 3.1 should be protected from the null gem?

  8. headius commented on Mar 10, 2022

    @headius
    Contributor

    Note however that the suggestion of moving io-wait back into core was proposed in part because TruffleRuby does not support the gem at all, and it also does not currently support 3.2, so this fix would not help them. It is a rather messy situation.

  9. deivid-rodriguez commented on Mar 10, 2022

    @deivid-rodriguez
    Author

    Yes, it's quite messy 🤣.

    Yeah that is probably an option. I assume RubyGems won't attempt to install such a gem on an earlier version, so 3.1 should be protected from the null gem?

    Yes! Well, some old versions of Bundler & RubyGems may attempt to install this gem due to resolution bugs, but the install will fail due to the compatibility issue. So I think this empty gem should never sneak into older rubies.

  10. headius commented on Mar 10, 2022

    @headius
    Contributor

    @eregon You may have some thoughts on how the new empty gem (transitional from the existing real gem) should work with older Ruby compatibility levels (as in TruffleRuby) and the newer versions of net-protocol.

    Attempting to summarize the situation:

    • TruffleRuby does not support the io-wait gem extension, so it cannot install and use the existing gem. This breaks the installation of net-protocol and downstream libraries.
    • CRuby seems likely to merge io-wait back into core, at which point the default gem will become a blank dummy and removed as a dependency from net-protocol.
    • The dummy gem will only be installable on Ruby 3.2 or higher, since that is the level at which io-wait merges back to core. However this means that versions of net-protocol that depend on io-wait will still be unable to install on TruffleRuby because such an install will try to use the native ext gem.
    • CRuby > 3.1 and JRuby > 9.4 will be unaffected by this because we will ship with support for the io-wait java gem and eventually flip to 3.2's dummy gem with io-wait merged back into our core.
    • Once there is a new net-protocol that does not depend on the gem, perhaps this problem goes away, but that version of net-protocol must also only be installable on 3.2+ since 3.1 has io-wait as a default gem (and consensus says we must depend on default gems just like regular gems).

    I'm not sure how to resolve this little catch-22 situation.

  11. eregon commented on Mar 10, 2022

    @eregon
    Member

    Could we do something like FFI, where the gem just require the stdlib instead?
    https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/lib/ffi.rb#L19-L26

    Then it would work for all Ruby versions.

    I'd try this in lib/io/wait.rb:

      $LOAD_PATH.delete(File.expand_path('../..', __FILE__))
      require 'io/wait'

    I think this will be needed anyway for several default gems which should really just delegate to the stdlib/core on TruffleRuby and possibly on old CRuby versions as well, and any other Ruby implementation.

  12. headius commented on Mar 10, 2022

    @headius
    Contributor

    I believe that code in the ffi gem is a relic from when JRuby shipped its own copy of the Ruby sources. Now we use the Ruby sources from the gem with our internal extension, as in the code a few lines above.

    I am very reluctant to muck around with the load path in this way but I don't have a better suggestion at the moment.

  13. hsbt commented on Mar 11, 2022

    @hsbt
    Member

    @deivid-rodriguez I released 0.2.2.pre1 with ruby platform.

  14. deivid-rodriguez commented on Mar 11, 2022

    @deivid-rodriguez
    Author

    Awesome, thanks!

  15. eregon commented on Mar 11, 2022

    @eregon
    Member

    I am very reluctant to muck around with the load path in this way but I don't have a better suggestion at the moment.

    I can't think of any other way that would work on existing Rubies.
    We could add some require_stdlib method or so, but it wouldn't help existing releases.
    Using gem_original_require would also not work as long as the gem is in $LOAD_PATH.
    I think removing the gem from $LOAD_PATH is not too bad as the gem is actually delegating to stdlib and should be ignored after this initial step.

    (Another idea would be to use RbConfig or so to try to find the stdlib directory/ies and do an absolute require. This wouldn't work for existing truffleruby releases, because there are multiple stdlib directories (lib/mri, lib/truffle; and same on CRuby if we need to consider both .rb and .so files), and only one is in RbConfig. It would also break if such a file would do a non-absolute require and seems brittle)

  16. eregon commented on Mar 17, 2022

    @eregon
    Member

    Actually, the gem could just be empty and have no files, no?
    Then require 'io/wait' would just require the stdlib, which has been there forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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