https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112009-07-07T18:18:47ZRuby Issue Tracking SystemRuby master - Bug #1728: gem installed binaries don't honor program-suffixhttps://bugs.ruby-lang.org/issues/1728?journal_id=45122009-07-07T18:18:47Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li><li><strong>Assignee</strong> set to <i>drbrain (Eric Hodel)</i></li></ul><p>=begin<br>
Use gem install --format-executable.</p>
<p>You can make this the default by setting in ~/.gemrc</p>
<p>install: --format-executable<br>
update: --format-executable<br>
=end</p> Ruby master - Bug #1728: gem installed binaries don't honor program-suffixhttps://bugs.ruby-lang.org/issues/1728?journal_id=45132009-07-07T21:41:57Zdocwhat (Christian Höltje)docwhat@gmail.com
<ul></ul><p>=begin<br>
Why isn't that the default, then?<br>
=end</p> Ruby master - Bug #1728: gem installed binaries don't honor program-suffixhttps://bugs.ruby-lang.org/issues/1728?journal_id=45142009-07-07T21:54:13Zrue (Eero Saynatkari)
<ul></ul><p>=begin<br>
Excerpts from rubymine message of Tue Jul 07 15:42:01 +0300 2009:</p>
<blockquote>
<p>Issue <a class="issue tracker-1 status-6 priority-4 priority-default closed" title="Bug: gem installed binaries don't honor program-suffix (Rejected)" href="https://bugs.ruby-lang.org/issues/1728">#1728</a> has been updated by Christian Höltje.</p>
<p>Why isn't that the default, then?</p>
</blockquote>
<p>Personally, I would expect the suffix to only affect the<br>
programs installed by that script, not "child" programs<br>
thereof.</p>
<p>I think the current solution is correct, although it would<br>
not hurt if the Gem option were a bit more prominent. I am<br>
not very well versed in such Gem "internals," so I cannot<br>
say whether it is a well-known flag.</p>
<a name="Eero"></a>
<h2 >Eero<a href="#Eero" class="wiki-anchor">¶</a></h2>
<p>Magic is insufficiently advanced technology.</p>
<p>=end</p> Ruby master - Bug #1728: gem installed binaries don't honor program-suffixhttps://bugs.ruby-lang.org/issues/1728?journal_id=45162009-07-07T22:45:25Zdocwhat (Christian Höltje)docwhat@gmail.com
<ul></ul><p>=begin<br>
Eero said in comment #3:</p>
<blockquote>
<p>Personally, I would expect the suffix to only affect the<br>
programs installed by that script, not "child" programs<br>
thereof.</p>
</blockquote>
<p>I think the default should cause the least amount of confusion possible.</p>
<p>The most common use-case for --program-suffix is if you install multiple versions of ruby. In that case, making --format-executable the default makes lots of sense. Otherwise when you install a gem with binaries you won't know which version you're running!</p>
<p>What would the use-case be for using --program-suffix and not having format-executable be the default?</p>
<p>The closest I can think of is someone using some distribution that has ruby1.8 as the default and ruby1.9 with --program-suffix. A user might become confused if they <em>only</em> install ruby1.9... but that is really the distro's problem to educate the user -- they already have to explain why there isn't a "ruby" command (it's actually "ruby1.9"); having to explain why "gem1.9 install ZenTest" creates "autotest1.9" instead of "autotest" isn't that big a deal.</p>
<p>Plus, we could have gem actually print a message saying what it is doing in this case.</p>
<p>Ciao!<br>
=end</p> Ruby master - Bug #1728: gem installed binaries don't honor program-suffixhttps://bugs.ruby-lang.org/issues/1728?journal_id=45172009-07-07T23:30:18Zdocwhat (Christian Höltje)docwhat@gmail.com
<ul></ul><p>=begin<br>
I talked with a friend and I realized I'm not explaining this very well. Let me try again.</p>
<p>The reason --format-executable should default to on is because the binaries created by "gem" have the name of the "ruby" tied to that version of "gem".</p>
<p>Here's two uses cases in full:<br>
----use case 1-----------------------<br>
I install ruby 1.8.</p>
<p>I use "./configure" when compiling it.<br>
The binaries are in /usr/bin/ and do not have a suffix.</p>
<p>I decide I want to work on ruby 1.9.1 as well.<br>
I use "./configure --program-suffix=19" when compiling it.<br>
The binaries are also in /usr/bin but all end with "19", such as "/usr/bin/ruby19".</p>
<p>Lets say I ZenTest for 1.8:<br>
$ gem install ZenTest</p>
<p>This creates /usr/bin/autotest. This executable is intimately tied to ruby 1.8; it begins with "#!/usr/bin/ruby -ws" -- it cannot be used for ruby 1.9 (yet) because the libraries are not installed in ruby 1.9 and the executable it points to is the 1.8 executable.</p>
<p>Now lets say I want to install autotest for ruby 1.9:<br>
$ gem19 install ZenTest</p>
<p>By default, no new binaries are created since they already exists.</p>
<p>The executable /usr/bin/autotest is <em>still</em> tied to ruby 1.8.</p>
<a name="This-causes-confusion-by-the-user-they-just-installed-autotest-for-ruby-19-but-it-still-is-running-ruby-18"></a>
<h2 >This causes confusion by the user; they just installed autotest for ruby 1.9 but it still is running ruby 1.8.<a href="#This-causes-confusion-by-the-user-they-just-installed-autotest-for-ruby-19-but-it-still-is-running-ruby-18" class="wiki-anchor">¶</a></h2>
<p>----use case 2-----------------------<br>
My system administrator installs ruby 1.8 using "./configure" with no arguments.<br>
My system administrator installs ruby 1.9.1 using "./configure --program-suffix=19"</p>
<p>I (a non-system-administrator) wants to install ZenTest for both:<br>
$ gem install ZenTest<br>
[output showing it is installed to ~/.gem]<br>
$ gem19 install ZenTest<br>
[output showing it is installed to ~/.gem]</p>
<p>So now I have two "autotest" binaries:<br>
~/.gem/ruby/1.8/bin/autotest<br>
and<br>
~/.gem/ruby/1.9.1/bin/autotest</p>
<a name="If-my-PATH-includes-both-then-which-autotest-I-get-depends-on-my-PATH-order-The-only-way-I-can-distinguish-between-the-two-executables-is-by-changing-my-PATH-on-the-fly-Not-very-useful-if-I-want-to-be-able-to-easily-switch-between-both-versions-to-verify-it-works-in-both-versions-of-Ruby"></a>
<h2 >If my PATH includes both, then which "autotest" I get depends on my PATH order. The only way I can distinguish between the two executables is by changing my PATH on the fly. Not very useful if I want to be able to easily switch between both versions to verify it works in both versions of Ruby.<a href="#If-my-PATH-includes-both-then-which-autotest-I-get-depends-on-my-PATH-order-The-only-way-I-can-distinguish-between-the-two-executables-is-by-changing-my-PATH-on-the-fly-Not-very-useful-if-I-want-to-be-able-to-easily-switch-between-both-versions-to-verify-it-works-in-both-versions-of-Ruby" class="wiki-anchor">¶</a></h2>
<p>I think that without --format-executable as a default, this is too confusing for a normal user.</p>
<p>I agree that a --no-format-executable option should be kept around, though. Choice is good.</p>
<p>Ciao!</p>
<p>=end</p> Ruby master - Bug #1728: gem installed binaries don't honor program-suffixhttps://bugs.ruby-lang.org/issues/1728?journal_id=45192009-07-08T03:17:53Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul></ul><p>=begin<br>
Can this discussion be moved to the rubygems-developers mailing list? It's the best place to discuss it.</p>
<p><a href="http://rubyforge.org/mailman/listinfo/rubygems-developers" class="external">http://rubyforge.org/mailman/listinfo/rubygems-developers</a><br>
=end</p>