Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backslashes do not work in paths #16

Closed
ghazel opened this issue Jul 13, 2010 · 13 comments
Closed

backslashes do not work in paths #16

ghazel opened this issue Jul 13, 2010 · 13 comments

Comments

@ghazel
Copy link

ghazel commented Jul 13, 2010

Using backslashes, as Windows paths do, in the arguments to an extconf.rb causes compilation failures. Substituting forward slashes works, but is quite time consuming, and not exactly native. Example:

S:\>gem install ghazel-slim-attributes --version ">= 0.7.6.1" -- --with-mysql-dir="c:\Progra~2\MySQL\MYSQLS~1.1" --with-mysql-lib="c:\Progra~2\MySQL\MYSQLS~1.1\lib\opt"
Building native extensions.  This could take a while...
ERROR:  Error installing ghazel-slim-attributes:
        ERROR: Failed to build gem native extension.

C:/Ruby187/bin/ruby.exe extconf.rb --with-mysql-dir=c:\Progra~2\MySQL\MYSQLS~1.1 --with-mysql-lib=c:\Progra~2\MySQL\MYSQLS~1.1\lib\opt
checking for main() in -llibmysql... yes
creating Makefile

make
gcc -I. -I. -IC:/Ruby187/lib/ruby/1.8/i386-mingw32 -I. -Ic:\Progra~2\MySQL\MYSQLS~1.1/include    -g -O2 -DFD_SETSIZE=256    -c slim_attrib_ext.c
slim_attrib_ext.c:12:19: mysql.h: No such file or directory
slim_attrib_ext.c:13:20: errmsg.h: No such file or directory
slim_attrib_ext.c:14:26: mysqld_error.h: No such file or directory
slim_attrib_ext.c:29: error: syntax error before "MYSQL_RES"
slim_attrib_ext.c:29: warning: no semicolon at end of struct or union
slim_attrib_ext.c:31: error: syntax error before '}' token
slim_attrib_ext.c: In function `all_hashes':
slim_attrib_ext.c:48: error: `MYSQL_RES' undeclared (first use in this function)
slim_attrib_ext.c:48: error: (Each undeclared identifier is reported only once
slim_attrib_ext.c:48: error: for each function it appears in.)
slim_attrib_ext.c:48: error: `res' undeclared (first use in this function)
slim_attrib_ext.c:48: error: dereferencing pointer to incomplete type
slim_attrib_ext.c:49: error: `MYSQL_FIELD' undeclared (first use in this function)
slim_attrib_ext.c:49: error: `fields' undeclared (first use in this function)
slim_attrib_ext.c:50: error: `MYSQL_ROW' undeclared (first use in this function)
slim_attrib_ext.c:50: error: syntax error before "row"
slim_attrib_ext.c:52: error: `my_ulonglong' undeclared (first use in this function)
slim_attrib_ext.c:52: error: syntax error before "nr"
slim_attrib_ext.c:65: error: `nr' undeclared (first use in this function)
slim_attrib_ext.c:68: error: `row' undeclared (first use in this function)
slim_attrib_ext.c:69: warning: assignment makes pointer from integer without a cast
make: *** [slim_attrib_ext.o] Error 1


Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/ghazel-slim-attributes-0.7.6.1 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/ghazel-slim-attributes-0.7.6.1/ext/gem_make.out

However:

S:\>gem install ghazel-slim-attributes --version ">= 0.7.6.1" -- --with-mysql-dir="c:/Progra~2/MySQL/MYSQLS~1.1" --with-mysql-lib="c:/Progra~2/MySQL/MYSQL
S~1.1/lib/opt"
Building native extensions.  This could take a while...
Successfully installed ghazel-slim-attributes-0.7.6.1
1 gem installed
Installing ri documentation for ghazel-slim-attributes-0.7.6.1...
Installing RDoc documentation for ghazel-slim-attributes-0.7.6.1...    
@luislavena
Copy link
Member

This is a Ruby Issue, not RubyInstaller.

Please identify that issues with the Development Kit (like missing a header or tool from GCC) and incorrect packaging of a Ruby version or anything related to the packages and the installer fits into RubyInstaller.

We try not to deviate from Ruby vanilla distribution, and if this issue is present in Ruby itself, should be discussed there, not here.

Thank you.

@ghazel
Copy link
Author

ghazel commented Jul 13, 2010

But this is a DevKit bug. Using the MSVC6 version of Ruby, this problem does not occur:

S:\>ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]

S:\>gem install ghazel-slim-attributes --version ">= 0.7.6.1" -- --with-mysql-dir="c:\Progra~2\MySQL\MYSQLS~1.1" --with-mysql-lib="c:\Progra~2\MySQL\MYSQLS~1.1\lib\opt"
Building native extensions.  This could take a while...
Successfully installed ghazel-slim-attributes-0.7.6.1
1 gem installed
Installing ri documentation for ghazel-slim-attributes-0.7.6.1...
Installing RDoc documentation for ghazel-slim-attributes-0.7.6.1...

@luislavena
Copy link
Member

Is not the devkit, is something from RbConfig and mkmf

@vertiginous
Copy link
Member

Rubyinstaller doesn't write the devkit software, we only repackage it for simplicity. These path seperators are standard for mingw/msys.

http://www.mingw.org/wiki/IncludePathHOWTO

If you consider it a bug, you could submit it to that project.

http://www.mingw.org/Reporting_Bugs

@ghazel
Copy link
Author

ghazel commented Jul 13, 2010

So how do RbConfig and mkmf handle this properly with the MSVC6 version?

The way I read it, those are passing the paths through, and the shell where gcc is being executed does not handle backslashes.

@ghazel
Copy link
Author

ghazel commented Jul 13, 2010

I'll file the bug with mingw, but I am not hopefully about this approach.

Strangely enough, executing gcc directly with backslashes works fine. It's when it is run through Make that it fails:

c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext>dir *.o
 Volume in drive C is Windows7_OS
 Volume Serial Number is 20E2-67EC

 Directory of c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext

File Not Found

c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext>make
gcc -I. -I. -IC:/Ruby187/lib/ruby/1.8/i386-mingw32 -I. -Ic:\Progra~2\MySQL\MYSQLS~1.1/include    -g -O2 -DFD_SETSIZE=256    -c slim_attrib_ext.c
slim_attrib_ext.c:12:19: mysql.h: No such file or directory
slim_attrib_ext.c:13:20: errmsg.h: No such file or directory
slim_attrib_ext.c:14:26: mysqld_error.h: No such file or directory
slim_attrib_ext.c:29: error: syntax error before "MYSQL_RES"
slim_attrib_ext.c:29: warning: no semicolon at end of struct or union
slim_attrib_ext.c:31: error: syntax error before '}' token
slim_attrib_ext.c: In function `all_hashes':
slim_attrib_ext.c:48: error: `MYSQL_RES' undeclared (first use in this function)
slim_attrib_ext.c:48: error: (Each undeclared identifier is reported only once
slim_attrib_ext.c:48: error: for each function it appears in.)
slim_attrib_ext.c:48: error: `res' undeclared (first use in this function)
slim_attrib_ext.c:48: error: dereferencing pointer to incomplete type
slim_attrib_ext.c:49: error: `MYSQL_FIELD' undeclared (first use in this function)
slim_attrib_ext.c:49: error: `fields' undeclared (first use in this function)
slim_attrib_ext.c:50: error: `MYSQL_ROW' undeclared (first use in this function)
slim_attrib_ext.c:50: error: syntax error before "row"
slim_attrib_ext.c:52: error: `my_ulonglong' undeclared (first use in this function)
slim_attrib_ext.c:52: error: syntax error before "nr"
slim_attrib_ext.c:65: error: `nr' undeclared (first use in this function)
slim_attrib_ext.c:68: error: `row' undeclared (first use in this function)
slim_attrib_ext.c:69: warning: assignment makes pointer from integer without a cast
make: *** [slim_attrib_ext.o] Error 1

c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext>dir *.o
 Volume in drive C is Windows7_OS
 Volume Serial Number is 20E2-67EC

 Directory of c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext

File Not Found

c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext>gcc -I. -I. -IC:/Ruby187/lib/ruby/1.8/i386-mingw32 -I. -Ic:\Progra~2\MySQL\MYSQLS~1.1/include    -g -O2 -DFD_SETSIZE=256    -c slim_attrib_ext.c

c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext>dir *.o
 Volume in drive C is Windows7_OS
 Volume Serial Number is 20E2-67EC

 Directory of c:\Ruby187\lib\ruby\gems\1.8\gems\ghazel-slim-attributes-0.7.6.1\ext

07/13/2010  02:35 PM           413,140 slim_attrib_ext.o
               1 File(s)        413,140 bytes
               0 Dir(s)  76,642,385,920 bytes free

@luislavena
Copy link
Member

Make is msys make, not mingw one.

MinGW one works fine, as you discovered, however, after lot of investigation and testing, none of the gems or even Ruby itself compiled with MinGW make.

Because of that, the reason was to stick to msys-make.

That do not solve your problem, but the reasoning behind that was a bigger than just a personal taste.

@vertiginous
Copy link
Member

Oh, pardon my ignorance. I thought mingw and msys make were one and the same.

@ghazel
Copy link
Author

ghazel commented Jul 13, 2010

So, where do I file bugs about MSYS Make?

@ghazel
Copy link
Author

ghazel commented Jul 19, 2010

As I suspected, MSYS Make considers this not a bug:
https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3029164&group_id=2435

@ghazel
Copy link
Author

ghazel commented Jul 21, 2010

So, the MSYS team declares very strongly that MSYS Make should not be used from the Windows command line, because it makes no attempt to be compatible with Windows command line arguments, escaping or paths.

What were the issues with MinGW make exactly?

@luislavena
Copy link
Member

Ruby didn't like it since we used *nix'ism configure & friends.

We could try using MinGW make, it is a simple replacement in the building recipes.

Do you want to try it?

@ghazel
Copy link
Author

ghazel commented Jul 21, 2010

Yeah, let's give it a spin and see what the errors are.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants