Bug 1225861

Summary: Package libyui does not build with gcc14
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Jambor <mjambor>
Component: YaST2Assignee: Martin Jambor <mjambor>
Status: IN_PROGRESS --- QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: chcao
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://trello.com/c/EfJmSyVh
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1220574    

Description Martin Jambor 2024-06-03 15:42:45 UTC
Package libyui does not build with gcc14.

One reason is a new C++ error:

[   17s] /home/abuild/rpmbuild/BUILD/libyui-4.6.1/libyui/src/TreeItem.h:49:23: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
[   17s]    49 |     TreeItem<PAYLOAD> ( const PAYLOAD &         val,
[   17s]       |                       ^
[   17s] /home/abuild/rpmbuild/BUILD/libyui-4.6.1/libyui/src/TreeItem.h:49:23: note: remove the ‘< >’

but when that is avoided by using option -Wno-error=template-id-cdtor,
the compilation dies later on with:

In file included from /home/abuild/rpmbuild/BUILD/libyui-4.6.1/libyui/src/FSize.cc:36:
/usr/include/boost/multiprecision/cpp_bin_float.hpp:40:10: fatal error: quadmath.h: No such file or directory

(ISTR a bootst mis-configuration issue resulting into this early in
the GCC 14 development cycle).
Comment 2 Stefan Hundhammer 2024-07-03 14:20:47 UTC
https://github.com/libyui/libyui/blob/master/libyui/src/TreeItem.h#L49

>  33  /**
>  34   * Template class for tree items that can handle tree children in a
>  35   * generic way - firstChild(), next() and parent(). Each item stores one value
>  36   * of type 'PAYLOAD'.
>  37   *
>  38   * Class 'PAYLOAD' needs to provide operator=().
>  39   **/
>  40  template<class PAYLOAD> class TreeItem
>  41  {
>  42  public:
>  43  
>  44      /**
>  45       * Constructor. Creates a new tree item with value "val" and inserts it
>  46       * ( without maintaining any meaningful sort order! ) into the children list
>  47       * of "parent".
>  48       **/
>  49      TreeItem<PAYLOAD> ( const PAYLOAD &         val,
>  50                          TreeItem<PAYLOAD> *     parent = 0 )
>  51          : _value( val )
>  52          , _parent( parent )
>  53          , _next(0)
>  54          , _firstChild(0)
>  55      {
>  56          if ( _parent )
>  57              _parent->addChild( this );
>  58      }
>  59  
>  60  

What on earth is it complaining about now?
What did they introduce now to make a developer's life even harder?

> TreeItem.h:49:23: note: remove the ‘< >’

?!????
Comment 4 Stefan Hundhammer 2024-07-03 14:34:35 UTC
Looks like we should compile with the '-std=c++11' (or c++14 or c++17) option if they introduced incompatible standards like this in C++20.
Comment 6 Stefan Hundhammer 2024-07-11 14:47:20 UTC
Draft PR (WIP):

https://github.com/libyui/libyui/pull/110

The missing quadmath.h problem is still there.
Comment 7 Stefan Hundhammer 2024-07-11 15:01:26 UTC
From /usr/include/boost/multiprecision/cpp_bin_float.hpp (which is owned by libboost_headers1_85_0-devel):

>>  #ifdef BOOST_HAS_FLOAT128
>>  #include <quadmath.h>
>>  #endif

Not sure if we can do anything about that from the YaST / libyui side.
Comment 8 Stefan Hundhammer 2024-07-11 15:07:33 UTC
Besides the compile error in FSize.cc that complains about the boost headers trying to include the nonexistent quadmath.h, the rest of all the subdirectories build fine.
Comment 9 Stefan Hundhammer 2024-07-16 14:27:50 UTC
The PR is now merged:

  https://github.com/libyui/libyui/pull/110

This will become available as libyui-16-4.6.2.

Notice that this does not include the quadmath.h problem which is very likely on the boost side.
Comment 10 Stefan Hundhammer 2024-07-17 07:41:06 UTC
Submitted manually to OBS:

  https://build.opensuse.org/request/show/1188131
Comment 11 Martin Jambor 2024-07-19 14:10:18 UTC
Thank you very much for dealing with the warnings.

Because the package still fails, I'm re-opening the bug however but also assigning it to myself and will try to deal with the problematic include of quadmath.h.
Comment 12 Martin Jambor 2024-07-19 14:44:07 UTC
(In reply to Stefan Hundhammer from comment #7)
> From /usr/include/boost/multiprecision/cpp_bin_float.hpp (which is owned by
> libboost_headers1_85_0-devel):
> 
> >>  #ifdef BOOST_HAS_FLOAT128
> >>  #include <quadmath.h>
> >>  #endif
> 
> Not sure if we can do anything about that from the YaST / libyui side.

Because of a bug[1] in GCC 13 and earlier versions, the #include of
quadmath.h in multiprecision/cpp_bin_float.hpp did not fail even when
the header file was not present on the system and compilation
succeeded as long as nothing from the header file was actually needed.

Examining this build failure, I noticed that in
math/special_functions/fpclassify.hpp (which is indirectly included
from multiprecision/cpp_bin_float.hpp) the existence of the header
file is specifically tested and macro BOOST_MATH_HAS_QUADMATH_H is
defined or not accordingly.  I have therefore asked upstream if the
same macro should not be used also here.

Meanwhile, as a workaround, I would simply like to add gcc-fotran as
another build requirement of the package, because that is where
quadmath.h is distributed.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80753
Comment 13 Martin Jambor 2024-07-20 10:46:42 UTC
It seems upstream boost is receptive to addressing this on their end: https://lists.boost.org/Archives/boost/2024/07/257226.php