Skip to content

Fix bundled gems installation on a fresh clone#2951

Merged
nobu merged 2 commits into
ruby:masterfrom
deivid-rodriguez:fix_bundled_gems_install
Mar 14, 2020
Merged

Fix bundled gems installation on a fresh clone#2951
nobu merged 2 commits into
ruby:masterfrom
deivid-rodriguez:fix_bundled_gems_install

Conversation

@deivid-rodriguez

Copy link
Copy Markdown
Contributor

Currently, if you run configure, make and make install on a fresh ruby clone, make install tries to install bundled gems, but fails to install anything.

See the make install output, where it succeeds to install default gems with and without extensions, and then tries to install bundled gems but fails to install anything.

./miniruby -I../src/lib -I. -I.ext/common  ../src/tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ../src/tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="-w" --make-flags="w" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --exclude=doc
installing binary commands:         /home/deivid/.rbenv/versions/ruby-head/bin
installing base libraries:          /home/deivid/.rbenv/versions/ruby-head/lib
installing arch files:              /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0/x86_64-linux
installing pkgconfig data:          /home/deivid/.rbenv/versions/ruby-head/lib/pkgconfig
installing extension objects:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0/x86_64-linux
installing extension objects:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/site_ruby/2.8.0/x86_64-linux
installing extension objects:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/vendor_ruby/2.8.0/x86_64-linux
installing extension headers:       /home/deivid/.rbenv/versions/ruby-head/include/ruby-2.8.0/x86_64-linux
installing extension scripts:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0
installing extension scripts:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/site_ruby/2.8.0
installing extension scripts:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/vendor_ruby/2.8.0
installing extension headers:       /home/deivid/.rbenv/versions/ruby-head/include/ruby-2.8.0/ruby
installing command scripts:         /home/deivid/.rbenv/versions/ruby-head/bin
installing library scripts:         /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0
installing common headers:          /home/deivid/.rbenv/versions/ruby-head/include/ruby-2.8.0
installing manpages:                /home/deivid/.rbenv/versions/ruby-head/share/man (man1, man5)
installing default gems from lib:   /home/deivid/.rbenv/versions/ruby-head/lib/ruby/gems/2.8.0
                                    English 0.1.0
                                    benchmark 0.1.0
                                    bundler 2.1.4
                                    cgi 0.1.0
                                    csv 3.1.2
                                    delegate 0.1.0
                                    did_you_mean 1.4.0
                                    fileutils 1.4.1
                                    forwardable 1.3.1
                                    getoptlong 0.1.0
                                    ipaddr 1.2.2
                                    irb 1.2.3
                                    logger 1.4.2
                                    matrix 0.2.0
                                    mutex_m 0.1.0
                                    net-ftp 0.1.0
                                    net-http 0.1.0
                                    net-imap 0.1.0
                                    net-pop 0.1.0
                                    net-protocol 0.1.0
                                    net-smtp 0.1.0
                                    observer 0.1.0
                                    open3 0.1.0
                                    ostruct 0.2.0
                                    prime 0.1.1
                                    pstore 0.1.0
                                    racc 1.4.16
                                    rdoc 6.2.1
                                    readline 0.0.2
                                    reline 0.1.3
                                    singleton 0.1.0
                                    tempfile 0.1.0
                                    timeout 0.1.0
                                    tmpdir 0.1.0
                                    tracer 0.1.0
                                    uri 0.10.0
                                    weakref 0.1.0
                                    webrick 1.6.0
                                    yaml 0.1.0
installing default gems from ext:   /home/deivid/.rbenv/versions/ruby-head/lib/ruby/gems/2.8.0
                                    bigdecimal 2.0.0
                                    date 3.0.0
                                    dbm 1.1.0
                                    etc 1.1.0
                                    fcntl 1.0.0
                                    fiddle 1.0.0
                                    gdbm 2.1.0
                                    io-console 0.5.6
                                    json 2.3.0
                                    openssl 2.2.0
                                    psych 3.1.0
                                    readline-ext 0.1.0
                                    sdbm 1.0.0
                                    stringio 0.1.0
                                    strscan 1.0.3
                                    zlib 1.1.0
installing bundled gems:            /home/deivid/.rbenv/versions/ruby-head/lib/ruby/gems/2.8.0
make: Leaving directory '/home/deivid/Code/ruby/ruby/build'

If at some point you happen to run make update-gems and make extract-gems, then the proper .gem files and extracted gem contents are placed at the right place so that rbinstall.rb can see then, and make install starts doing the right thing.

To me, this is clearly unintended, because if it was intentional, make install wouldn't even try to install bundled gems by default.

With this changes, make install does the right thing by default:

./miniruby -I../src/lib -I. -I.ext/common  ../src/tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ../src/tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="-w" --make-flags="w" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --exclude=doc
installing binary commands:         /home/deivid/.rbenv/versions/ruby-head/bin
installing base libraries:          /home/deivid/.rbenv/versions/ruby-head/lib
installing arch files:              /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0/x86_64-linux
installing pkgconfig data:          /home/deivid/.rbenv/versions/ruby-head/lib/pkgconfig
installing extension objects:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0/x86_64-linux
installing extension objects:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/site_ruby/2.8.0/x86_64-linux
installing extension objects:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/vendor_ruby/2.8.0/x86_64-linux
installing extension headers:       /home/deivid/.rbenv/versions/ruby-head/include/ruby-2.8.0/x86_64-linux
installing extension scripts:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0
installing extension scripts:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/site_ruby/2.8.0
installing extension scripts:       /home/deivid/.rbenv/versions/ruby-head/lib/ruby/vendor_ruby/2.8.0
installing extension headers:       /home/deivid/.rbenv/versions/ruby-head/include/ruby-2.8.0/ruby
installing command scripts:         /home/deivid/.rbenv/versions/ruby-head/bin
installing library scripts:         /home/deivid/.rbenv/versions/ruby-head/lib/ruby/2.8.0
installing common headers:          /home/deivid/.rbenv/versions/ruby-head/include/ruby-2.8.0
installing manpages:                /home/deivid/.rbenv/versions/ruby-head/share/man (man1, man5)
installing default gems from lib:   /home/deivid/.rbenv/versions/ruby-head/lib/ruby/gems/2.8.0
                                    English 0.1.0
                                    benchmark 0.1.0
                                    bundler 2.1.4
                                    cgi 0.1.0
                                    csv 3.1.2
                                    delegate 0.1.0
                                    did_you_mean 1.4.0
                                    fileutils 1.4.1
                                    forwardable 1.3.1
                                    getoptlong 0.1.0
                                    ipaddr 1.2.2
                                    irb 1.2.3
                                    logger 1.4.2
                                    matrix 0.2.0
                                    mutex_m 0.1.0
                                    net-ftp 0.1.0
                                    net-http 0.1.0
                                    net-imap 0.1.0
                                    net-pop 0.1.0
                                    net-protocol 0.1.0
                                    net-smtp 0.1.0
                                    observer 0.1.0
                                    open3 0.1.0
                                    ostruct 0.2.0
                                    prime 0.1.1
                                    pstore 0.1.0
                                    racc 1.4.16
                                    rdoc 6.2.1
                                    readline 0.0.2
                                    reline 0.1.3
                                    singleton 0.1.0
                                    tempfile 0.1.0
                                    timeout 0.1.0
                                    tmpdir 0.1.0
                                    tracer 0.1.0
                                    uri 0.10.0
                                    weakref 0.1.0
                                    webrick 1.6.0
                                    yaml 0.1.0
installing default gems from ext:   /home/deivid/.rbenv/versions/ruby-head/lib/ruby/gems/2.8.0
                                    bigdecimal 2.0.0
                                    date 3.0.0
                                    dbm 1.1.0
                                    etc 1.1.0
                                    fcntl 1.0.0
                                    fiddle 1.0.0
                                    gdbm 2.1.0
                                    io-console 0.5.6
                                    json 2.3.0
                                    openssl 2.2.0
                                    psych 3.1.0
                                    readline-ext 0.1.0
                                    sdbm 1.0.0
                                    stringio 0.1.0
                                    strscan 1.0.3
                                    zlib 1.1.0
installing bundled gems:            /home/deivid/.rbenv/versions/ruby-head/lib/ruby/gems/2.8.0
                                    minitest 5.14.0
                                    power_assert 1.1.6
                                    rake 13.0.1
                                    test-unit 3.3.5
                                    rexml 3.2.4
                                    rss 0.2.9
make: Leaving directory '/home/deivid/Code/ruby/ruby/build'

This PR fixes ruby bug https://bugs.ruby-lang.org/issues/13724.

@deivid-rodriguez deivid-rodriguez force-pushed the fix_bundled_gems_install branch from 5351ff1 to b27447c Compare March 8, 2020 09:33
@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

I messed something up apparently.

I can try fix it, but I'd like to know if this is something you would like to fix since the linked issue was closed as intended behaviour.

/cc @eregon as the original reporter of the ruby-core ticket.

@eregon

eregon commented Mar 8, 2020

Copy link
Copy Markdown
Member

👍 from me

@deivid-rodriguez deivid-rodriguez force-pushed the fix_bundled_gems_install branch 3 times, most recently from 7505f68 to 1189374 Compare March 10, 2020 15:02
Comment thread common.mk Outdated
@deivid-rodriguez deivid-rodriguez force-pushed the fix_bundled_gems_install branch from c4db4eb to 6e72254 Compare March 13, 2020 09:40
@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

@nobu pushed a few changes to master that made it very easy to fix this. Now CI is green.

Comment thread README.md Outdated
@deivid-rodriguez deivid-rodriguez force-pushed the fix_bundled_gems_install branch from 6e72254 to 5f53728 Compare March 13, 2020 11:14

@eregon eregon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Comment thread .github/workflows/windows.yml Outdated
nurse pushed a commit to nurse/ruby that referenced this pull request Mar 13, 2020
  * Fix gem pristine not accounting for user installed gems. Pull request
    ruby#2914 by Luis Sagastume.
  * Refactor keyword argument test for Ruby 2.7. Pull request ruby#2947 by
    SHIBATA Hiroshi.
  * Fix errors at frozen Gem::Version. Pull request ruby#2949 by Nobuyoshi
    Nakada.
  * Remove taint usage on Ruby 2.7+. Pull request ruby#2951 by Jeremy Evans.
  * Check Manifest.txt is up to date. Pull request ruby#2953 by David Rodríguez.
  * Clarify symlink conditionals in tests. Pull request ruby#2962 by David
    Rodríguez.
  * Update command line parsing to work under ps. Pull request ruby#2966 by
    David Rodríguez.
  * Properly test `Gem::Specifications.stub_for`. Pull request ruby#2970 by
    David Rodríguez.
  * Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request
    ruby#2985 by MSP-Greg.
@deivid-rodriguez deivid-rodriguez force-pushed the fix_bundled_gems_install branch from 5f53728 to 292c35a Compare March 13, 2020 13:18
@nobu nobu merged commit 459670d into ruby:master Mar 14, 2020
@deivid-rodriguez deivid-rodriguez deleted the fix_bundled_gems_install branch March 14, 2020 09:25
@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

Thank you!

eregon added a commit to ruby/ruby-dev-builder that referenced this pull request Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants