Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917561 - x11-misc/shared-mime-info-2.4 fails to build with dev-libs/libxml2-2.12.0 and clang-17
Summary: x11-misc/shared-mime-info-2.4 fails to build with dev-libs/libxml2-2.12.0 and...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: systemwide-clang libxml2-2.12
  Show dependency tree
 
Reported: 2023-11-18 10:42 UTC by Chris Pritchard
Modified: 2024-02-06 03:31 UTC (History)
0 users

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


Attachments
emerge --info (file_917561.txt,15.82 KB, text/plain)
2023-11-18 10:43 UTC, Chris Pritchard
Details
build.log (file_917561.txt,16.31 KB, text/plain)
2023-11-18 10:43 UTC, Chris Pritchard
Details
fix-build-clang.patch (file_917561.txt,267 bytes, patch)
2023-11-19 10:10 UTC, Chris Pritchard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Pritchard 2023-11-18 10:42:07 UTC
Building x11-misc/shared-mime-info with both libxml2-2.12.0 and clang-17 fails to work with 2 errors (implicit function declaration, and incompatible integer to pointer conversion)

The first became an error in clang 16 and the second in clang 15 I believe.

These errors don't occur with the previous version of libxml2, and the package buulds successfully if I enable -Wno-error=int-conversion -Wno-error=implicit-function-declaration as CFLAGS.

For now libxml2-2.12.0 is masked, but I'll add this as a blocker to both 408963 and 917537

Reproducible: Always

Steps to Reproduce:
1. Install libxml2-2.12.0
2. Have clang as a system compiler
3. Emerge shared-mime-info
Actual Results:  

../shared-mime-info-2.4/src/test-subclassing.c:12:8: error: call to undeclared function 'xmlReadFile'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   12 |         doc = xmlReadFile ("freedesktop.org.xml", NULL, 0);
      |               ^
../shared-mime-info-2.4/src/test-subclassing.c:12:6: error: incompatible integer to pointer conversion assigning to 'xmlDocPtr' (aka 'struct _xmlDoc *') from 'int' [-Wint-conversion]
   12 |         doc = xmlReadFile ("freedesktop.org.xml", NULL, 0);

Expected Results:  
Package builds successfully
Comment 1 Chris Pritchard 2023-11-18 10:43:17 UTC
Created attachment 875131 [details]
emerge --info
Comment 2 Chris Pritchard 2023-11-18 10:43:52 UTC
Created attachment 875132 [details]
build.log
Comment 3 Andreas Sturmlechner gentoo-dev 2023-11-18 13:47:40 UTC
Builds fine against 2.12.0 using GCC-13 not sure blocking bug 917537 is correct.
Comment 4 Chris Pritchard 2023-11-18 23:19:02 UTC
Amended given the below comment and that this builds with GCC (I don't have a GCC based system to test with, sorry).
Comment 5 Chris Pritchard 2023-11-18 23:22:31 UTC
Reported on upstream bug tracker: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/219
Comment 6 Chris Pritchard 2023-11-19 10:10:51 UTC
Created attachment 875169 [details, diff]
fix-build-clang.patch

Upstream provided a patch on their bug report. I have checked and it builds and installs fine with this as a user patch.
Comment 7 Chris Pritchard 2023-11-19 10:13:30 UTC
Can confirm that even with this patch, it still builds and installs fine on the previous version of libxml2 (2.11.6) as well, although I haven't been able to test using GCC.
Comment 8 Chris Pritchard 2023-11-19 10:20:44 UTC
Will be fixed in the next upstream version via: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/c918fe77e255150938e83a6aec259f153d303573
Comment 9 Larry the Git Cow gentoo-dev 2024-02-06 03:31:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=195e216792faf46cb927875cef75ad6870ac4baa

commit 195e216792faf46cb927875cef75ad6870ac4baa
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-02-06 03:30:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-02-06 03:30:54 +0000

    x11-misc/shared-mime-info: fix build w/ libxml2-2.12
    
    Closes: https://bugs.gentoo.org/917561
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/shared-mime-info-2.4-libxml2.12.patch      | 20 ++++++++++++++++++++
 ...nfo-2.4.ebuild => shared-mime-info-2.4-r1.ebuild} |  6 +++++-
 2 files changed, 25 insertions(+), 1 deletion(-)