Bug #3024

mkmf: Directory names with spaces cause invalid Makefiles to be generated

Added by Sam Quigley about 4 years ago. Updated over 1 year ago.

[ruby-core:29056]
Status:Closed
Priority:High
Assignee:Nobuyoshi Nakada
Category:-
Target version:2.0.0
ruby -v:ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0] Backport:

Description

=begin
mkmf does not properly quote or escape directory names containing spaces, and thus creates invalid Makefiles. For example, a recent run of mkmf created a Makefile containing:

BINDIR = $(bindir)
RUBYCOMMONDIR = $(sitedir)$(targetprefix)
RUBYLIBDIR = /Users/sq/Code/Third Party/flint/vendor/gems/bcrypt-ruby-2.1.2/lib$(target
prefix)
RUBYARCHDIR = /Users/sq/Code/Third Party/flint/vendor/gems/bcrypt-ruby-2.1.2/lib$(target_prefix)

When make is run, it fails with the following errors:

[...]
make
Makefile:128: warning: overriding commands for target /Users/sq/Code/Third'
Makefile:122: warning: ignoring old commands for target
/Users/sq/Code/Third'
[...]
make install
Makefile:128: warning: overriding commands for target /Users/sq/Code/Third'
Makefile:122: warning: ignoring old commands for target
/Users/sq/Code/Third'
mkdir -p /Users/sq/Code/Third
/opt/local/bin/ginstall -c -m 0755 bcryptext.bundle /Users/sq/Code/Third Party/flint/vendor/gems/bcrypt-ruby-2.1.2/lib
/opt/local/bin/ginstall: omitting directory `/Users/sq/Code/Third'
make: *** [Party/flint/vendor/gems/bcrypt-ruby-2.1.2/lib/bcrypt
ext.bundle] Error 1

This issue (or something very similar) was reported as Ruby bug #2308 on 2005-08-25 here: http://rubyforge.org/tracker/index.php?func=detail&aid=2308&group_id=426&atid=1698
=end


Related issues

Duplicated by ruby-trunk - Bug #7036: Compiling extensions with Ruby in a path with spaces Closed 09/18/2012

History

#1 Updated by Yusuke Endoh about 4 years ago

=begin
Hi,

2010/3/27 Sam Quigley redmine@ruby-lang.org:

mkmf does not properly quote or escape directory names containing spaces, and thus creates invalid Makefiles.

Thank you for your reporting and investigating.

I think this is absolutely a bug. But, I'm afraid that it takes
some time to fix and make it stable this kind of bugs.
Even if it seems to be fixed, hard-to-find regression bug might be
included, which leads to build failure of existing libraries on
some envirionments.

In addition, this issue can be avoided easily by avoiding such a
path that is likely to cause problem.

So, I think we should not fix it hurriedly. I suggest to defer
this ticket to 1.9.3.

--
Yusuke ENDOH mame@tsg.ne.jp

=end

#2 Updated by Yusuke Endoh about 4 years ago

  • Target version set to 2.0.0

=begin

=end

#3 Updated by Yui NARUSE almost 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

#4 Updated by Hiroshi Nakamura almost 3 years ago

  • Target version changed from 2.0.0 to 1.9.3

#5 Updated by Yusuke Endoh over 1 year ago

  • Priority changed from Normal to High
  • Target version changed from 1.9.3 to 2.0.0

Nobu, could you check this?

Yusuke Endoh mame@tsg.ne.jp

#6 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF