luislavena / mysql-gem

MySQL/Ruby Bindings, wrapped as Gem with improved cross-platform support
http://rubyforge.org/projects/mysql-win
Other
53 stars 20 forks source link

binaries are specific to a MySQL version and cause uninformative segfaults #8

Closed ghazel closed 13 years ago

ghazel commented 13 years ago

http://github.com/oneclick/rubyinstaller/issues/issue/17

The basic issue is that gem only detects the ruby platform, not the MySQL version installed. So, especially now that MySQL 5.1 is stable version, the mysql gem causes uninformative segfaults. Instead, it would be better if the only platform available was "ruby", and compilation was required when the gem was installed (like curb, or countless other gems).

luislavena commented 13 years ago

There is no way to detect the installed version without falling into a platform specific DL code, which we are not going.

Please force the gem installation, the binary gems are offered for convenience to users not having or wanting to have the development kit installed.

This has already been covered in previous ticket and the changes are in the repository:

http://github.com/luislavena/mysql-gem/blob/master/tasks/native.rake#L32-46

ghazel commented 13 years ago

The binaries have been more of an inconvenience than a convenience. Even with the new message I would have to install the devkit and force a compilation of the gem.

If detection and bundling is not an option, please remove the 5.0 linked binaries or at least upgrade to the current version, MySQL 5.1.

luislavena commented 13 years ago

Please, before asking about something, dig into the repository, the work is there, but bugs in mysql itself prevent the compilation of fat binaries for Windows.

Please patch rake-compiler to be able to generate fat-binaries on Windows if you want.

ghazel commented 13 years ago

Fine. Patching rake is obviously a lot of work. Let's discard the idea of making a fat binary.

Instead, it would be more future proof to provide -no- binaries, since at some point 5.1 will be old the same way 5.0 is old today. A message will only serve to inform people later, but they will be stuck in the same situation of needing to compile by hand.

luislavena commented 13 years ago

Patches are welcome.

luislavena commented 13 years ago

RE: rake patching.

The project I'm talking about is rake-compiler:

http://github.com/luislavena/rake-compiler

Patches are welcome.

luislavena commented 13 years ago

Please step in as responsible, try get it working and then complain.

Your comments are not contributing to the project or the time I've invested trying to maintain a project that the own author has declared dead.

ghazel commented 13 years ago

I believe the patch I'm proposing is to not do something, during when you push a new gem. You push the platforms [ruby, x86-mingw32, x86-mswin32]. I would say only push the "ruby" platform. I don't see where this is done explicitly, I imagine it is something done by hand. But, if you point me at where that occurs, I'd be happy to submit a patch.

luislavena commented 13 years ago

Will not push a binary gem for mswin32 on the next release, that way you can continue using One-Click Installer and Visual Studio happily without all the noise, grief and broken experience RubyInstaller is giving you.

Apologizes for all the time you wasted.

ghazel commented 13 years ago

By the way, it is possible to see which MySQL version of the DLL is available to you:

http://dev.mysql.com/doc/refman/5.0/en/mysql-get-client-version.html

So, at runtime you could load the DLL dynamically LoadLibrary/GetProcAddress style, and detect an incorrect version. This would be much more helpful than a segfault.

luislavena commented 13 years ago

You know: you can do it yourself too, patches are welcome.

luislavena commented 13 years ago

You know? you can do it yourself too, patches are welcome.

ghazel commented 13 years ago

Patch created, and pull request submitted: http://github.com/ghazel/mysql-gem/commit/cf2b5f0b9e3c1777eec9f6d451114c8647bcf527