Bug#303608: libqt0-ruby1.8: incorrect include in qtruby library badly polutes Module namespace
Package: libqt0-ruby1.8
Version: 4:3.3.2-1
Severity: important
A mistake in the use of include means that Qt methods were being added
to "Module" badly poluting its namespace. This bug also breaks the
rubyscript2exe program.
The good news is that this problem has been fixed upstream but since
it is a pretty serious problem I am hoping that the fix gets into
sarge.
Here is a discussion regarding the bug from:
http://groups-beta.google.com/group/comp.lang.ruby/msg/7e8234d288fde7d2
Erik Veenstra wrote:
>> An 'include Qt' statement in qtruby.rb where a couple of
>> methods were being added to class Module was causing all the
>> Qt methods to be added to Module. Oops, this a really serious
>> bug. Various methods in qtruby.rb are now module methods in
>> the Qt::Internal module.
> This "hack" caused a problem in RubyScript2Exe when trying to
> "compile" a Ruby application which uses Qt. I've tested the
> combination RubyScript2Exe and Qt with a little HelloWorld
> program. It works!
Richard Dale replied:
Yes, my mistake was to think of 'include Qt' being just like a 'using
namespace' statement in a static language like C++. But it isn't like
that at all, and in this case was having quite major unexpected
effects.
I'd known there was something 'not quite right' in the namespace
handling of QtRuby for a while, but couldn't work out what it was. That
was I was so pleased when you found the problem.
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages libqt0-ruby1.8 depends on:
ii libaudio2 1.7-2 The Network Audio System (NAS). (s
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
ii libfontconfig1 2.3.1-2 generic font configuration library
ii libfreetype6 2.1.7-2.3 FreeType 2 font engine, shared lib
ii libgcc1 1:3.4.3-6 GCC support library
ii libice6 4.3.0.dfsg.1-10 Inter-Client Exchange library
ii libpng12-0 1.2.8rel-1 PNG library - runtime
ii libqt3c102-mt 3:3.3.3-8 Qt GUI Library (Threaded runtime v
ii libruby1.8 1.8.2-3 Libraries necessary to run Ruby 1.
ii libsm6 4.3.0.dfsg.1-10 X Window System Session Management
ii libsmokeqt1 4:3.3.2-1 SMOKE Binding Library to Qt
ii libstdc++5 1:3.3.5-8 The GNU Standard C++ Library v3
ii libx11-6 4.3.0.dfsg.1-10 X Window System protocol client li
ii libxcursor1 1.1.3-1 X cursor management library
ii libxext6 4.3.0.dfsg.1-10 X Window System miscellaneous exte
ii libxft2 2.1.2-6 FreeType-based font drawing librar
ii libxrandr2 4.3.0.dfsg.1-10 X Window System Resize, Rotate and
ii libxrender1 0.8.3-7 X Rendering Extension client libra
ii libxt6 4.3.0.dfsg.1-10 X Toolkit Intrinsics
ii ruby1.8 1.8.2-3 Interpreter of object-oriented scr
ii xlibmesa-gl [libgl1] 4.3.0.dfsg.1-10 Mesa 3D graphics library [XFree86]
ii xlibmesa-glu [libglu1] 4.3.0.dfsg.1-10 Mesa OpenGL utility library [XFree
ii xlibs 4.3.0.dfsg.1-10 X Keyboard Extension (XKB) configu
ii zlib1g 1:1.2.2-3 compression library - runtime
-- no debconf information
Reply to: