Bug 2276345

Summary: kdebase3: FTBFS in Fedora rawhide/f41
Product: [Fedora] Fedora Reporter: Charles R. Anderson <cra>
Component: kdebase3Assignee: Than Ngo <than>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: fberat, fjanus, kasal, kevin, praiskup, rdieter, than
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
URL: https://koji.fedoraproject.org/koji/buildinfo?buildID=2441875
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-22 21:40:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
build.log
none
root.log
none
state.log none

Description Charles R. Anderson 2024-04-22 07:01:24 UTC
kdebase3 failed to build from source in Fedora rawhide/f41

https://koji.fedoraproject.org/koji/buildinfo?buildID=2441875

Please fix kdebase3 at your earliest convenience and set the bug's status to
ASSIGNED when you start fixing it.

For more details on the FTBFS policy, please visit:
https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/

Reproducible: Always

Actual Results:  
checking for Qt... libraries /usr/lib64/qt-3.3/lib, headers /usr/lib64/qt-3.3/include using -mt
checking for moc... /usr/lib64/qt-3.3/bin/moc
checking for uic... /usr/lib64/qt-3.3/bin/uic
checking whether uic supports -L ... yes
checking whether uic supports -nounload ... yes
./configure: line 27455: syntax error near unexpected token `fi'
./configure: line 27455: `fi'
RPM build warnings:
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.fE2hx4 (%build)
    %patchN is deprecated (38 usages found), use %patch N (or %patch -P N)
    Bad exit status from /var/tmp/rpm-tmp.fE2hx4 (%build)
Child return code was: 1

Comment 1 Charles R. Anderson 2024-04-22 07:01:49 UTC
Created attachment 2028240 [details]
build.log

Comment 2 Charles R. Anderson 2024-04-22 07:02:06 UTC
Created attachment 2028241 [details]
root.log

Comment 3 Charles R. Anderson 2024-04-22 07:02:24 UTC
Created attachment 2028242 [details]
state.log

Comment 4 Than Ngo 2024-04-22 10:06:19 UTC
It just works fine with autoconf-2.71 in fedora 39/40, it looks like regression in autoconf-2.72 in rawhide.
Reassigned it to autoconf

Comment 5 Frédéric Bérat 2024-04-22 13:41:19 UTC
That's not a regression from autoconf, this kind of error appears when there is an error in the configure.ac (or any included files), likely an if statement not properly closed (the `fi` is in the wrong place).

This kind of mistake is uncovered with autoconf 2.72 because the implementation of the AS_IF (used everywhere internally) statement has been reworked, but the bug is actually in the user side. Autoconf < 2.72 just happened to be more sensitive to this error.

More specifically, in your case, the acinclude.m4 contains an error in KDE_CHECK_QT_JPEG:

AC_DEFUN([KDE_CHECK_QT_JPEG],
[
if test -n "$LIBJPEG"; then
AC_MSG_CHECKING([if Qt needs $LIBJPEG])
AC_CACHE_VAL(kde_cv_qt_jpeg,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_LIBS="$LIBS"
LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK(
[#include <qapplication.h>],
            [
            int argc;
            char** argv;
            QApplication app(argc, argv);],
            eval "kde_cv_qt_jpeg=no",
            eval "kde_cv_qt_jpeg=yes")
LIBS="$ac_save_LIBS"
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
fi
])

The "fi" closes `if test -n "$LIBJPEG"; then` while the `])` closes `AC_CACHE_VAL(` within the if.
i.e. 

Last 2 lines of the snippet must be:

])
fi

Similarly, the AC_DEFUN([KDE_FIND_LIBEXR] macro is incorrect (lines 2747 to 2811), there is a `])` closure (line 2797) for `AC_CACHE_VAL` in the middle of `if .. else ... fi` statements instead of being at the end of the macro definition. the `dnl` seems inappropriate too, and was probably put there because the closure is misplaced.

Please carefully control this analysis, there may be other errors around.

Comment 6 Than Ngo 2024-04-22 21:40:01 UTC
it's fixed in 3.5.10-82