ruby / openssl

Provides SSL, TLS and general purpose cryptography.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

junaruga opened this issue · comments

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.

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

Thanks for the ping.
It's due to oracle/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.

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.

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.

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

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

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

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

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

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

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

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