Backport #8058

RubyGems test failures under MinGW

Added by Luis Lavena about 1 year ago. Updated about 1 year ago.

[ruby-core:53265]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

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:
testinstallextension_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/testrubygems11492/gemhome/gems/a-2'

Gem files will remain installed in C:/Users/Worker/AppData/Local/Temp/testrubygems11492/gemhome/gems/a-2 for inspection.
Results logged to C:/Users/Worker/AppData/Local/Temp/testrubygems11492/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

Associated revisions

Revision 39852
Added by Tomoyuki Chikanaga about 1 year ago

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.
   [Bug #8058]

Revision 41668
Added by Tomoyuki Chikanaga 10 months ago

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

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

History

#1 Updated by Luis Lavena about 1 year ago

  • Category changed from test to lib
  • Status changed from Open to Assigned
  • Assignee changed from Eric Hodel to Nobuyoshi Nakada

#2 Updated by Hiroshi Shirosaki about 1 year 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/testgeminstaller.rb b/test/rubygems/testgeminstaller.rb
index 0f9bfef..89a1a4a 100644
--- a/test/rubygems/testgeminstaller.rb
+++ b/test/rubygems/testgeminstaller.rb
@@ -1073,6 +1073,7 @@ gem 'other', version

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

    =end

#3 Updated by Nobuyoshi Nakada about 1 year 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.

#4 Updated by Nobuyoshi Nakada about 1 year 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.

#5 Updated by Anonymous about 1 year 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/testgeminstaller.rb (testinstallextension_flat): use ruby in build directory in case ruby is not installed. [Bug #8058]

#6 Updated by Hiroshi Shirosaki about 1 year ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Category deleted (lib)
  • Status changed from Closed to Assigned
  • Assignee changed from Nobuyoshi Nakada to Tomoyuki Chikanaga
  • Target version deleted (2.1.0)

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

#7 Updated by Tomoyuki Chikanaga about 1 year 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.
   [Bug #8058]

Also available in: Atom PDF