Bugs item #29176, was opened at 2011-05-06 13:07
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29176&group_id=126

Category: `gem` commands (other)
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Alex Chaffee (alexch)
Assigned to: Ryan Davis (zenspider)
Summary: Scary warnings are scaring helpless developers who can't do a thing 
about it

Initial Comment:
Suddenly anyone using "gem" is seeing many repetitions of lines like this:

NOTE: Gem::Specification#default_executable= is deprecated with no replacement. 
It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from 
/Users/chaffee/.rvm/gems/ruby-1.9.2-p0/specifications/thin-1.2.7.gemspec:10.

Many of my students are completely freaking out since something that's supposed 
to just work -- e.g. "gem install rails" or "gem list"-- is now spewing a huge 
amount of scary noise about things which are currently working just fine, and 
which they have no ability to affect. Even developers with the acumen to be 
able to read, understand, and react to these messages are wasting time 
googling, often fruitlessly, since even if they find Ryan's blog post, and run 
"gem pristine --all --no-extensions", it doesn't make all the warnings 
disappear.

Here's my suggested fix, in three independent parts. 

1. Stop repeating the same message again and again; instead set a global flag 
(already_scared_user?) and STFU if it happens for a different gem
2. Put the advice about running "gem pristine --all --no-extensions" in the 
error message instead of forcing people to google to find a workaround
3. Before the warning, try to rewrite the offending gemfile yourself, as if the 
user had run "gem pristine". If the rewrite fails, only then scare the user.

And please remember that the "gem" command is the user interface to the entire 
world of Ruby development, for people of all experience levels. You have a 
responsibility not to scare off our friends, new and old.



----------------------------------------------------------------------

>Comment By: Ryan Davis (zenspider)
Date: 2011-05-08 01:56

Message:
No worries.

----------------------------------------------------------------------

Comment By: Justin Collins (presidentbeef)
Date: 2011-05-07 23:57

Message:
Sorry, my mistake. I didn't notice that gem was called out specifically.

----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2011-05-07 23:54

Message:
Justin,

As described at http://blog.zenspider.com/2011/05/rubygems-18-is-coming.html 
and elsewhere, rake is one of those unfortunate gems that explicitly uses the 
deprecated API in their gemspec. Please file a bug on the rake bug tracker.

----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2011-05-07 23:53

Message:
Loren,

Get off this ticket.

Everything you just described falls outside of the scope of this ticket. 
Specifically: "helpless developers".

The point of having deprecations at all is to get those "hundreds" of libraries 
that use deprecated API to update their code.

If you want to "me too", then yippie... but your hyperbole isn't a "me too" it 
is a completely separate issue (and one I will more readily reject).

----------------------------------------------------------------------

Comment By: Justin Collins (presidentbeef)
Date: 2011-05-07 23:19

Message:
I did a fresh install of 1.9.2 with rvm, then upgraded Ruby Gems. The only gem 
installed was "rake", and after running "gem pristine --all", "gem pristine 
--all --no-extensions", and "gem pristine rake", I still get the following 
error:

NOTE: Gem::Specification#default_executable= is deprecated with no replacement. 
It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from 
/home/justin/.rvm/gems/ruby-1.9.2-p180@global/specifications/rake-0.8.7.gemspec:10.

----------------------------------------------------------------------

Comment By: Loren Segal (lsegal)
Date: 2011-05-07 22:40

Message:
I have to agree with the severity of this issue. The problem is unfortunately 
not just limited to the `gem` binary. Any library making use of deprecated APIs 
will also get these warnings ad-infintum, so gem pristinie --all doesn't solve 
this issue, only small one part of it. 

For example, any gem that makes use of SourceIndex will see these deprecation 
warnings on each usage. There are currently hundreds of libraries that make use 
of this class, as per my latest search on codesearch: 
http://codesearch.google.com/codesearch?q=SourceIndex+lang:ruby and 
http://codesearch.google.com/codesearch?q=Gem.source_index+lang%3Aruby

You might get lucky and just see a few of these warnings, but if the method is 
called within a loop, RubyGems will not be forgiving, and spam you many, many, 
times (see 
http://codesearch.google.com/codesearch/p?hl=en#L18QHnAzSFA/bin/minigem&q=Gem.source_index%20lang:ruby&sa=N&cd=46&ct=rc
 for just one random example). In some cases, this output may even render the 
lib/tool completely unusable, especially if it relies heavily on console 
output. Because of that possibility, an otherwise innocuous (and transitional) 
warning can become a "severe" compatibility bug. Just like Alex, I'm all for 
warnings, but I foresee a lot of developers scrambling to provide fixes for 
their users in the coming months, especially in the cases where their tools 
start scrolling pages of warnings just because of one method call. I'm not sure 
devs or users will be too happy about this.

Fortunately the fix is simple, as Alex pointed pointed out. I think it would be 
sensible to add the suggested "already_scared_user?" flag; it can probably be 
done on a per method name granularity. Given that all of the deprecations are 
wrapped inside a Deprecation module AFAIK(?), this should be pretty simple to 
add.

----------------------------------------------------------------------

Comment By: Luis Lavena (luislavena)
Date: 2011-05-06 15:04

Message:
Which gem was not solved by gem pristine --all? please provide complete output, 
we can't help without the output.

As for drowning on this issue: revert back to 1.7.2

There is no easy way to solve existing gem specifications without doing gem 
pristine --all

And we can't help solve the others without people telling us which ones didn't 
get fixed for us to look at *why*.

So, I know were are you coming from, heck, I work on Windows, what more weird 
scenario for failures could be than that? And even so, gem pristine --all 
solved all the issues.

Help us help you.


----------------------------------------------------------------------

Comment By: Alex Chaffee (alexch)
Date: 2011-05-06 14:41

Message:
Luis - thanks, "gem pristine -all" has fixed most -- but still not quite all -- 
of 
the messages.

Warnings are indeed good, but only until they become noise. That is extra bad 
since it can drown out other important information, especially for less 
experienced people who are mystified by everything coming down on the 
console.

One reason I'm concerned about this is that tonight in two different cities 
we're doing a Railsbridge Ruby For Women Workshop Install Fest, and most of 
the students won't understand what's going on, and the volunteers may not 
either. This will add chaos to an already chaotic and frustrating session. Not 
your problem, I know, but I wanted you to know where I'm coming from.

----------------------------------------------------------------------

Comment By: Luis Lavena (luislavena)
Date: 2011-05-06 13:38

Message:
gem pristine --all --no-extensions will fix the gems that do not have extensions

You need to do gem pristine -all, but that will not accept parameters for each 
gem.

In my case I didn't require additional parameters to each gem so a simple gem 
pristine --all solved all the warnings.

Warnings are good, and as always, you can rollback to previous versions if you 
find it doesn't work for you:

gem update --system 1.7.2


----------------------------------------------------------------------

Comment By: Alex Chaffee (alexch)
Date: 2011-05-06 13:27

Message:
I wasn't trying to be inflammatory. This is a real problem, wasting the real 
time 
of real people across the world. 

And I'd be happy to submit a patch but somehow it doesn't seem likely you'd 
accept it.



----------------------------------------------------------------------

Comment By: Erik Hollensbe (erikh)
Date: 2011-05-06 13:22

Message:
Really? Don't you have anything better to do than to post inflammatory shit to 
this tracker?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29176&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to