Summary: | dev-lang/ruby-1.8.6_p287-r* compile error: shellwords.rb:30:in `shellwords': Argument must be a string (ArgumentError) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Oleg Dashevskii <olegdashevskii> |
Component: | Current packages | Assignee: | Gentoo Ruby Team <ruby> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | balancer, cheoppy, dark, Jochen.Trumpf, mg, saturday, yuya |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 225465 | ||
Attachments: |
The full build log
A small patch that fixes the problem another patch to fix the cause of problem in mkconfig.rb |
Description
Oleg Dashevskii
2008-08-16 01:22:41 UTC
Created attachment 163010 [details]
The full build log
Please, while now it looks ok, next time send logs and paste messages in english locale. try installing ruby with USE="threads" enabled, that worked for me. I can confirm the bug and I can confirm that workaround (USE="threads") works as advertised. (In reply to comment #4) USE="threads" doesn't work for me. ---------------------------------------------------------------------------- be9-home od # emerge -auNv ruby These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild U ] dev-lang/ruby-1.8.6_p287 [1.8.6_p230] USE="berkdb doc examples gdbm ssl threads tk -debug -emacs -ipv6 -rubytests -socks5 -xemacs (-cjk%)" 0 kB Total: 1 package (1 upgrade), Size of downloads: 0 kB Would you like to merge these packages? [Yes/No] ..........snip............... rbconfig.rb updated /var/tmp/portage/dev-lang/ruby-1.8.6_p287/work/ruby-1.8.6-p287/lib/shellwords.rb:30:in `shellwords': Argument must be a string (ArgumentError) from /var/tmp/portage/dev-lang/ruby-1.8.6_p287/work/ruby-1.8.6-p287/lib/mkmf.rb:25 from ./ext/extmk.rb:37:in `require' from ./ext/extmk.rb:37 make: *** [all] Error 1 You're right - I looked at the wrong console, the USE="threads" workaround does NOT work. Please, excuse me for this noise - I have much too many root sessions open - I tried it again and it works with threads on. My current USE set is USE="berkdb debug doc examples gdbm ipv6 rubytests ssl threads -emacs -socks5 -tk -xemacs" and I can compile 1.8.6_p287 with it. Created attachment 163600 [details, diff]
A small patch that fixes the problem
I made a patch that fixes the problem for me.
(In reply to comment #8) > Created an attachment (id=163600) [edit] > A small patch that fixes the problem > > I made a patch that fixes the problem for me. > I think this fixes the symptom, not the cause. The code clearly expects CONFIG["configure_args"] not to be empty there. My best guess is that this has to do with parallel make problems. Could people who have seen this issue try to compile the package with -j1 to see if that fixes the problem? You might want to try emerging it a few times since the race condition may not always manifest itself. This would also explain why different sets of USE flags solve the issue for some people but not others. Can someone who suffers from this bug please try the workaround from comment #9 ? I cannot reproduce the build failure for =dev-lang/ruby-1.8.6_p287-r1 on a 4 CPU SMP machine even after ~100 iterations. (In reply to comment #10) > Can someone who suffers from this bug please try the workaround from comment #9 > ? > > I cannot reproduce the build failure for =dev-lang/ruby-1.8.6_p287-r1 on a 4 > CPU SMP machine even after ~100 iterations. > I am getting the same problem compiling with -j1. USE flags: doc gdbm ipv6 ssl threads tk -berkdb* -debug -emacs -examples -rubytests -socks5 -xemacs (-cjk%*) For me, this bug seemed to be 100% correlated with enabling "threads" and not enabling "debug" use flags, regardless of distcc and/or -j<whatever>. For a while I thought it to be related to configure: WARNING: unrecognized options: --disable-socks, --disable-ipv6, --disable-debug, --with-dbm, --with-gdbm, --with-openssl, --without-tk (there is already bug 230748 for this QA) But after much more digging, I found that what is broken is mkconfig.rb. It does some deep uncommented magic to parse config.status, and is thrown off (the corresponding line is then missing in rbconfig.rb) by a lines that read: S["configure_args"]=" '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--loca"\ "lstatedir=/var/lib' '--program-suffix=18' '--enable-shared' '--disable-socks' '--disable-install-doc' '--enable-pthread' '--disable-ipv6' '--enable-"\ "debug' '--with-dbm' '--with-gdbm' '--with-openssl' '--without-tk' '--with-sitedir=/usr/lib/ruby/site_ruby' '--build=i686-pc-linux-gnu' 'build_alias"\ "=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-O3 -mtune=nocona -march=nocona -pipe -fno-strict-aliasing' 'LDFLAGS=-Wl,-O1' 'CPPFLAGS='"\ "" More specificaly by the ending \ "" (changing it manually to contain at least "a" fixes the problem). This would explain why exactly same sets of use flags work for some people and not for other - different arch or cflags are enough to make it work (indeed after discovering this simply adding duplicate "-O3 -O3" to CFLAGS fixes the build). I have tried it with 1.8.7 in portage and it has the same issue, and I'm too tired to try to find how to checkout current HEAD to try it there. If someone wants to report it upstream, you are welcome - I don't have account there and I don't even use this thing, just something on my system insists that it needs ruby with threads useflag and I finally found little time to investigate. For now I'm content with the "-O3 -O3" solution. For me compilation fails with the following error: make[1]: Entering directory `/var/tmp/portage/dev-lang/ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl' x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -march=nocona -mtune=cor$ In file included from ossl.h:197, from ossl_ns_spki.c:11: openssl_missing.h:123: error: conflicting types for 'BN_rand_range' /usr/include/openssl/bn.h:411: error: previous declaration of 'BN_rand_range' was here openssl_missing.h:124: error: conflicting types for 'BN_pseudo_rand_range' /usr/include/openssl/bn.h:412: error: previous declaration of 'BN_pseudo_rand_range' was here ossl_ns_spki.c: In function 'ossl_spki_initialize': ossl_ns_spki.c:67: warning: passing argument 2 of 'd2i_NETSCAPE_SPKI' from incompatible pointer type Seems that the ossl extension lacks a proper conditional or something. I am using ossl 0.98j, can anyone reproduce the problem? (In reply to comment #13) > For me compilation fails with the following error: > > make[1]: Entering directory > `/var/tmp/portage/dev-lang/ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl' > x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl > -DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -march=nocona -mtune=cor$ > In file included from ossl.h:197, > from ossl_ns_spki.c:11: > openssl_missing.h:123: error: conflicting types for 'BN_rand_range' > /usr/include/openssl/bn.h:411: error: previous declaration of 'BN_rand_range' > was here > openssl_missing.h:124: error: conflicting types for 'BN_pseudo_rand_range' > /usr/include/openssl/bn.h:412: error: previous declaration of > 'BN_pseudo_rand_range' was here > ossl_ns_spki.c: In function 'ossl_spki_initialize': > ossl_ns_spki.c:67: warning: passing argument 2 of 'd2i_NETSCAPE_SPKI' from > incompatible pointer type > > Seems that the ossl extension lacks a proper conditional or something. > I am using ossl 0.98j, can anyone reproduce the problem? Same error here, but masking openssl-0.98j and therefore emerging 0.98i solved the problem. The problem is likely to be in the 0.98j version of openssl. Sven, Gergely, please use bug 254307 for followups to the OpenSSL issue as it does not have anything to do with the ArgumentError here. I CC'd you. seeing the same issue with dev-lang/ruby-1.8.6_p287-r4 The 'good news' is that I'm now seeing this myself with dev-lang/ruby-1.8.6_p287-r4, so hopefully I can do more debugging and find and fix the root cause later this weekend. *** Bug 255254 has been marked as a duplicate of this bug. *** I ran into this bug today while doing a 'emerge -uDN world'. I'm another one of those people who doesn't even use ruby, I'm not sure if I installed it to play with or if its there as a dependancy of something - but I had to get it fixed. Using comment #12 as a guess as to the root of the problem, I tried: CPPFLAGS="-O2" emerge -1 ruby just to see if having CPPFLAGS not an empty string at the end would make a difference, and it emerged successfully. This was with ruby-1.8.6_p287-r4 btw. Just for completeness sake - here's my 'emerge --info' # emerge --info Portage 2.2_rc23 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r8 i686) ================================================================= System uname: Linux-2.6.25-gentoo-r8-i686-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4200+-with-glibc2.0 Timestamp of tree: Tue, 20 Jan 2009 21:05:01 +0000 app-shells/bash: 3.2_p39 dev-java/java-config: 1.3.7-r1, 2.1.6-r1 dev-lang/python: 2.4.4-r13, 2.5.2-r7 dev-python/pycrypto: 2.0.1-r6 dev-util/cmake: 2.6.2-r1 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 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.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon64 -pipe -mfpmath=sse" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /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 /etc/udev/rules.d" CXXFLAGS="-O2 -march=athlon64 -pipe -mfpmath=sse" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.mirrors.tera-byte.com/ http://adelie.polymtl.ca/ ftp://gentoo.arcticnetwork.ca/pub/gentoo/ http://gentoo.arcticnetwork.ca/source/ ftp://mirrors.tera-byte.com/pub/gentoo/" LDFLAGS="-Wl,-O1" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" 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" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow 3dnowext X aac aalib acl acpi alsa apache2 arts avahi berkdb branding bzip2 cairo cdr cli cracklib crypt ctypecups dbus dri dts dvd dvdr dvdread eds emboss encode esd evo fam firefox flac fortran gd gdbm gif glitz gnome gpm gstreamer gtk hal htmlhandbook iconv ipv6 isdnlog java jpeg jpeg2k kde kerberos kipi ldap libnotify lm_sensors logitech-mouse madmidi mikmod mmx mmxext mng mono mp3 mpeg mudflap musicbrainz mysql nas ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf perl php png ppds pppd python qt3 qt3support qt4 quicktime rar rdesktop readline reflection ruby samba sdlsensord session snmp spell spl sse sse2 ssl startup-notification subversion svg sysfs tcpd theora threads tiff truetype unicode usb vorbis win32codecs wmf x264 x86 xcomposite xine xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="evdev keyboard mouse vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="radeon fglrx vmware" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS Created attachment 181742 [details, diff]
another patch to fix the cause of problem in mkconfig.rb
I tracked this bug with Petr Behan's great hint (#12). (Thank you very much! :)
Finally, I found how to fix this bug's cause.
The problem was the assumption in regexp that there is no lines started with "".
I tried compiling with this patch and it worked.
I'll report it to upstream.
I found it was fixed in HEAD. (http://svn.ruby-lang.org/repos/ruby/trunk/mkconfig.rb rev20587) So I don't report it. Okay, that latter patch looks good. Could someone else please try it and report whether it is working before we apply the patch? I can confirm that ruby-1.8.6-mkconfig_bug.patch works. Confirm that ruby-1.8.6-mkconfig_bug.patch successfully compiled ruby-1.8.6_p287-r11 for me on x86 with USE flags: USE="berkdb doc emacs examples gdbm ipv6 socks5 ssl threads -debug -rubytests -tk -xemacs" Thanks! The patch is applied to 1.8.6-r5 and -r12, and 1.8.7-r2, thanks everyone! |