Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 238061 - dev-ruby/rubygems fails to handle http_proxy variable without a scheme
Summary: dev-ruby/rubygems fails to handle http_proxy variable without a scheme
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-19 00:53 UTC by Arthur Hagen
Modified: 2009-01-02 16:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Hagen 2008-09-19 00:53:19 UTC
If rubygems is installed, ruby-gettext 1.92.0 fails during installation:

ERROR: dev-ruby/ruby-gettext-1.92.0 failed.
Call stack:
              ebuild.sh, line   49:  Called src_install
            environment, line 2243:  Called gems_src_install
            environment, line 1286:  Called die
The specific snippet of code:
      gem install ${GEM_SRC} --version ${PV} ${myconf} --local --install-dir "${D}/${GEMSDIR}" || die "gem install failed";
 The die message:
  gem install failed



Relevant environment status:
declare -x RUBY="/usr/bin/ruby"
declare -x RUBYOPT="-rauto_gem"


emerge --info:
Portage 2.1.4.4 (default/linux/x86/2008.0/desktop, gcc-3.4.6, glibc-2.6.1-r0, 2.6.23-gentoo-r9 i686)
=================================================================
System uname: 2.6.23-gentoo-r9 i686 mobile AMD Athlon(tm) XP2400+
Timestamp of tree: Fri, 19 Sep 2008 00:05:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-4 -momit-leaf-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon-4 -momit-leaf-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FEATURES="ccache distcc distlocks fixpackages metadata-transfer noinfo sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB en_US en nb_NO nb no"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS=""
PORTAGE_COMPRESS_FLAGS=" "
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://tree.broomstick.com/gentoo-portage"
USE="3dnow X Xaw3d aac acl acpi alsa audiofile berkdb cairo caps cdr cli cracklib crypt cups dbus dri dvd dvdread eds emboss encode esd evo exif fam flac gd gdbm gif gimp gmp gnome gpm gstreamer gtk gtk2 hal iconv idn ipv6 isdnlog jpeg lcms libnotify logrotate lzo mad matroska mbox midi mikmod mmap mmx motif mp3 mpeg mudflap ncurses nfs nis nls nntp nptl nptlonly offensive ogg opengl openmp pam pcre pdf perl pic png posix ppds pppd python qt3support qt4 quicktime readline reflection sdl seamonkey session sndfile spell spl sse ssl startup-notification svg sysfs tcpd threads tiff timidity tk truetype unicode usb vorbis win32codecs x86 xattr xcomposite xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LINGUAS="en_GB en_US en nb_NO nb no" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Version of rubygems installed:  1.1.1 (latest stable for x86)
No problems with previous stable version of ruby-gettext (1.10.0)
Comment 1 Wormo (RETIRED) gentoo-dev 2008-09-19 22:20:06 UTC
Please attach the full build log from the failed attempt.
Comment 2 Arthur Hagen 2008-09-20 01:59:19 UTC
(In reply to comment #1)
> Please attach the full build log from the failed attempt.

"A" failed attempt (it's repeatable):

>>> Unpacking source...
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/dev-ruby/ruby-gettext-1.92.0/work ...
>>> Source compiled.
>>> Test phase [not enabled]: dev-ruby/ruby-gettext-1.92.0

>>> Install ruby-gettext-1.92.0 into /var/tmp/portage/dev-ruby/ruby-gettext-1.92.0/image/ category dev-ruby
ERROR:  While executing gem ... (URI::InvalidURIError)
    can not set user with registry or opaque
 * 
 * ERROR: dev-ruby/ruby-gettext-1.92.0 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_install
 *             environment, line 2243:  Called gems_src_install
 *             environment, line 1286:  Called die
 * The specific snippet of code:
 *       gem install ${GEM_SRC} --version ${PV} ${myconf} --local --install-dir "${D}/${GEMSDIR}" || die "gem install failed";
 *  The die message:
 *   gem install failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/dev-ruby/ruby-gettext-1.92.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-ruby/ruby-gettext-1.92.0/temp/environment'.
 * 
Comment 3 Arthur Hagen 2008-09-20 02:19:07 UTC
Googling some on this, it appears that the real error is in sys-apps/portage-2.1.1.4.  The man page for make.conf states:

       http_proxy ftp_proxy = [host:port]
              These vars are used if the sources must be downloaded  from  the
              internet  by wget(1).  They are only required if you use a proxy
              server for internet access.

This will break rubygems, which isn't as smart as wget and needs the http_proxy variable to include the protocol.

Setting http_proxy to a URI, instead of host:port as per the man page, allows the install to continue.  I'll open a new bug report for this, and request that this one addresses why rubygem would require the proxy server for a local install.  A remote install, yes, I can see certificate checking being useful, but gentoo can't assume that all machines will have internet access.

Comment 4 Arthur Hagen 2008-09-20 02:26:57 UTC
Bug #238157 opened for the http_proxy error.
The problem with requiring internet access for local install remains.
Comment 5 Wormo (RETIRED) gentoo-dev 2008-09-20 05:36:54 UTC
I understand the problem with http_proxy syntax, but what do you mean by "can't assume internet access"? Of course you need internet access to build it -- just like you need internet access to download tarballs for non-gem packages. The only difference is that you can't fetch source separately prior to installing, but that limitation looks difficult to overcome in the gem eclass. Binary packages can be built on a machine with internet and moved to machines without...
Comment 6 Alex Legler (RETIRED) archtester gentoo-dev Security 2008-09-22 17:17:22 UTC
This is actually a rubygems thing, not specifically concerning ruby-gettext only. (So maybe someone modify the summary, please)

During the initial env and options parsing of the `gem' command, the HTTP_PROXY env variable is evaluated as well. Things fail when we provide a so-called "opaque" URI, i.e. when there is no "/" as there would be for instance in "http://foo:8080".
The thing with opaque URIs is that you cannot set a username, but Rubygems tries nonetheless whether or not you specify a user name.

They actually have a method called "normalize_uri" in their source, but that isn't used anywhere. At the same time, upstream explicitly wants a "full HTTP URL" [1] which, in Arthur's case, wasn't provided.
So question is, should we file a bug with upstream or should we sanitize our input according to their specs?

[1] http://www.rubygems.org/read/chapter/13#page51 (chapter 5.10, that is)
Comment 7 Hans de Graaff gentoo-dev Security 2008-09-23 18:30:33 UTC
I think that despite the documentation this might be considered a bug with rubygems, especially since an easy fix is available for it. My vote is for opening a bug for it. We can always see what we can do on our end if the issue is not resolved upstream.
Comment 8 Alex Legler (RETIRED) archtester gentoo-dev Security 2008-09-24 17:30:53 UTC
This bug is fixed in the rubygems and the ruby ebuilds in the overlay.
Also, I filed upstream bug #22151.
Comment 9 Hans de Graaff gentoo-dev Security 2008-11-14 14:00:45 UTC
This has been fixed in CVS with rubygems-1.3.1.
Comment 10 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-01-02 16:18:18 UTC
FYI, upstream fixed this in trunk today, too.