FreeBSD 13-CURRENT amd64, clang version 10.0.0
Builds fails with:
/usr/local/libexec/ccache/c++ -DDESKTOP_APP_DISABLE_CRASH_REPORTS -DDESKTOP_APP_USE_PACKAGED -DDESKTOP_APP_USE_PACKAGED_FONTS -DNDEBUG -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQ_OS_FREEBSD -DQ_OS_LINUX64 -I/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/lib_spellcheck -ITelegram/lib_ui/gen -I/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/lib_ui -I/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/lib_ui/emoji_suggestions -I/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/lib_base -I/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/lib_rpl -I/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/lib_crl -isystem /usr/local/include/hunspell -isystem /usr/local/include/qt5/QtCore/5.13.2 -isystem /usr/local/include/qt5/QtCore/5.13.2/QtCore -isystem /usr/local/include/qt5/QtGui/5.13.2 -isystem /usr/local/include/qt5/QtGui/5.13.2/QtGui -isystem /usr/local/include/qt5 -isystem /usr/local/include/qt5/QtCore -isystem /usr/local/lib/qt5/mkspecs/freebsd-clang -isystem /usr/local/include/qt5/QtGui -isystem /usr/local/include -isystem /usr/local/include/qt5/QtWidgets -isystem /usr/local/include/qt5/QtNetwork -isystem /usr/local/include/qt5/QtDBus -isystem /wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/ThirdParty/variant/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fno-strict-aliasing -pipe -Wall -W -fPIC -Wno-unused-variable -Wno-unused-parameter -Wno-unused-function -Wno-switch -Wno-comment -Wno-unused-but-set-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-attributes -Wno-parentheses -Wno-stringop-overflow -Wno-maybe-uninitialized -Wno-error=class-memaccess -std=gnu++2a -Xclang -include-pch -Xclang /wrkdirs/usr/ports/net-im/telegram-desktop/work/.build/Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/cmake_pch.hxx.pch -MD -MT Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/spellcheck/third_party/hunspell_controller.cpp.o -MF Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/spellcheck/third_party/hunspell_controller.cpp.o.d -o Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/spellcheck/third_party/hunspell_controller.cpp.o -c /wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.0.1-full/Telegram/lib_spellcheck/spellcheck/third_party/hunspell_controller.cpp
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-stringop-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
warning: unknown warning option '-Werror=class-memaccess'; did you mean '-Werror=class-varargs'? [-Wunknown-warning-option]
fatal error: file '/wrkdirs/usr/ports/net-im/telegram-desktop/work/.build/Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/cmake_pch.hxx' has been modified since the precompiled header '/wrkdirs/usr/ports/net-im/telegram-desktop/work/.build/Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/cmake_pch.hxx.pch' was built: mtime changed
note: please rebuild precompiled header '/wrkdirs/usr/ports/net-im/telegram-desktop/work/.build/Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/cmake_pch.hxx.pch'
4 warnings and 1 error generated.
Complete log attached.
Apparently, the log file is too big for attachment, so here it goes: https://people.freebsd.org/~novel/misc/telegram-desktop-2.0.1.log
Interestingly, I tried to use clang10 on 12.1-STABLE (make CC=clang10 CXX=clang++10), and it works. Thus, maybe it's not clang, but something else.
However, I don't have -CURRENT installed, so I can't test how it works there.
Meanwhile, can you check the mtime of
(stat -f %m, etc.) to check if the .hxx file is really modified after .pch?
I've seen this sometimes when ccache is enabled (with Qt moc files for example).
Roman, I see you have ccache enabled. Would you try disabling it?
(07:04) novel@romashka:/usr/local/poudriere/data/wrkdirs/current-local/local/work %> stat -f %m .build/Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/cmake_pch.hxx
(07:04) novel@romashka:/usr/local/poudriere/data/wrkdirs/current-local/local/work %> stat -f %m .build/Telegram/lib_spellcheck/CMakeFiles/lib_spellcheck.dir/cmake_pch.hxx.pch
(07:04) novel@romashka:/usr/local/poudriere/data/wrkdirs/current-local/local/work %>
It does build fine without ccache indeed. However, when it's enabled, the failure doesn't seem to be intermittent, i.e. it failed all 3 or 4 times that I've tried to build it.
This issue (clang + ccache + telegram) should probably be reported/resolved upstream
(In reply to Kubilay Kocak from comment #5)
That would be ideal, but until then, perhaps we can set NO_CCACHE in net-im/telegram-desktop/Makefile?
(In reply to Kubilay Kocak from comment #5)
I think it's more than that. I'm running 12.1-STABLE and the clang version is 9.0.1. I also have ccache enabled. When I build the telegram-desktop, I don't have this issue.
Maybe it's clang10 + ccache?
I agree that we can temporarily disable ccache to at least make it build.
Created attachment 213239 [details]
I'm going to test the attached patch that disables ccache and commit it later today if that helps.
Please let me know if you have any objections.
PS As it's quite clear when this issue shows up, I think it's better to disable it unconditionally (rather than checking if compiling with clang10 etc).
(In reply to Roman Bogorodskiy from comment #8)
Yes, it builds fine with NO_CCACHE.
A commit references this bug:
Date: Sat Apr 11 16:33:57 UTC 2020
New revision: 531435
net-im/telegram-desktop: temporarily disable ccache
Building with ccache might fail, so disable it for now until it's fixed.
Approved by: maintainer
Thanks, committed the NO_CCACHE change.
I'm leaving this open until it's properly fixed.
I just built 2.1.0 twice successfully with ccache enabled. First run to generate the cached objects, second run hit the cache. All on 13-CURRENT amd64 base r360679.
(In reply to Charlie Li from comment #12)
I plan a regular ports rebuild closer to the end of this week, hopefully I will not forget to test building telegram-desktop with ccache, probably it was fixed in 2.1.0.
Created attachment 214417 [details]
It builds fine now for me.
Attached a patch to remove NO_CCACHE.
Comment on attachment 214417 [details]
As I said above, I have no way of testing this. If it builds fine for you, please remove it.
I actually built this again with ccache enabled after the __FreeBSD_version bump, and along with me updating x11-toolkits/pango locally to 1.44.7, hit the error again. Updated this locally to 2.1.4, also with ccache enabled, and the build succeeded but as it was a cache-populating run, it doesn't mean too much. So it seems like enabling ccache here is sensitive to changes/updates in dependent libraries, and probably the best cure is to keep up with telegram-desktop's rather rapid releases.