Chef

RubyGems 1.3.7 will introduce an issue where Chef's gem_package won't be able to install arch-specific packages

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 0.8.10
  • Fix Version/s: 0.9.0
  • Component/s: Chef Client
  • Labels:
    None
  • Environment:

    RubyGems 1.3.7.pre.1

  • Triage Status:
    Triaged

Description

Activity

Hide
Daniel DeLeo added a comment - 01/May/10 4:44 PM

Corey's twitter report mention that the format of gem list is going to be different and our regex to check for installed versions won't work anymore.

Show
Daniel DeLeo added a comment - 01/May/10 4:44 PM Corey's twitter report mention that the format of gem list is going to be different and our regex to check for installed versions won't work anymore.
Hide
Daniel DeLeo added a comment - 02/May/10 11:55 PM

I've installed the prerelease 1.3.7 on one of my rvm rubies. The exact issue AFAICT is that the format of gem list --remote shows available arches. For example:

gem list --remote nokogiri

*** REMOTE GEMS ***

nokogiri (1.4.1 ruby java x86-mingw32 x86-mswin32)

In IRB using backticks, I get shorter output, but still see the arch stuff:

irb(main):001:0> `gem list --remote nokogiri`
=> "nokogiri (1.4.1 ruby java x86-mingw32 x86-mswin32)\nnokogiri-happymapper (0.3.3)\n"
Show
Daniel DeLeo added a comment - 02/May/10 11:55 PM I've installed the prerelease 1.3.7 on one of my rvm rubies. The exact issue AFAICT is that the format of gem list --remote shows available arches. For example:
gem list --remote nokogiri

*** REMOTE GEMS ***

nokogiri (1.4.1 ruby java x86-mingw32 x86-mswin32)
In IRB using backticks, I get shorter output, but still see the arch stuff:
irb(main):001:0> `gem list --remote nokogiri`
=> "nokogiri (1.4.1 ruby java x86-mingw32 x86-mswin32)\nnokogiri-happymapper (0.3.3)\n"
Hide
Daniel DeLeo added a comment - 03/May/10 4:27 AM

Fixed the regular expression that parses gem list output, now it looks like this:

/^#{@new_resource.package_name} \((.+?)(?: [^\)\.]+)?\)$/

This will work as long as no platforms have dots in the name.

http://github.com/danielsdeleo/chef/tree/CHEF-1168

Show
Daniel DeLeo added a comment - 03/May/10 4:27 AM Fixed the regular expression that parses gem list output, now it looks like this:
/^#{@new_resource.package_name} \((.+?)(?: [^\)\.]+)?\)$/
This will work as long as no platforms have dots in the name. http://github.com/danielsdeleo/chef/tree/CHEF-1168
Hide
Daniel DeLeo added a comment - 03/May/10 4:36 AM

I pushed the fix to master, with updated specs to prevent regression.

Show
Daniel DeLeo added a comment - 03/May/10 4:36 AM I pushed the fix to master, with updated specs to prevent regression.
Hide
Daniel DeLeo added a comment - 16/May/10 5:42 PM

The fix applied in 0.8.14 does not work on gems that have different versions for different architectures. The MySQL gem, for example, looks like this in gem list remote

mysql (2.8.1 ruby x86-mingw32 x86-mswin32, 2.7.3 mswin32)

The provider needs to be updated to handle this case.

Show
Daniel DeLeo added a comment - 16/May/10 5:42 PM The fix applied in 0.8.14 does not work on gems that have different versions for different architectures. The MySQL gem, for example, looks like this in gem list remote
mysql (2.8.1 ruby x86-mingw32 x86-mswin32, 2.7.3 mswin32)
The provider needs to be updated to handle this case.
Hide
Eric Hodel added a comment - 19/May/10 8:40 PM

Why aren't you using the RubyGems API?

The output of `gem` is designed to be human-friendly first and script-friendly second. In the future this may break again.

Show
Eric Hodel added a comment - 19/May/10 8:40 PM Why aren't you using the RubyGems API? The output of `gem` is designed to be human-friendly first and script-friendly second. In the future this may break again.
Hide
James Tucker added a comment - 19/May/10 9:00 PM

ruby -rubygems -e "y Gem.source_index.map { |g, _| g }"

Or from inside of rake:

sh Gem.ruby, "-rubygems", "-e", "Gem.source_index.map { |g, _| g }"

Show
James Tucker added a comment - 19/May/10 9:00 PM ruby -rubygems -e "y Gem.source_index.map { |g, _| g }" Or from inside of rake: sh Gem.ruby, "-rubygems", "-e", "Gem.source_index.map { |g, _| g }"
Hide
Chad Woolley added a comment - 23/May/10 10:50 AM

Discussion of RubyGems API usage in this thread:

http://rubyforge.org/pipermail/rubygems-developers/2010-May/005418.html

Show
Chad Woolley added a comment - 23/May/10 10:50 AM Discussion of RubyGems API usage in this thread: http://rubyforge.org/pipermail/rubygems-developers/2010-May/005418.html
Hide
Chad Woolley added a comment - 23/May/10 12:20 PM

Current behavior is still broken for mysql gem, patch here:

http://github.com/thewoolleyman/chef/tree/CHEF-1168

Still doesn't use RubyGems API, but it works for mysql gem now.

Show
Chad Woolley added a comment - 23/May/10 12:20 PM Current behavior is still broken for mysql gem, patch here: http://github.com/thewoolleyman/chef/tree/CHEF-1168 Still doesn't use RubyGems API, but it works for mysql gem now.
Hide
Daniel DeLeo added a comment - 08/Jun/10 6:04 AM

This is fixed by CHEF-349.

Thanks for the patch Chad, we just chose to go the gems ruby api route as the rubygems team says the output format of the gem commands is subject to frequent change :/

Show
Daniel DeLeo added a comment - 08/Jun/10 6:04 AM This is fixed by CHEF-349. Thanks for the patch Chad, we just chose to go the gems ruby api route as the rubygems team says the output format of the gem commands is subject to frequent change :/

People

Vote (1)
Watch (3)

Dates

  • Created:
    01/May/10 7:49 AM
    Updated:
    08/Jun/10 6:04 AM
    Resolved:
    08/Jun/10 6:04 AM