[Rubygems-developers] rubygems passing ARGV to extension builders breaks usage via API

Chad Woolley thewoolleyman at gmail.com
Thu Sep 18 19:23:36 EDT 2008


When building native gems, Rubygems does this:

* in the gem binary, if there is a '--' arg, it clones ARGV to
preserve the options
* Eventually, the extension builders like ext/ext_conf_builder.rb and
ext/rake_builder.rb passes the unmodified ARGV in.

This causes problems when RubyGems is invoked via the GemRunner API
(which happens after the binary), because there is no way to set ARGV
(and you shouldn't have to anyway).

I believe the right way to fix this would be to:

1. move the code to stash all args after '--' into GemRunner
2. Make it stash the args somewhere and eventually pass it down to the
ext builders
3. make the ext builders use these args instead of using ARGV directly

This is a problem for my project, and I believe it will be a problem
for Rails too - when they remove the built-in mysql support in the
near future and require the mysql gem to be used, there will be no way
for config.gems to programatically pass options to the mysql gem
build, which is usually required.

-- Chad

More information about the Rubygems-developers mailing list