Bug 2185007 - rubygem-xmlparser: broken because it calls undefined ENC_TO_ENCINDEX function
Summary: rubygem-xmlparser: broken because it calls undefined ENC_TO_ENCINDEX function
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rubygem-xmlparser
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ulrich Schwickerath
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded
TreeView+ depends on / blocked
 
Reported: 2023-04-06 13:41 UTC by Florian Weimer
Modified: 2023-11-03 18:29 UTC (History)
2 users (show)

Fixed In Version: 0.7.2.1-39 rubygem-xmlparser-0.7.2.1-40.fc37 rubygem-xmlparser-0.7.2.1-40.fc38 rubygem-xmlparser-0.7.2.1-40.fc39
Clone Of:
Environment:
Last Closed: 2023-10-13 01:33:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2023-04-06 13:41:57 UTC
rubygem-xmlparser-0.7.2.1-37.fc38.x86_64 does not load because the C sources call the ENC_TO_ENCINDEX function, which is not defined:

$ ruby -e 'require "xmlparser"'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:159:in `require': /usr/lib64/gems/ruby/xmlparser-0.7.2.1/xmlparser.so: undefined symbol: ENC_TO_ENCINDEX - /usr/lib64/gems/ruby/xmlparser-0.7.2.1/xmlparser.so (LoadError)
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:159:in `rescue in require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:39:in `require'
	from -e:1:in `<main>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- xmlparser (LoadError)
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from -e:1:in `<main>'

Comment 1 Ulrich Schwickerath 2023-04-20 11:49:04 UTC
Looking at the upstream there does not seem to be an update (yet?). 
The missing symbol is defined in https://github.com/ruby/ruby/blob/master/encoding.c it seems.

Comment 2 Fedora Release Engineering 2023-08-16 07:13:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 3 Florian Weimer 2023-08-29 15:35:34 UTC
The package will soon FTBFS because of this issue. I do not plan to work around the build failure because the package is unusable anyway.

Comment 4 Ulrich Schwickerath 2023-08-30 17:44:40 UTC
This patch seems to work for me:

https://src.fedoraproject.org/rpms/rubygem-xmlparser/pull-request/1

[~]$ rpm -qa | grep xmlparser
rubygem-xmlparser-0.7.2.1-23.fc40.x86_64
[~]$ cat /etc/redhat-release 
Fedora release 40 (Rawhide)
[~]$ ruby -e 'require "xmlparser"'
[~]$ exit

Hope this solves the issue. Speaking longer term, the code does not seem to be maintained any longer upstream so at some point it may have to be orphaned.

Comment 5 Ulrich Schwickerath 2023-08-31 15:27:59 UTC
I have merged the change which is made to be backward compatible and since the package apparently is broken in 39 and rawhide anyway.

Comment 6 Mamoru TASAKA 2023-10-03 14:21:21 UTC
So the "implicit function warning" appears beginning with Fedora 22 era:
https://koji.fedoraproject.org/koji/buildinfo?buildID=604347
https://kojipkgs.fedoraproject.org//vol/fedora_koji_archive01/packages/rubygem-xmlparser/0.7.2.1/11.fc22/data/logs/x86_64/build.log

by the following change brought into ruby 2.2:
https://github.com/ruby/ruby/commit/0fec24f972ecd5d0b714a48c9a21e322285f9778

So this package is broken from Fedora 22, actually on Fedora 37 this package is (still) broken:

[mockbuild@a46dcaa5e8cf4b2880028c5243421936 ~]$ rpm -q ruby rubygem-xmlparser
ruby-3.1.4-176.fc37.x86_64
rubygem-xmlparser-0.7.2.1-35.fc37.x86_64
[mockbuild@a46dcaa5e8cf4b2880028c5243421936 ~]$ ruby -e "require 'xmlparser'"
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:160:in `require': /usr/lib64/gems/ruby/xmlparser-0.7.2.1/xmlparser.so: undefined symbol: ENC_TO_ENCINDEX - /usr/lib64/gems/ruby/xmlparser-0.7.2.1/xmlparser.so (LoadError)
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:149:in `require'
	from -e:1:in `<main>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- xmlparser (LoadError)
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from -e:1:in `<main>'


So what is the plan for this issue? Honestly saying, I am not sure if we need this package anyway, because
as I've said above this package has been broken since Fedora 22, but it seems nobody cared...

BTW the correct fix seems to use rb_enc_to_index , not reintroducing ENC_TO_ENCINDEX macro.

Comment 7 Ulrich Schwickerath 2023-10-03 15:32:30 UTC
Hi,

The patch I did go into 0.7.2.1-39, see MR above. Worth to recheck? 

About the future of the package, I'm happy to improve the patch if people want that, albeit this should be done upstream ...
If you prefer to drop the package, that is fine for me as well. We (on our side) no longer need it. 
If you believe it is worth to invest time on improving the patch, I will do it. Let me know what you prefer.

Comment 8 Mamoru TASAKA 2023-10-04 11:35:22 UTC
(In reply to Ulrich Schwickerath from comment #7)
> Hi,
> 
> The patch I did go into 0.7.2.1-39, see MR above. Worth to recheck? 

First, the above pull request is open, someone has to actually merge it.
So the patch is not formally applied into Fedora git repository,
and rubygem-xmlparser on Fedora repository does not "build" yet.

Also, even if the pull request is merged, you have to actually build it.
Then as rubygem-xmlparser is broken also on stable branches (and F39),
the above pull request must be applied to all branches currently supported,
then the actual builds must be done, and the rebuilt rpms have to be
submitted to bodhi.


> About the future of the package, I'm happy to improve the patch if people
> want that, albeit this should be done upstream ...
> If you prefer to drop the package, that is fine for me as well. We (on our
> side) no longer need it. 
> If you believe it is worth to invest time on improving the patch, I will do
> it. Let me know what you prefer.

The correct fix is to just replace ENC_TO_ENCINDEX with rb_enc_to_index:
https://salsa.debian.org/ruby-team/ruby-xmlparser/-/blob/master/debian/patches/827835.patch

Comment 9 Fedora Update System 2023-10-04 19:26:32 UTC
FEDORA-2023-e1d9998451 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e1d9998451

Comment 10 Fedora Update System 2023-10-04 19:27:45 UTC
FEDORA-2023-884ec280e9 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-884ec280e9

Comment 11 Fedora Update System 2023-10-04 19:28:19 UTC
FEDORA-2023-33e6320bf5 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-33e6320bf5

Comment 12 Fedora Update System 2023-10-05 01:18:57 UTC
FEDORA-2023-33e6320bf5 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-33e6320bf5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-33e6320bf5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2023-10-05 01:50:10 UTC
FEDORA-2023-e1d9998451 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-e1d9998451`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-e1d9998451

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2023-10-05 02:29:33 UTC
FEDORA-2023-884ec280e9 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-884ec280e9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-884ec280e9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2023-10-13 01:33:22 UTC
FEDORA-2023-33e6320bf5 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2023-10-13 01:52:48 UTC
FEDORA-2023-884ec280e9 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2023-11-03 18:29:53 UTC
FEDORA-2023-e1d9998451 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.