Project

General

Profile

Actions

Backport #8058

closed

RubyGems test failures under MinGW

Added by luislavena (Luis Lavena) about 11 years ago. Updated about 11 years ago.


Description

=begin

Hello,

Seems some of the tests for RubyGems are failing on RubyInstaller CI:

http://ci.rubyinstaller.org/job/ruby-trunk-x64-test-all/846/console
http://ci.rubyinstaller.org/job/ruby-trunk-x86-test-all/969/console

  1. Error:
    test_install_extension_flat(TestGemInstaller):
    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/build/ruby.exe extconf.rb

creating Makefile

make
make[1]: Entering directory /tmp/test_rubygems_11492/gemhome/gems/a-2' generating a-x64-mingw32.def /bin/sh: /usr/local/bin/ruby: No such file or directory make[1]: *** [a-x64-mingw32.def] Error 127 make[1]: Leaving directory /tmp/test_rubygems_11492/gemhome/gems/a-2'

Gem files will remain installed in C:/Users/Worker/AppData/Local/Temp/test_rubygems_11492/gemhome/gems/a-2 for inspection.
Results logged to C:/Users/Worker/AppData/Local/Temp/test_rubygems_11492/gemhome/gems/a-2/./gem_make.out

 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/ext/builder.rb:55:in `run'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/ext/builder.rb:28:in `block in make'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/ext/builder.rb:26:in `each'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/ext/builder.rb:26:in `make'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/ext/ext_conf_builder.rb:39:in `block in build'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/tempfile.rb:324:in `open'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/ext/ext_conf_builder.rb:18:in `build'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/installer.rb:678:in `block (2 levels) in build_extensions'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/installer.rb:677:in `chdir'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/installer.rb:677:in `block in build_extensions'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/installer.rb:652:in `each'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/installer.rb:652:in `build_extensions'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/installer.rb:218:in `install'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/test/rubygems/test_gem_installer.rb:1092:in `block in test_install_extension_flat'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/user_interaction.rb:40:in `use_ui'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/rubygems/user_interaction.rb:63:in `use_ui'
 C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/test/rubygems/test_gem_installer.rb:1088:in `test_install_extension_flat'

Seems this could be caused via a change on what (({ruby})) is form RbConfig perhaps?

I'm opening this for discussion.

Thank you.

=end

Updated by luislavena (Luis Lavena) about 11 years ago

  • Category changed from test to lib
  • Status changed from Open to Assigned
  • Assignee changed from drbrain (Eric Hodel) to nobu (Nobuyoshi Nakada)

Updated by h.shirosaki (Hiroshi Shirosaki) about 11 years ago

=begin
This test seems require installed ruby due to the following make rule on Windows.

$(DEFFILE):
$(ECHO) generating $(@)
$(Q) $(RUBY) -e "puts 'EXPORTS', '$(TARGET_ENTRY)'" > $@

But ruby is not installed before test-all on CI. So $(RUBY) does not exist and the test fails.

Here is a possible fix.

diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 0f9bfef..89a1a4a 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -1073,6 +1073,7 @@ gem 'other', version

      CONFIG['CC'] = '$(TOUCH) $@ ||'
      CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
  •    $ruby = '$(TOUCH) $@ ||'
    
       create_makefile("#{@spec.name}")
     RUBY
    

=end

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

Thank you for the investigation.

$ruby should use miniruby until the installation, right now I have no idea why it doesn't though.
Probably it seems enough by mimicking.

I can't remember the reason why ruby is used there, because of old command.com perhaps, I guess.
We could assume cmd.exe nowadays.

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

(13/03/16 18:35), nobu (Nobuyoshi Nakada) wrote:

I can't remember the reason why ruby is used there, because of old command.com perhaps, I guess.
We could assume cmd.exe nowadays.

It was for the case .def file is packaged, so it's difficult to
replace the command with Windows standard commands only.

Actions #5

Updated by Anonymous about 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39835.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • test/rubygems/test_gem_installer.rb (test_install_extension_flat):
    use ruby in build directory in case ruby is not installed.
    [ruby-core:53265] [Bug #8058]
Actions #6

Updated by h.shirosaki (Hiroshi Shirosaki) about 11 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Category deleted (lib)
  • Status changed from Closed to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
  • Target version deleted (2.1.0)

Please backport r39835 to fix a test failure on http://ci.rubyinstaller.org

Actions #7

Updated by nagachika (Tomoyuki Chikanaga) about 11 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39852.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39835: [Backport #8058]

* test/rubygems/test_gem_installer.rb (test_install_extension_flat):
  use ruby in build directory in case ruby is not installed.
  [ruby-core:53265] [Bug #8058]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0