Project

General

Profile

Actions

Backport #5492

closed

MinGW Installation with Ruby 1.9.3rc1 Broken

Added by cfis (Charlie Savage) over 12 years ago. Updated over 12 years ago.

Status:
Closed
[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.

Updated by jonforums (Jon Forums) over 12 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.

Updated by cfis (Charlie Savage) over 12 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

Updated by jonforums (Jon Forums) over 12 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 `<top (required)>':
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

Updated by phasis68 (Heesob Park) over 12 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"

Updated by nobu (Nobuyoshi Nakada) over 12 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=/."?

Updated by cfis (Charlie Savage) over 12 years ago

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

Updated by phasis68 (Heesob Park) over 12 years ago

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

FYI, this issue introduced with r30228.

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

Nobuyoshi Nakada wrote:

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

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

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

Nobuyoshi Nakada wrote:

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

Sorry, this should not affect.

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

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

Updated by cfis (Charlie Savage) over 12 years ago

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

Actions #14

Updated by nobu (Nobuyoshi Nakada) over 12 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. [ruby-core:40462] [Bug #5492]
Actions #15

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master 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.

Actions #16

Updated by kosaki (Motohiro KOSAKI) over 12 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.  [ruby-core:40462] [Bug #5492]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0