Project

General

Profile

Backport #5492

MinGW Installation with Ruby 1.9.3rc1 Broken

Added by cfis (Charlie Savage) about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:40462]

Description

This is a regression since at least the preview release, not sure about the rc1 release. Using MinGW to make and then make install Ruby on Windows 7 now creates the following bin directory:

bin
erb
.bat
gem
.bat

etc.

Notice the file should be "erb.bat", not a "erb" sudirectory with a file called ".bat" in it. The same is true for:

erb
gem
irb
rake
rdoc
ri
testrb

This obviously breaks the installation...so marking it high priority.

Associated revisions

Revision d67ac15c
Added by nobu (Nobuyoshi Nakada) about 7 years ago

  • tool/rbinstall.rb (install_recursive, bin-comm): split mere string not path name. [Bug #5492]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 33566
Added by nobu (Nobuyoshi Nakada) about 7 years ago

  • tool/rbinstall.rb (install_recursive, bin-comm): split mere string not path name. [Bug #5492]

Revision 33566
Added by nobu (Nobuyoshi Nakada) about 7 years ago

  • tool/rbinstall.rb (install_recursive, bin-comm): split mere string not path name. [Bug #5492]

Revision 33566
Added by nobu (Nobuyoshi Nakada) about 7 years ago

  • tool/rbinstall.rb (install_recursive, bin-comm): split mere string not path name. [Bug #5492]

Revision 33566
Added by nobu (Nobuyoshi Nakada) about 7 years ago

  • tool/rbinstall.rb (install_recursive, bin-comm): split mere string not path name. [Bug #5492]

Revision 33566
Added by nobu (Nobuyoshi Nakada) about 7 years ago

  • tool/rbinstall.rb (install_recursive, bin-comm): split mere string not path name. [Bug #5492]

Revision 379a35b8
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

merge revision(s) 33566:

* tool/rbinstall.rb (install_recursive, bin-comm): split mere
  string not path name.   [Bug #5492]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 34195
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

merge revision(s) 33566:

* tool/rbinstall.rb (install_recursive, bin-comm): split mere
  string not path name.   [Bug #5492]

History

#1 [ruby-core:40466] Updated by jonforums (Jon Forums) about 7 years ago

How did you build it?

I'm guessing you tried a plain-vanilla build rather than using the RubyInstaller recipes as I got a normal looking bin dir for ruby 1.9.3dev (2011-10-11 revision 33457) [i386-mingw32]

https://github.com/oneclick/rubyinstaller/blob/master/recipes/interpreter/ruby19.rake#L163-198

I'm going to try both a RubyInstaller recipe and plain-vanilla build again to double-check.

#2 [ruby-core:40467] Updated by cfis (Charlie Savage) about 7 years ago

Plain vanilla build using mingw + msys (same setup I've used the last couple years).

$ ./configure --prefix=/ --enable-shared CPPFLAGS=-Ic:/MinGW/local/include LDFLAGS=-Lc:/MinGW/local/lib
$ make
$ make install DESTDIR=c:/MinGW/local/ruby193

#3 [ruby-core:40468] Updated by jonforums (Jon Forums) about 7 years ago

I can't replicate with a plain vanilla mingw + msys via cmd.exe...very odd.

C:\Users\Jon\Documents\RubyDev\ruby-git>git co ruby_1_9_3
Switched to branch 'ruby_1_9_3'

C:\Users\Jon\Documents\RubyDev\ruby-git>\DevKit\devkitvars.bat
Adding the DevKit to PATH...

C:\Users\Jon\Documents\RubyDev\ruby-git>sh -c "autoconf"

C:\Users\Jon\Documents\RubyDev\ruby-git>cd build

C:\Users\Jon\Documents\RubyDev\ruby-git\build>sh -c "../configure --enable-shared --disable-install-doc --prefix=C:/Users/Jon/Downloads/temp/ruby193"

C:\Users\Jon\Documents\RubyDev\ruby-git\build>make

C:\Users\Jon\Documents\RubyDev\ruby-git\build>make install
./miniruby.exe -I../lib -I. -I.ext/common ../tool/rbinstall.rb --make="make"
--dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644
--prog-mode=0755 --installed-list .installed.list --mantype="man"
...

C:\Users\Jon\Downloads\temp\ruby193>tree /f bin
Folder PATH listing
Volume serial number is 00000002 9601:587A
C:\USERS\JON\DOWNLOADS\TEMP\RUBY193\BIN
erb.bat
gem.bat
irb.bat
msvcrt-ruby191.dll
rake.bat
rdoc.bat
ri.bat
ruby.exe
rubyw.exe
testrb.bat

No subfolders exist

C:\Users\Jon\Downloads\temp\ruby193>set PATH=bin;%PATH%

C:\Users\Jon\Downloads\temp\ruby193>ruby --version
ruby 1.9.3dev (2011-10-11 revision 33457) [i386-mingw32]

C:\Users\Jon\Downloads\temp\ruby193>erb --version
erb.rb [2.1.0 $]

C:\Users\Jon\Downloads\temp\ruby193>gem --version
C:/Users/Jon/Downloads/temp/ruby193/lib/ruby/1.9.1/yaml.rb:56:in `':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
1.8.11

#6 [ruby-core:40499] Updated by phasis68 (Heesob Park) about 7 years ago

I have same issues as above.

If you specify configure prefix as "/", the line #444 of tool/rbinstall.rb produce incorrect result
cmd = File.join(File.dirname(cmd), RbConfig.expand(trans[File.basename(cmd)]))
input -> "//bin/erb"
output -> "//bin/erb/"

This bug is related with File.dirname and File.basename behavior like this:
irb(main):005:0> File.dirname("//bin/erb")
=> "//bin/erb"
irb(main):006:0> File.basename("//bin/erb")
=> "/"
irb(main):007:0> File.dirname("/bin/erb")
=> "/bin"
irb(main):008:0> File.basename("/bin/erb")
=> "erb"

#7 [ruby-core:40500] Updated by nobu (Nobuyoshi Nakada) about 7 years ago

Thnk you for figuring out.

Heesob Park wrote:

If you specify configure prefix as "/", the line #444 of tool/rbinstall.rb produce incorrect result
cmd = File.join(File.dirname(cmd), RbConfig.expand(trans[File.basename(cmd)]))
input -> "//bin/erb"
output -> "//bin/erb/"

The input is already wrong, as is a UNC path on Windows.
Can't you try with "--prefix=/."?

#8 [ruby-core:40504] Updated by cfis (Charlie Savage) about 7 years ago

Why is the input wrong? I'm fairly sure this used to work fine...

#9 [ruby-core:40505] Updated by phasis68 (Heesob Park) about 7 years ago

Configuring with "--prefix=/." works fine.

FYI, this issue introduced with r30228.

#10 [ruby-core:40506] Updated by nobu (Nobuyoshi Nakada) about 7 years ago

Nobuyoshi Nakada wrote:

Can't you try with "--prefix=/."?

Or `make install DESTDIR=/some/temporary/path'.

#11 [ruby-core:40507] Updated by nobu (Nobuyoshi Nakada) about 7 years ago

Nobuyoshi Nakada wrote:

Or `make install DESTDIR=/some/temporary/path'.

Sorry, this should not affect.

#12 [ruby-core:40509] Updated by nobu (Nobuyoshi Nakada) about 7 years ago

You can use empty prefix, i.e., `--prefix=', to install them underneath DESTDIR.

#13 [ruby-core:40513] Updated by cfis (Charlie Savage) about 7 years ago

Would be nice if --prefix=/ worked, but --prefix= is ok also. I'm happy to have this closed.

#14 Updated by nobu (Nobuyoshi Nakada) about 7 years ago

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

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


  • tool/rbinstall.rb (install_recursive, bin-comm): split mere string not path name. [Bug #5492]

#15 Updated by nobu (Nobuyoshi Nakada) about 7 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport193
  • Category deleted (build)
  • Status changed from Closed to Assigned
  • Assignee set to yugui (Yuki Sonoda)
  • Priority changed from 5 to 3
  • Target version deleted (1.9.3)

Low priority since the workaround is easy.

#16 Updated by kosaki (Motohiro KOSAKI) almost 7 years ago

  • Status changed from Assigned to Closed

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


merge revision(s) 33566:

* tool/rbinstall.rb (install_recursive, bin-comm): split mere
  string not path name.   [Bug #5492]

Also available in: Atom PDF