Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185512 - >=dev-lang/ruby-1.8.4-r3 fails to build. "uninitialized constant Config (NameError)" in extmk.rb
Summary: >=dev-lang/ruby-1.8.4-r3 fails to build. "uninitialized constant Config (Nam...
Status: RESOLVED DUPLICATE of bug 161566
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-16 11:33 UTC by Tom Lloyd
Modified: 2007-07-25 07:17 UTC (History)
0 users

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


Attachments
rbconfig.rb from build directory, as requested (rbconfig.rb,7.03 KB, text/plain)
2007-07-19 23:32 UTC, Tom Lloyd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Lloyd 2007-07-16 11:33:30 UTC
The interesting part of my buildlog:

...
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c re.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c regex.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c ruby.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c signal.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c sprintf.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c st.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c string.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c struct.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c time.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c util.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c variable.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c version.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c dmyext.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -I. -I.  -c main.c
powerpc-gentoo-linux-uclibc-ar rcu libruby18-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o
powerpc-gentoo-linux-uclibc-gcc main.o  libruby18-static.a -ldl -lcrypt -lm   -o miniruby -O2 -mcpu=603e -pipe -ggdb  -fPIC  -DRUBY_EXPORT  -Wl,-z,relro -rdynamic -Wl,-export-dynamic
powerpc-gentoo-linux-uclibc-gcc -shared -Wl,-soname,libruby18.so.1.8   array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o -ldl -lcrypt -lm   -o libruby18.so.1.8.5
rbconfig.rb updated
/var/tmp/portage/dev-lang/ruby-1.8.5_p2-r1/work/ruby-1.8.5-p2/lib/mkmf.rb:8: uninitialized constant Config (NameError)
        from ./ext/extmk.rb:31:in `require'
        from ./ext/extmk.rb:31
make: *** [all] Error 1

!!! ERROR: dev-lang/ruby-1.8.5_p2-r1 failed.
Call stack:
  ebuild.sh, line 1621:   Called dyn_compile
  ebuild.sh, line 973:   Called qa_call 'src_compile'
  ebuild.sh, line 44:   Called src_compile
  ruby-1.8.5_p2-r1.ebuild, line 87:   Called die

!!! emake 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-lang/ruby-1.8.5_p2-r1/temp/build.log'.



emerge --info:

Portage 2.1.2.9 (uclibc/ppc/hardened, gcc-3.4.6, uclibc-0.9.28.3-r0, 2.6.20-hardened-r3-muttley-3 ppc)
=================================================================
System uname: 2.6.20-hardened-r3-muttley-3 ppc G2_LE
Gentoo Base System release 1.12.9
Timestamp of tree: Sun, 15 Jul 2007 22:50:01 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61
sys-devel/automake:  1.6.3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.20-r2
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CBUILD="powerpc-gentoo-linux-uclibc"
CFLAGS="-O2 -mcpu=603e -pipe -ggdb"
CHOST="powerpc-gentoo-linux-uclibc"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mcpu=603e -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages metadata-transfer nostrip parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-z,relro"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="alsa bitmap-fonts bzip2 cgi cli cracklib dri embedded fastcgi gd hardened ipv6 mudflap mysql ncurses openmp pcre php pic ppc readline reflection session spl ssl syslog truetype-fonts type1-fonts uclibc unicode xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="uclibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


I get this same error with both ruby-1.8.5_p2-r1 and ruby-1.8.6-r1.

(Apols if this is a dupe, I did search, but I seem to keep posting them recently...)
Comment 1 Tom Lloyd 2007-07-17 00:56:16 UTC
Tested it with a couple of other versions - the earliest and the latest available in Portage.  At the time of writing, these are 1.8.4-r3 and 1.8.6_p36-r3.

The following happened:

(dev-lang/ruby-1.8.4-r3)
...
powerpc-gentoo-linux-uclibc-gcc -shared -Wl,-soname,libruby18.so.1.8   array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o -ldl -lcrypt -lm   -o libruby18.so.1.8.4
rbconfig.rb updated
/var/tmp/portage/dev-lang/ruby-1.8.4-r3/work/ruby-1.8.4/lib/mkmf.rb:8: uninitialized constant Config (NameError)
        from ./ext/extmk.rb:32
make: *** [all] Error 1


(dev-lang/ruby-1.8.6_p36-r3)
...
powerpc-gentoo-linux-uclibc-gcc -shared -Wl,-soname,libruby18.so.1.8   array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o -ldl -lcrypt -lm   -o libruby18.so.1.8.6
rbconfig.rb updated
/var/tmp/portage/dev-lang/ruby-1.8.6_p36-r3/work/ruby-1.8.6-p36/lib/mkmf.rb:8: uninitialized constant Config (NameError)
        from ./ext/extmk.rb:37:in `require'
        from ./ext/extmk.rb:37
make: *** [all] Error 1


Points of interest:
> PPC architecture
> Hardened toolchain
> uClibc

I'd test more, but I see little point - and besides, on this machine it takes about 15 minutes even to get to the point where it fails...
Comment 2 Hans de Graaff gentoo-dev 2007-07-19 16:26:18 UTC
The Config stuff is normally defined in rbconfig.rb. Can you check what this file looks like for you? It can be found in the top-level work directory, e.g. /var/tmp/portage/dev-lang/ruby-<version>/work/ruby-<version>
Comment 3 Tom Lloyd 2007-07-19 23:32:35 UTC
Created attachment 125397 [details]
rbconfig.rb from build directory, as requested
Comment 4 Tom Lloyd 2007-07-19 23:34:09 UTC
I'm afraid I'm not a big Ruby guru (yet), so I wouldn't  know what to look for within this file...
Comment 5 Hans de Graaff gentoo-dev 2007-07-21 20:04:07 UTC
Hmm, for me the line with "rbconfig.rb updated" gets printed before the shared library is linked. That might indicate a race condition in the build process, even though I'm also using MAKEOPTS="j2". Could you try with -j1 just to see if this might be the issue?

The rbconfig.rb looks fine, so there is something else going on.
Comment 6 Tom Lloyd 2007-07-22 20:20:33 UTC
I'm afraid it doesn't seem to have helped:
(I turned off the debugging options too, just in case they were causing problems.)

powerpc-gentoo-linux-uclibc-ar rcu libruby18-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -fno-strict-aliasing  -fPIC  -DRUBY_EXPORT  -I. -I.  -c main.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -fno-strict-aliasing  -fPIC  -DRUBY_EXPORT  -L. -Wl,-z,relro -rdynamic -Wl,-export-dynamic   main.o  libruby18-static.a -ldl -lcrypt -lm   -o miniruby
rbconfig.rb updated
powerpc-gentoo-linux-uclibc-gcc -shared -Wl,-soname,libruby18.so.1.8   array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o -ldl -lcrypt -lm   -o libruby18.so.1.8.6
/var/tmp/portage/dev-lang/ruby-1.8.6_p36-r3/work/ruby-1.8.6-p36/lib/mkmf.rb:8: uninitialized constant Config (NameError)
        from ./ext/extmk.rb:37:in `require'
        from ./ext/extmk.rb:37
make: *** [all] Error 1

!!! ERROR: dev-lang/ruby-1.8.6_p36-r3 failed.
Call stack:
  ebuild.sh, line 1621:   Called dyn_compile
  ebuild.sh, line 973:   Called qa_call 'src_compile'
  ebuild.sh, line 44:   Called src_compile
  ruby-1.8.6_p36-r3.ebuild, line 94:   Called die
Comment 7 Hans de Graaff gentoo-dev 2007-07-23 18:10:41 UTC
Well, the -j 1 helped in that rbconfig.rb is now built in the same place where it is built on my machine, but obviously that's not the cause. 

The only other thing that comes to mind is a new incarnation of bug 161566. I am not familiar with uclibc so I'm not sure how likely this is. In order to verify this, downgrade autoconf to a previous version (like 2.59) and try to emerge ruby again.
Comment 8 Tom Lloyd 2007-07-24 18:42:27 UTC
Genius!  It's installed now!

I used autoconf-2.59-r7, and got this:

...
powerpc-gentoo-linux-uclibc-ar rcu libruby18-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -fno-strict-aliasing  -fPIC  -DRUBY_EXPORT  -I. -I.  -c main.c
powerpc-gentoo-linux-uclibc-gcc -O2 -mcpu=603e -pipe -fno-strict-aliasing  -fPIC  -DRUBY_EXPORT  -L. -Wl,-z,relro -rdynamic -Wl,-export-dynamic   main.o  libruby18-static.a -ldl -lcrypt -lm   -o miniruby
rbconfig.rb updated
powerpc-gentoo-linux-uclibc-gcc -shared -Wl,-soname,libruby18.so.1.8   array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o -ldl -lcrypt -lm   -o libruby18.so.1.8.6
compiling Win32API
compiling bigdecimal
make[1]: Entering directory `/var/tmp/portage/dev-lang/ruby-1.8.6_p36-r3/work/ruby-1.8.6-p36/ext/bigdecimal'
mkdir -p ../../.ext/powerpc-linux-uclibc
powerpc-gentoo-linux-uclibc-gcc -I. -I../.. -I../../. -I../.././ext/bigdecimal  -fPIC -O2 -mcpu=603e -pipe -fno-strict-aliasing  -fPIC  -c bigdecimal.c
powerpc-gentoo-linux-uclibc-gcc -shared -o ../../.ext/powerpc-linux-uclibc/bigdecimal.so bigdecimal.o -L'.' -L'../..' -L. -Wl,-z,relro -rdynamic -Wl,-export-dynamic    -Wl,-R -Wl,/usr/lib -L. -L/usr/lib -lruby18  -ldl -lcrypt -lm   -lc
mkdir -p ../../.ext/common/bigdecimal
cp ../.././ext/bigdecimal/lib/bigdecimal/ludcmp.rb ../../.ext/common/bigdecimal
cp ../.././ext/bigdecimal/lib/bigdecimal/newton.rb ../../.ext/common/bigdecimal
cp ../.././ext/bigdecimal/lib/bigdecimal/jacobian.rb ../../.ext/common/bigdecimal
cp ../.././ext/bigdecimal/lib/bigdecimal/math.rb ../../.ext/common/bigdecimal
cp ../.././ext/bigdecimal/lib/bigdecimal/util.rb ../../.ext/common/bigdecimal
make[1]: Leaving directory `/var/tmp/portage/dev-lang/ruby-1.8.6_p36-r3/work/ruby-1.8.6-p36/ext/bigdecimal'
...

So I guess this bug is some sort of weird duplicate, no?

...Thanks for helping me install! :D
Comment 9 Tom Lloyd 2007-07-24 19:49:28 UTC
Update:
It also works with the current stable Ruby (1.8.6-r1), and autoconf-2.60.
Comment 10 Hans de Graaff gentoo-dev 2007-07-25 07:17:10 UTC
Duplicate, yes, but not really weird. The problem with the bug is that the file seek functions get clobbered in some cases, so reading from files suddenly causes weird side effects, such as the read marker being reset to the beginning of the file, or the read marker being set to a high value, thus pretending the file is empty. That seems to be what is going on here.

*** This bug has been marked as a duplicate of bug 161566 ***