Project

General

Profile

Actions

Bug #19687

closed

Should a development version of the standard library be included in ruby/ruby?

Added by jaruga (Jun Aruga) 12 months ago. Updated 12 months ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-05-22T03:58:17Z master bd786e7896) [x86_64-linux]
[ruby-core:113601]

Description

The stringio gem uses the value of the STRINGIO_VERSION as the gem version.

https://github.com/ruby/ruby/blob/31ac8efca8ecb574e1e7b7c32cce54cb1b97f19a/ext/stringio/stringio.gemspec#L15
https://github.com/ruby/ruby/blob/31ac8efca8ecb574e1e7b7c32cce54cb1b97f19a/ext/stringio/stringio.c#L15

#define STRINGIO_VERSION "3.0.7"

It seems that that stringio on the current master branch in ruby/ruby sets the version 3.0.7 that doesn't exist in the RubyGems https://rubygems.org/gems/stringio by the commit https://github.com/ruby/ruby/commit/67743d582317544d2c830b63d3423b04bad185a7.

And I see that this causes raising an error when running bundle install on ruby/openssl with Ruby on the master branch. I captured the Gemeifile.lock by bundle lock. And I see the rdoc depending on psych depending on stringio.

The workaround was to add gem "stringio", "< 3.0.7" to the Gemfile. However, it's not convenient. Is it an expected behavior? Or should the ruby/ruby always merge the static version of the ruby/* (upstream standard libraries such as "stringio") rater than the development version?

$ which ruby
~/.local/ruby-bd786e7896/bin/ruby

$ ruby -v
ruby 3.3.0dev (2023-05-22T03:58:17Z master bd786e7896) [x86_64-linux]

$ pwd
/home/jaruga/git/ruby/openssl

$ bundle install --standalone
...
stringio-3.0.7 is built in to Ruby, and can't be cached because your Gemfile doesn't have any sources that contain it.
...
Bundler::GemNotFound: Could not find stringio-3.0.7.gem for installation
  /home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/source/rubygems.rb:157:in
`install'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/gem_installer.rb:54:in
`install'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/parallel_installer.rb:156:in
`do_install'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/parallel_installer.rb:147:in
`block in worker_pool'
  /home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:62:in `apply_func'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:57:in `block in
process_queue'
  <internal:kernel>:187:in `loop'
  /home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:54:in `process_queue'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:90:in `block (2
levels) in create_threads'

An error occurred while installing stringio (3.0.7), and Bundler cannot continue.

Updated by kou (Kouhei Sutou) 12 months ago

  • Status changed from Open to Feedback
  • Assignee set to kou (Kouhei Sutou)

I couldn't reproduce this.

stringio is a default gem. So I think that make install also installs stringio 3.0.7 as a gem.

Could you show the output of gem list | grep stringio?

Updated by jaruga (Jun Aruga) 12 months ago

Could you show the output of gem list | grep stringio?

Sure. Below is the result.

$ which gem
~/.local/ruby-bd786e7896/bin/gem

$ gem --version
3.5.0.dev

$ gem list | grep stringio
stringio (default: 3.0.7)

I think that I installed the used Ruby by the commands below from the ruby/ruby master branch commit bd786e78969f9d4a8699376ceafe10934b6ad533 that is relatively a new commit, and the commit date is 2 days ago.

$ ./configure \
  --prefix=${HOME}/.local/ruby-bd786e7896 \
  --enable-shared \
  --enable-mkmf-verbose
$ make -j$(nproc)
$ make install

I was able to reproduce this on the latest master branch 78e9197f4a01676ab194d014d20c3ba4e9a1ee87 in the ruby/opnessl.

$ git remote -v | grep origin
origin	git@github.com:ruby/openssl.git (fetch)
origin	git@github.com:ruby/openssl.git (push)

$ git log --pretty=oneline | head -1
78e9197f4a01676ab194d014d20c3ba4e9a1ee87 Merge pull request #623 from junaruga/wip/enable-mkmf-verbose

$ which bundle
~/.local/ruby-bd786e7896/bin/bundle

$ bundle --version
Bundler version 2.5.0.dev

$ bundle install --standalone
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching rake 13.0.6
Installing rake 13.0.6
Using bundler 2.5.0.dev
Using openssl 3.1.0 from source at `.`
Fetching power_assert 2.0.3
stringio-3.0.7 is built in to Ruby, and can't be cached because your Gemfile doesn't have any sources that contain it.
Fetching rake-compiler 1.2.1
Installing power_assert 2.0.3
Fetching test-unit 3.5.8
Installing rake-compiler 1.2.1
Installing test-unit 3.5.8
Bundler::GemNotFound: Could not find stringio-3.0.7.gem for installation
  /home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/source/rubygems.rb:157:in
`install'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/gem_installer.rb:54:in
`install'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/parallel_installer.rb:156:in
`do_install'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/installer/parallel_installer.rb:147:in
`block in worker_pool'
  /home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:62:in `apply_func'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:57:in `block in
process_queue'
  <internal:kernel>:187:in `loop'
  /home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:54:in `process_queue'
/home/jaruga/.local/ruby-bd786e7896/lib/ruby/3.3.0+0/bundler/worker.rb:90:in `block (2
levels) in create_threads'

An error occurred while installing stringio (3.0.7), and Bundler cannot continue.

In Gemfile:
  rdoc was resolved to 6.5.0, which depends on
    psych was resolved to 5.1.0, which depends on
      stringio

Updated by kou (Kouhei Sutou) 12 months ago

Ah, sorry. I missed that you use the --standalone option.
Can you remove the --standalone option?

Updated by jaruga (Jun Aruga) 12 months ago

kou (Kouhei Sutou) wrote in #note-3:

Ah, sorry. I missed that you use the --standalone option.
Can you remove the --standalone option?

Yes, okay. Yeah, it works with bundle install without --standalone option.

$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 13.0.6
Using openssl 3.1.0 from source at `.`
Using power_assert 2.0.3
Using stringio 3.0.7
Fetching rake-compiler 1.2.1
Using bundler 2.5.0.dev
Using test-unit 3.5.8
Using psych 5.1.0
Using rdoc 6.5.0
Installing rake-compiler 1.2.1
Bundle complete! 5 Gemfile dependencies, 9 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

Updated by kou (Kouhei Sutou) 12 months ago

Can we close this?

Updated by jaruga (Jun Aruga) 12 months ago

Can we close this?

Why do you think so? I want to know the opinions for the following questions I wrote for the topic title and content. What are your opinions for the questions?

  1. Is it an expected behavior?
  2. Should a development version of the standard library be included in ruby/ruby? = Should the ruby/ruby always merge the static version of the ruby/* (upstream standard libraries such as "stringio") rater than the development version?

Updated by kou (Kouhei Sutou) 12 months ago

Can we close this?

Why do you think so?

Because your bundle install problem was solved.

  1. Is it an expected behavior?

Yes.

  1. Should a development version of the standard library be included in ruby/ruby? = Should the ruby/ruby always merge the static version of the ruby/* (upstream standard libraries such as "stringio") rater than the development version?

I don't think "should". I think "may".
I think that there is no problem that ruby/ruby includes not released ruby/*.

Updated by jaruga (Jun Aruga) 12 months ago

  • Status changed from Feedback to Closed

Sure. Thanks for your opinions.

So, my opinion for this situation is below.

  1. Should a development version of the standard library be included in ruby/ruby? = Should the ruby/ruby always merge the static version of the ruby/* (upstream standard libraries such as "stringio") rater than the development version?

Yes, it should or may happen. And it's not a problem for users. Because in the Ruby development version, that bundle install --standalone may not work due to the development version of the standard libraries that don't exist in RubyGems. However, users can still use the bundle install without --standalone option as a workaround, while it's not the exact replacement.

So, I think we can close this ticket. And thank you for checking my issue.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0