NetBSD Problem Report #43865

From www@NetBSD.org  Fri Sep 10 20:24:28 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id AF9F463BCCF
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 10 Sep 2010 20:24:28 +0000 (UTC)
Message-Id: <20100910202428.7902063BCBE@www.NetBSD.org>
Date: Fri, 10 Sep 2010 20:24:28 +0000 (UTC)
From: explorer@netbsd.org
Reply-To: explorer@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: recent ruby upgrade broke some things (ruby-postgresql specifically)
X-Send-Pr-Version: www-1.0

>Number:         43865
>Category:       pkg
>Synopsis:       recent ruby upgrade broke some things (ruby-postgresql specifically)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    taca
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 10 20:25:00 +0000 2010
>Closed-Date:    Wed Sep 22 04:17:00 +0000 2010
>Last-Modified:  Wed Sep 22 04:17:00 +0000 2010
>Originator:     Michael Graff
>Release:        5.1-RC mumble
>Organization:
>Environment:
>Description:
===> Installing dependencies for ruby18-postgresql-0.7.9.2008.01.28nb1
==========================================================================
The following variables will affect the build process of this package,
ruby18-postgresql-0.7.9.2008.01.28nb1.  Their current value is shown below:

        * BDB185_DEFAULT = db1
        * BDB_DEFAULT = db4
        * SSLBASE = /usr
        * SSLCERTS = /etc/openssl/certs
        * SSLDIR = /etc/openssl
        * SSLKEYS = /etc/openssl/private

Based on these variables, the following variables have been set:

        * BDBBASE = /usr
        * BDB_LIBS (defined, but empty)
        * BDB_TYPE = db1

You may want to abort the process now with CTRL-C and change their value
before continuing.  Be sure to run `/usr/bin/make clean' after
the changes.
==========================================================================
=> Build dependency ruby18-rubygems>=1.1.0: found ruby18-rubygems-1.3.5nb3
=> Full dependency ruby18-rubygems>=1.0.1: found ruby18-rubygems-1.3.5nb3
=> Full dependency ruby18-base>=1.8.7: found ruby18-base-1.8.7.302
=> Full dependency postgresql84-client>=8.4.2nb1: found postgresql84-client-8.4.4
===> Overriding tools for ruby18-postgresql-0.7.9.2008.01.28nb1
===> Extracting for ruby18-postgresql-0.7.9.2008.01.28nb1
Unpacked gem: '/local/pkgsrc-build/databases/ruby-postgresql/work.plaid/postgres-0.7.9.2008.01.28'
===> Patching for ruby18-postgresql-0.7.9.2008.01.28nb1
=> Applying pkgsrc patches for ruby18-postgresql-0.7.9.2008.01.28nb1
===> Creating toolchain wrappers for ruby18-postgresql-0.7.9.2008.01.28nb1
===> Configuring for ruby18-postgresql-0.7.9.2008.01.28nb1
chmod -R g-w /local/pkgsrc-build/databases/ruby-postgresql/work.plaid/postgres-0.7.9.2008.01.28
===> Building for ruby18-postgresql-0.7.9.2008.01.28nb1
=> Removing backup files of patch before build 
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Specification::YAML
*** Error code 1

Stop.
make: stopped in /local/netbsd-src/pkgsrc/databases/ruby-postgresql
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/databases/ruby-postgresql
*** Error code 1
>How-To-Repeat:
compile ruby-postgresql
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->taca
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Fri, 10 Sep 2010 21:18:33 +0000
Responsible-Changed-Why:
taca, you did the changes, could you please investigate? Thank you.


From: Takahiro Kambe <taca@back-street.net>
To: gnats-bugs@NetBSD.org, explorer@netbsd.org
Cc: 
Subject: Re: pkg/43865: recent ruby upgrade broke some things
 (ruby-postgresql specifically)
Date: Sat, 11 Sep 2010 14:03:42 +0900 (JST)

 In message <20100910202500.86A6E63BCCF@www.NetBSD.org>
 	on Fri, 10 Sep 2010 20:25:00 +0000 (UTC),
 	explorer@netbsd.org wrote:
 > ===> Configuring for ruby18-postgresql-0.7.9.2008.01.28nb1
 > chmod -R g-w /local/pkgsrc-build/databases/ruby-postgresql/work.plaid/postgres-0.7.9.2008.01.28
 > ===> Building for ruby18-postgresql-0.7.9.2008.01.28nb1
 > => Removing backup files of patch before build 
 > ERROR:  While executing gem ... (NameError)
 >     uninitialized constant Gem::Specification::YAML
 > *** Error code 1
 Would you please execute these command's output?

 % ruby18 -v
 % gem18 spec /usr/pkgsrc/distfiles/postgres-0.7.9.2008.01.28.gem > /dev/null

 If latter commands shows the error,

 	ERROR:  While executing gem ... (NameError)
 	    uninitialized constant Gem::Specification::YAML

 I know what's going on and I've seen this error with other version of
 rubygem.  But I don't know why it happens with rubygem 1.3.5.

 Would you please change /usr/pkg/lib/ruby/vendor_ruby/1.8/rubygems.rb
 as below,

 --- lib/rubygems.rb.orig	2009-07-21 23:46:08.000000000 +0000
 +++ lib/rubygems.rb
 @@ -1123,6 +1128,8 @@ end

  require 'rubygems/config_file'

 +STDERR.puts YAML.class
 +
  if RUBY_VERSION < '1.9' then
    require 'rubygems/custom_require'
  end

 And what will be output with

 % gem18 spec /usr/pkgsrc/distfiles/postgres-0.7.9.2008.01.28.gem > /dev/null

 It will be:

 	NameError: uninitialized constant YAML

 or

 	Module


 And if my understanding is correct, below patch may solve the problem.
 (But it isn't the real fix of the problem...)

 --- lib/rubygems/specification.rb.orig	2009-06-22 22:59:43.000000000 +0000
 +++ lib/rubygems/specification.rb
 @@ -472,6 +472,7 @@ class Gem::Specification
    # 'input' can be anything that YAML.load() accepts: String or IO.

    def self.from_yaml(input)
 +    require 'yaml'
      input = normalize_yaml_input input
      spec = YAML.load input



 -- 
 Takahiro Kambe <taca@back-street.net>

From: Michael Graff <explorer@flame.org>
To: 
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/43865: recent ruby upgrade broke some things (ruby-postgresql
 specifically)
Date: Mon, 13 Sep 2010 00:05:33 -0500

 On 9/11/10 12:03 AM, Takahiro Kambe wrote:

 > Would you please execute these command's output?
 > 
 > % ruby18 -v

 plaid# ruby18 -v
 ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-netbsd]

 > % gem18 spec /usr/pkgsrc/distfiles/postgres-0.7.9.2008.01.28.gem > /dev/null

 plaid# gem18 spec /local/pkgsrc-distfiles/postgres-0.7.9.2008.01.28.gem
 > /dev/null
 plaid#

 (that is, no problems with that command)

 > Would you please change /usr/pkg/lib/ruby/vendor_ruby/1.8/rubygems.rb
 > as below,
 > 
 > 	NameError: uninitialized constant YAML
 > 
 > or
 > 
 > 	Module

 I didn't see either of these when re-running the gem18 command.

 Going into irb and doing a simple "require 'rubygems'" shows that the
 class Gem::Specification exists, but Gem::Specification::YAML does not.
  I admit a lack of understanding of how rubygems works internally.

 --Michael

From: Takahiro Kambe <taca@back-street.net>
To: gnats-bugs@NetBSD.org, explorer@flame.org
Cc: taca@NetBSD.org
Subject: Re: pkg/43865: recent ruby upgrade broke some things
 (ruby-postgresql specifically)
Date: Mon, 13 Sep 2010 16:49:20 +0900 (JST)

 In message <20100913051005.65DEC63BCBE@www.NetBSD.org>
 	on Mon, 13 Sep 2010 05:10:05 +0000 (UTC),
 	Michael Graff <explorer@flame.org> wrote:
 >  plaid# ruby18 -v
 >  ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-netbsd]
 >  
 >  > % gem18 spec /usr/pkgsrc/distfiles/postgres-0.7.9.2008.01.28.gem > /dev/null
 >  
 >  plaid# gem18 spec /local/pkgsrc-distfiles/postgres-0.7.9.2008.01.28.gem
 >  > /dev/null
 >  plaid#
 >  
 >  (that is, no problems with that command)
 I misunderstood that the stage of error in package build and

 >  > Would you please change /usr/pkg/lib/ruby/vendor_ruby/1.8/rubygems.rb
 >  > as below,
 >  > 
 >  > 	NameError: uninitialized constant YAML
 In this case, it shouldn't display error message but display *nothing*.
 But real expected output is the latter:

 >  > 	Module

 >  I didn't see either of these when re-running the gem18 command.
 So, something is wrong.

 >  Going into irb and doing a simple "require 'rubygems'" shows that the
 >  class Gem::Specification exists, but Gem::Specification::YAML does not.
 >   I admit a lack of understanding of how rubygems works internally.
 Your reported error,

 	ERROR:  While executing gem ... (NameError)
 	    uninitialized constant Gem::Specification::YAML
 	*** Error code 1

 "uninitialized constant Gem::Specification::YAML" is the result of
 yaml.rb wan't read, top level module YAML is undefined.  So, ruby
 tried to find "YAML" as a constant in calling module,
 Gem::Specification.

 Anyway, 

 > --- lib/rubygems.rb.orig	2009-07-21 23:46:08.000000000 +0000
 > +++ lib/rubygems.rb
 > @@ -1123,6 +1128,8 @@ end
 >  
 >  require 'rubygems/config_file'
 >  
 > +STDERR.puts YAML.class
 > +
 >  if RUBY_VERSION < '1.9' then
 >    require 'rubygems/custom_require'
 >  end

 1. There is a line "require 'yaml'" in rubygems/config_file,
    $PREFIX/lib/ruby/vendor_ruby/1.8/rubygems/config_file.rb.
 2. yaml.rb ($PREFIX/lib/ruby/1.8/yaml.rb) defines YAML module.
 3. STDERR.puts YAML.class should print "Module" to standard error.

 Something is wrong and it seems "require 'rubygems/config_file'"
 isn't executed.

 But it is very strange that "gem18 unpack" or "gem18 spec" had no
 problem but "gem18 build" has a problem.


 I've just created clean environment with pkg_comp(8),

 # ruby18 -v
 ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-netbsd]
 # uname -rsm
 NetBSD 5.1_RC3 amd64
 # ls /var/db/pkg
 bison-2.4.3               libtool-base-2.2.6bnb4    ruby18-base-1.8.7.302
 checkperms-1.11           m4-1.4.15                 ruby18-rubygems-1.3.5nb3
 digest-20080510           pkgdb.byfile.db           zsh-4.3.10nb2
 f2c-20090411nb5           postgresql84-client-8.4.4
 gmake-3.82nb1             readline-6.1
 # cd /usr/pkgsrc/databases/ruby-postgresql
 # make
 ...
 ===> Extracting for ruby18-postgresql-0.7.9.2008.01.28nb1
 Unpacked gem: '/pkg_comp/obj/pkgsrc/databases/ruby-postgresql/default/postgres-0.7.9.2008.01.28'
 ===> Patching for ruby18-postgresql-0.7.9.2008.01.28nb1
 => Applying pkgsrc patches for ruby18-postgresql-0.7.9.2008.01.28nb1
 ===> Creating toolchain wrappers for ruby18-postgresql-0.7.9.2008.01.28nb1
 ===> Configuring for ruby18-postgresql-0.7.9.2008.01.28nb1
 chmod -R g-w /pkg_comp/obj/pkgsrc/databases/ruby-postgresql/default/postgres-0.7.9.2008.01.28
 => Checking for portability problems in extracted files
 ===> Building for ruby18-postgresql-0.7.9.2008.01.28nb1
 => Removing backup files of patch before build 
 WARNING:  no description specified
   Successfully built RubyGem
   Name: postgres
   Version: 0.7.9.2008.01.28
   File: postgres-0.7.9.2008.01.28.gem
 => Unwrapping files-to-be-installed.


 So, I couldn't reproduce your problem...

 BTW, what will display below command?

 % ruby18 -e 'p $:'

 In my environment by pkg_comp(8),

 ["/usr/pkg/lib/ruby/site_ruby/1.8", "/usr/pkg/lib/ruby/site_ruby/1.8/x86_64-netbsd", "/usr/pkg/lib/ruby/site_ruby", "/usr/pkg/lib/ruby/vendor_ruby/1.8", "/usr/pkg/lib/ruby/vendor_ruby/1.8/x86_64-netbsd", "/usr/pkg/lib/ruby/vendor_ruby", "/usr/pkg/lib/ruby/1.8", "/usr/pkg/lib/ruby/1.8/x86_64-netbsd", "."]


 -- 
 Takahiro Kambe <taca@back-street.net>

From: Michael Graff <explorer@flame.org>
To: Takahiro Kambe <taca@back-street.net>
Cc: gnats-bugs@NetBSD.org, taca@NetBSD.org
Subject: Re: pkg/43865: recent ruby upgrade broke some things (ruby-postgresql
 specifically)
Date: Mon, 13 Sep 2010 06:08:38 -0500

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1

 I think I found the problem.

 I apparently ran "gem18 update --system" at some point on this machine
 after installing 1.8.5nb3 from pkgsrc, and so "pkg_delete" did not clean
 up the modified files.  This apparently left some cruft around which,
 when pkgsrc re-installed 1.3.5nb3 again, caused this problem.  I think
 this pr can be closed; I'll re-open it if I find out it wasn't my doing.

 btw, I miss the "gem" command, which seems to have gone away. I
 understand why, but it's odd having a "ruby" command but no "gem" command.

 - --Michael

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (Darwin)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkyOBjYACgkQl6Nz7kJWYWai/wCffNiQAos716E+ST2IzCFkniSh
 prQAnA5tCO8shpJm1N/iPE0JLMc6PMn6
 =twkq
 -----END PGP SIGNATURE-----

State-Changed-From-To: open->closed
State-Changed-By: taca@NetBSD.org
State-Changed-When: Wed, 22 Sep 2010 04:17:00 +0000
State-Changed-Why:
It was the problem of submitter's environment; rubygems itself had
updated out side of pkgsrc.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.