Bug 440759 - Version 0.10.0 or git (master) fails on build, previous version builds fine
Summary: Version 0.10.0 or git (master) fails on build, previous version builds fine
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: 0.10.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-08 21:36 UTC by Gerald Cox
Modified: 2021-08-12 05:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Cox 2021-08-08 21:36:00 UTC
When trying to build either the current github master or 0.10.0, build fails with following error - however previous release builds just fine.  I've checked dependencies and they all appear fine.  What changed between the new release and previous release which would cause this?  

Thanks!

[ 13%] Built target latte-dock_autogen
cc1plus: some warnings being treated as errors
gmake[2]: *** [containmentactions/contextmenu/CMakeFiles/plasma_containmentactions_lattecontextmenu.dir/build.make:121: containmentactions/contextmenu/CMakeFiles/plasma_containmentactions_lattecontextmenu.dir/menu.cpp.o] Error 1
gmake[2]: Leaving directory '/builddir/build/BUILD/latte-dock-e1a472811d7dfdf284d2c335469dcaa95a93ddfb/redhat-linux-build'
gmake[1]: *** [CMakeFiles/Makefile2:1130: containmentactions/contextmenu/CMakeFiles/plasma_containmentactions_lattecontextmenu.dir/all] Error 2
gmake[1]: Leaving directory '/builddir/build/BUILD/latte-dock-e1a472811d7dfdf284d2c335469dcaa95a93ddfb/redhat-linux-build'
gmake: *** [Makefile:139: all] Error 2
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.vwVJ1l (%build)
    Bad exit status from /var/tmp/rpm-tmp.vwVJ1l (%build)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.9/site-packages/mockbuild/util.py", line 600, in do_with_status
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed: 
 # /usr/bin/systemd-nspawn -q -M 52f5e10fb8bf43839556bfbacb23a257 -D /var/lib/mock/fedora-rawhide-x86_64/root -a -u mockbuild --capability=cap_ipc_lock --bind=/tmp/mock-resolv.goeyepw0:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=C.UTF-8 --resolv-conf=off bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/latte-dock.spec




STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Fedora 34

Found KF5Activities: /usr/lib64/cmake/KF5Activities/KF5ActivitiesConfig.cmake (found version "5.83.0") 
-- Found KF5Archive: /usr/lib64/cmake/KF5Archive/KF5ArchiveConfig.cmake (found version "5.83.0") 
-- Found KF5CoreAddons: /usr/lib64/cmake/KF5CoreAddons/KF5CoreAddonsConfig.cmake (found version "5.83.0") 
-- Found KF5GuiAddons: /usr/lib64/cmake/KF5GuiAddons/KF5GuiAddonsConfig.cmake (found version "5.83.0") 
-- Found KF5Crash: /usr/lib64/cmake/KF5Crash/KF5CrashConfig.cmake (found version "5.83.0") 
-- Found KF5DBusAddons: /usr/lib64/cmake/KF5DBusAddons/KF5DBusAddonsConfig.cmake (found version "5.83.0") 
-- Found KF5Declarative: /usr/lib64/cmake/KF5Declarative/KF5DeclarativeConfig.cmake (found version "5.83.0") 
-- Found KF5GlobalAccel: /usr/lib64/cmake/KF5GlobalAccel/KF5GlobalAccelConfig.cmake (found version "5.83.0") 
-- Found KF5Kirigami2: /usr/lib64/cmake/KF5Kirigami2/KF5Kirigami2Config.cmake (found version "5.83.0") 
-- Found Gettext: /usr/bin/msgmerge (found version "0.21") 
-- Found KF5I18n: /usr/lib64/cmake/KF5I18n/KF5I18nConfig.cmake (found version "5.83.0") 
-- Found KF5IconThemes: /usr/lib64/cmake/KF5IconThemes/KF5IconThemesConfig.cmake (found version "5.83.0") 
-- Found KF5KIO: /usr/lib64/cmake/KF5KIO/KF5KIOConfig.cmake (found version "5.83.0") 
-- Found KF5NewStuff: /usr/lib64/cmake/KF5NewStuff/KF5NewStuffConfig.cmake (found version "5.83.0") 
-- Found KF5Notifications: /usr/lib64/cmake/KF5Notifications/KF5NotificationsConfig.cmake (found version "5.83.0") 
-- Found KF5Plasma: /usr/lib64/cmake/KF5Plasma/KF5PlasmaConfig.cmake (found version "5.83.0") 
-- Found KF5PlasmaQuick: /usr/lib64/cmake/KF5PlasmaQuick/KF5PlasmaQuickConfig.cmake (found version "5.83.0") 
-- Found KF5Wayland: /usr/lib64/cmake/KF5Wayland/KF5WaylandConfig.cmake (found version "5.83.0") 
-- Found KF5WindowSystem: /usr/lib64/cmake/KF5WindowSystem/KF5WindowSystemConfig.cmake (found version "5.83.0") 
-- Found KF5XmlGui: /usr/lib64/cmake/KF5XmlGui/KF5XmlGuiConfig.cmake (found version "5.83.0") 
-- Found KF5: success (found suitable version "5.83.0", minimum required is "5.48.0") found components: Activities Archive CoreAddons GuiAddons Crash DBusAddons Declarative GlobalAccel Kirigami2 I18n IconThemes KIO NewStuff Notifications Plasma PlasmaQuick Wayland WindowSystem XmlGui 
-- Looking for XOpenDisplay in /usr/lib64/libX11.so - found
-- Looking for gethostbyname - found
-- Looking for connect - found
-- Looking for remove - found
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE - found
-- Found XCB_XCB: /usr/lib64/libxcb.so (found version "1.13.1") 
-- Found XCB_SHAPE: /usr/lib64/libxcb-shape.so (found version "1.13.1") 
-- Found XCB_EVENT: /usr/lib64/libxcb-util.so (found version "0.4.0") 
-- Found XCB_RANDR: /usr/lib64/libxcb-randr.so (found version "1.13.1") 
-- Found XCB: /usr/lib64/libxcb.so;/usr/lib64/libxcb-shape.so;/usr/lib64/libxcb-util.so;/usr/lib64/libxcb-randr.so (found version "1.13.1") found components: XCB RANDR SHAPE EVENT 
-- Found QtQuick-QMLModule: TRUE (found version "")  
-- Found QtQuick.Layouts-QMLModule: TRUE (found version "")  
-- Found QtQuick.Controls-QMLModule: TRUE (found version "")  
-- Found QtQuick.Controls.Styles.Plasma-QMLModule: TRUE (found version "")  
-- Found QtGraphicalEffects-QMLModule: TRUE (found version "")  
-- Found org.kde.kquickcontrolsaddons-QMLModule: TRUE (found version "")  
-- Found org.kde.plasma.core-QMLModule: TRUE (found version "")  
-- Found org.kde.plasma.components-QMLModule: TRUE (found version "")  
-- Looking for __GLIBC__ - found
Comment 1 Michail Vourlakos 2021-08-09 05:48:39 UTC
You probably miss a dependency. You need to run sh install.sh and provide full output in order to identify what is wrong. The output you provide is not from sh install.sh
Comment 2 Gerald Cox 2021-08-10 22:18:59 UTC
Thanks for the quick response.  I found this issue.  I had to remove the following lines from CmakeLists.txt:


string(REPLACE "-Wall" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wformat-security" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})

If you look at the log in my previous post, you'll see that the compiler is failing because "some warnings being treated as errors".  

This is causing the build to fail on Fedora.  If you can either fix the errors or remove the lines from CmakeLists.txt it would be much appreciated.  I also found this that explains the situation:  

https://fedoraproject.org/wiki/Format-Security-FAQ

The reason this issue didn't occur in the previous releases was that the above mentioned lines weren't included until release 0.10.
Comment 3 Michail Vourlakos 2021-08-11 05:10:54 UTC
Sorry I want these lines. Latte builds fine on the rest distros so if Fedora does not want findna solution then Fedora packagers can just remove these lines to create a package for the distro. The mentioned lines do not influence Latte functionality at all.
Comment 4 Gerald Cox 2021-08-11 13:44:29 UTC
(In reply to Michail Vourlakos from comment #3)
> Sorry I want these lines. Latte builds fine on the rest distros so if Fedora
> does not want findna solution then Fedora packagers can just remove these
> lines to create a package for the distro. The mentioned lines do not
> influence Latte functionality at all.

Sorry for reopening, but I found some more information...

I found that in Fedora it's tripping over -Werror=format-security

For some reason, when the other lines were added, it activated that error.
Since you want to keep those other lines in, would you consider adding:

string(REPLACE "-Werror=format-security" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})

Why it's not happening in other distros, don't know.  Perhaps it will when they upgrade to later versions, but adding the additional line shouldn't cause them any issues, if the string isn't found, it will just be ignored.
Comment 5 Michail Vourlakos 2021-08-11 14:49:55 UTC
Other distros are already providing latest versions. You can leave it open and see how it goes. No idea when and if i will add it.
Comment 6 Gerald Cox 2021-08-11 14:55:20 UTC
(In reply to Michail Vourlakos from comment #5)
> Other distros are already providing latest versions. You can leave it open
> and see how it goes. No idea when and if i will add it.

Thanks, I've also submitted a question within the project to see if someone can explain what exactly is happening and why.  I'll let you know when I get a response.  It could be that fedora is at a more recent version of the software and/or that the other distros just patched CMakeList.txt without letting you know.
Comment 7 Michail Vourlakos 2021-08-11 15:06:34 UTC
An update, reading Fedora article then Fedora is pretty clear why it is adding that specific check. Its argument is pretty understandable. 

First of all removing the check that Fedora adds is not good practice that could make Latte banned from Fedora because is not following its rules. 

Secondly in order for Latte to be accepted in Fedora the only way is Latte to become compatible with this. Latte v0.10 is being developed for two years, these two years none came and reguested that compliance. Unfortunately making v0.10 compliant I have no idea how much work is needed and also if it is also possible to not break translations. 

To make things even more anxious, v0.10 is scheduled to stay around for many years around. I have no idea if I will ever release a v0.11 or if someone will step in to continue development.
Comment 8 Gerald Cox 2021-08-11 16:28:31 UTC
Thanks again for your quick replies.  I don't believe anyone is talking about banning anything.  I counted 15 errors when the compile failed.  I'll see if I can figure out a way to get more information to narrow that down.  I'm still a bit confused about why removing those lines made the problem disappear in Fedora.  IMO, it shouldn't have.  Additionally, when this change was approved by Fedora, they said that other distributions had already implemented, and that was 7 years ago.  So if that is indeed the case then that to me would imply they are also bypassing the check.  I had asked the question in the maintainer forum, if I don't get an answer there I'll open a ticket with the build infrastructure team.  I'll let you know what I find.  Thanks again for your quick responses.  latte-dock is a great package and also thanks for the .10 update.  I'm running it now on my laptop and it's working with no issues!
Comment 9 Michail Vourlakos 2021-08-11 17:06:31 UTC
I made a test. Please change the two lines you mentioned in CMakeLists file with:

#hide warnings
string(REPLACE "-Wall" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wdeprecated-declarations" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wreorder" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wunused-variable" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wunused-parameter" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})

#add format security check
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Werror=format-security")


1. I enforced the Fedora rule to check what errors are happening
2. Does it build in Fedora in that case?
3. In my system it with above changes it builds just fine. If it doesnt build in Fedora what warnings are considered errors and it is not built?
Comment 10 Gerald Cox 2021-08-11 17:49:09 UTC
(In reply to Michail Vourlakos from comment #9)
> I made a test. Please change the two lines you mentioned in CMakeLists file
> with:
> 
> #hide warnings
> string(REPLACE "-Wall" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
> string(REPLACE "-Wdeprecated-declarations" "" CMAKE_CXX_FLAGS
> ${CMAKE_CXX_FLAGS})
> string(REPLACE "-Wreorder" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
> string(REPLACE "-Wunused-variable" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
> string(REPLACE "-Wunused-parameter" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
> 
> #add format security check
> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Werror=format-security")
> 
> 
> 1. I enforced the Fedora rule to check what errors are happening
> 2. Does it build in Fedora in that case?
> 3. In my system it with above changes it builds just fine. If it doesnt
> build in Fedora what warnings are considered errors and it is not built?

Yes, that builds fine!  Thanks for fixing!

I also ran with the trace option, the error is:

cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]

so that seems to imply that the errors are from removing the -Wformat and Fedora adding the Werror=format-security.  Which would explain why when I also removing it via the string REPLACE gets around the issue.
Comment 11 Michail Vourlakos 2021-08-12 05:07:25 UTC
Git commit a67e3c050f1bf79d6e9687cfd66c8733b3d4bdd0 by Michail Vourlakos.
Committed on 12/08/2021 at 05:04.
Pushed by mvourlakos into branch 'v0.10'.

fix build with Fedora requirements

--simplify warnings and add formalt security checks

M  +8    -1    CMakeLists.txt

https://invent.kde.org/plasma/latte-dock/commit/a67e3c050f1bf79d6e9687cfd66c8733b3d4bdd0
Comment 12 Michail Vourlakos 2021-08-12 05:08:10 UTC
Git commit 66ddda956b299bfe8c6c001f15b0164980d70dad by Michail Vourlakos.
Committed on 12/08/2021 at 05:08.
Pushed by mvourlakos into branch 'master'.

fix build with Fedora requirements

--simplify warnings and add formalt security checks

M  +8    -1    CMakeLists.txt

https://invent.kde.org/plasma/latte-dock/commit/66ddda956b299bfe8c6c001f15b0164980d70dad