already initialized constant DEF_KEY_ATTRIBUTES

Bug #321291 reported by Hadmut Danisch
2
Affects Status Importance Assigned to Milestone
libxml-simple-ruby (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: libxml-simple-ruby

Hi,

when running e.g. ruby on rails I get heaps of warnings:

/usr/lib/ruby/1.8/xmlsimple.rb:275: warning: already initialized constant KNOWN_OPTIONS
/usr/lib/ruby/1.8/xmlsimple.rb:280: warning: already initialized constant DEF_KEY_ATTRIBUTES
/usr/lib/ruby/1.8/xmlsimple.rb:281: warning: already initialized constant DEF_ROOT_NAME
/usr/lib/ruby/1.8/xmlsimple.rb:282: warning: already initialized constant DEF_CONTENT_KEY
/usr/lib/ruby/1.8/xmlsimple.rb:283: warning: already initialized constant DEF_XML_DECLARATION
/usr/lib/ruby/1.8/xmlsimple.rb:284: warning: already initialized constant DEF_ANONYMOUS_TAG
/usr/lib/ruby/1.8/xmlsimple.rb:285: warning: already initialized constant DEF_FORCE_ARRAY
/usr/lib/ruby/1.8/xmlsimple.rb:286: warning: already initialized constant DEF_INDENTATION
/usr/lib/ruby/1.8/xmlsimple.rb:287: warning: already initialized constant DEF_KEY_TO_SYMBOL

which is obviously caused because that package contains xmlsimple.rb twice,
/usr/lib/ruby/1.8/xmlsimple.rb and /usr/lib/ruby/1.8/lib/xmlsimple.rb where one is a symlink to the other.

I guess this is needed because applications expect xmlsimple at different paths. In rails there are require statements for

require 'xmlsimple' and
require 'lib/xmlsimple'

and interestingly the comment
# Debian maintainers put their xmlsimple in a different location :(

so it is a debian mess. However, requiring the same file from different paths is something the ruby interpreter cannot prevent. That's why warnings are printed.

Please fix that (and maybe put files just where they belong).

Even if that cannot be fixed easily for whatever reason, do *NOT* use symlinks to have a file at different places. Just write a file with a single line 'require ...' to the other location. Thus the interpreter can detect that it reads the same file again.

regards

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.