Skip to content

truffleruby-head 24.0.0-dev: Failing to compile dependant stringio gem. #699

Closed

Description

@junaruga

I see the following build errors in the truffleruby-head cases in CI.

https://github.com/ruby/openssl/actions/runs/6974797041/job/18981006346#step:3:20

  /home/runner/.rubies/truffleruby-head/bin/ruby --version
  truffleruby 24.0.0-dev-9a84a125, like ruby 3.2.2, GraalVM CE Native [x86_64-linux]

https://github.com/ruby/openssl/actions/runs/6974797041/job/18981006346#step:4:20

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/runner/.rubies/truffleruby-head/lib/gems/gems/stringio-3.0.9/ext/stringio
/home/runner/.rubies/truffleruby-head/bin/ruby extconf.rb
creating Makefile

current directory:
/home/runner/.rubies/truffleruby-head/lib/gems/gems/stringio-3.0.9/ext/stringio
make DESTDIR\= sitearchdir\=./.gem.20231123-1869-nljcsp
sitelibdir\=./.gem.20231123-1869-nljcsp clean

current directory:
/home/runner/.rubies/truffleruby-head/lib/gems/gems/stringio-3.0.9/ext/stringio
make DESTDIR\= sitearchdir\=./.gem.20231123-1869-nljcsp
sitelibdir\=./.gem.20231123-1869-nljcsp
compiling stringio.c
stringio.c: In function ‘readable’:
stringio.c:138:7: error: implicit declaration of function ‘RBASIC’
[-Werror=implicit-function-declaration]
  138 |     ((RBASIC(strio)->flags & STRIO_##mode) && \
      |       ^~~~~~
...

In the past CI result where the truffleruby-head pass, the truffleruby version was 23.1.1. So, I guess the the new version 24.0.0-dev triggered the error.
https://github.com/ruby/openssl/actions/runs/6894870154/job/18757626125#step:3:19

   /home/runner/.rubies/truffleruby-23.1.1/bin/ruby --version
  truffleruby 23.1.1, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux]

In both passed and failing cases, the stringio gem version 3.0.9 are used. So, I don't think the stringio triggered the issue.

Activity

  1. junaruga commented on Nov 23, 2023

    @junaruga
    MemberAuthor

    @eregon Do you have any idea about how to fix the issue? Could you send a PR to fix it? Thanks.

  2. eregon commented on Nov 24, 2023

    @eregon
    Member

    Thanks for the ping.
    It's due to truffleruby/truffleruby#3118. It's expected that RBASIC(obj)->flags is no longer supported, because basically it cannot be.
    I'll take a look at fixing https://github.com/ruby/stringio.

  3. eregon commented on Nov 24, 2023

    @eregon
    Member

    BTW it seems a bit weird that ruby/openssl depends on the stringio gem.
    Looking at Gemfile.lock it's because the openssl Gemfile depends on rdoc->psych->stringio.
    Ideally it'd just use the stdlib stringio and not install the stringio gem.

  4. eregon commented on Nov 24, 2023

    @eregon
    Member
  5. junaruga commented on Nov 24, 2023

    @junaruga
    MemberAuthor

    BTW it seems a bit weird that ruby/openssl depends on the stringio gem. Looking at Gemfile.lock it's because the openssl Gemfile depends on rdoc->psych->stringio. Ideally it'd just use the stdlib stringio and not install the stringio gem.

    Thanks for your work!

    For the rdoc dependency in the Gemfile, 4312b07 is the reason. In Fedora Linux and the downstream Linux distro Ruby RPM packages, the rdoc is not default gem of the Ruby.

  6. eregon commented on Nov 24, 2023

    @eregon
    Member

    Do you know why openssl needs rdoc at all? I would think running openssl tests doesn't need it.

  7. junaruga commented on Nov 24, 2023

    @junaruga
    MemberAuthor

    Do you know why openssl needs rdoc at all? I would think running openssl tests doesn't need it.

    Yes, because the Rakeflie has a task to create the openssl gem's rdoc document. Perhaps you like to create the new test group in Rakefile, then only install the gem packages in the test group excluding the rdoc in the development group in the CI?

    openssl/Rakefile

    Lines 37 to 40 in 27237de

    RDoc::Task.new do |rdoc|
    rdoc.main = "README.md"
    rdoc.rdoc_files.include("*.md", "lib/**/*.rb", "ext/**/*.c")
    end

  8. junaruga commented on Nov 25, 2023

    @junaruga
    MemberAuthor

    I sent the PR #701 to pass CI avoiding this issue.

  9. junaruga commented on Nov 28, 2023

    @junaruga
    MemberAuthor

    As stringio version 3.1.0 including the ruby/stringio#71 was released, I ran the GitHub Actions on my forked repository for the latest master branch. Right now stringio version 3.0.9 is downloaded in the CI. GitHub has a cache for that? Maybe we need to wait.

    https://github.com/junaruga/ruby-openssl/actions/runs/7013145579/job/19078824139#step:4:15

  10. eregon commented on Nov 28, 2023

    @eregon
    Member

    I can reproduce it locally, also on CRuby.
    It sounds like a rubygems.org cache or bug.
    If I add gem "stringio", "3.1.0" in openssl Gemfile I get (on CRuby 3.2):

    $ bundle lock
    Fetching gem metadata from https://rubygems.org/........
    Could not find gem 'stringio (= 3.1.0)' in rubygems repository https://rubygems.org/ or installed locally.
    
    The source contains the following gems matching 'stringio':
      * stringio-0.0.1
      * stringio-0.0.2
      * stringio-0.1.0
      * stringio-0.1.3
      * stringio-0.1.4
      * stringio-3.0.0
      * stringio-3.0.1
      * stringio-3.0.2.pre1-java
      * stringio-3.0.2.pre1
      * stringio-3.0.2-java
      * stringio-3.0.2
      * stringio-3.0.3-java
      * stringio-3.0.3
      * stringio-3.0.4-java
      * stringio-3.0.4
      * stringio-3.0.5-java
      * stringio-3.0.5
      * stringio-3.0.6-java
      * stringio-3.0.6
      * stringio-3.0.7-java
      * stringio-3.0.7
      * stringio-3.0.8-java
      * stringio-3.0.8
      * stringio-3.0.9-java
      * stringio-3.0.9
    
  11. eregon commented on Nov 28, 2023

    @eregon
    Member

    Also:

    $ gem info -r stringio
    
    *** REMOTE GEMS ***
    
    stringio (3.1.0)
        Platform: java, ruby
        Authors: Nobu Nakada, Charles Oliver Nutter
        Homepage: https://github.com/ruby/stringio
    
        Pseudo IO on String
    
    $ gem install stringio
    Building native extensions. This could take a while...
    Successfully installed stringio-3.0.9
    1 gem installed
    
  12. eregon commented on Nov 28, 2023

    @eregon
    Member
  13. eregon commented on Nov 28, 2023

    @eregon
    Member

    The rubygems.org issue is fixed now.
    So I think we can close this as well as #701 and #704.

  14. junaruga commented on Dec 3, 2023

    @junaruga
    MemberAuthor

    I confirmed that the trufeeruby-head cases work with the stringio gem version 3.1.0. I would close this ticket. Thank you for your work!

    https://github.com/junaruga/ruby-openssl/actions/runs/7073768368/job/19254089972#step:4:17

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