Bug 431775 - Compiling with ccache issue
Summary: Compiling with ccache issue
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Runtime (show other bugs)
Version: 7.2.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-18 11:15 UTC by maderios
Modified: 2021-05-23 12:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.2.0


Attachments
change to handle ccache in compilation Digikam (2.75 KB, patch)
2021-01-26 13:38 UTC, Phuoc Khanh LE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maderios 2021-01-18 11:15:40 UTC
This discussion started here https://bugs.kde.org/show_bug.cgi?id=431658
OBSERVED RESULT
[58%] Building CXX object core/app/CMakeFiles/digikamcore.dir/utils/digikam_version.cpp.o
Failed to create directory /run/user/0/ccache-tmp: Permission denied

I test other build applications: Amarok git, efl-git, enlightenment-git, rage-git, terminology-git. They compile fine with Ccache.
I see Digikam ccache build begin  to write successfully in /run/user/1000
Then he tries to write in /run/user/0 
He can't because /run/user/0 belongs to root and root group
This issue happens only with Digikam 
SOFTWARE/OS VERSIONS
Ccache 4.1
Cmake 3.19.3
Linux Arch
Comment 1 caulier.gilles 2021-01-18 13:31:13 UTC
In fact, digiKam cmake rules are missing to handle ccache.

Something similar to Exiv2 must be implemented in DK :

1/ new cmake option:

 https://github.com/Exiv2/exiv2/blob/master/CMakeLists.txt#L47

2/ new cmake rules:

https://github.com/Exiv2/exiv2/blob/master/cmake/findDependencies.cmake#L53

That all...

Gilles Caulier
Comment 2 caulier.gilles 2021-01-26 10:56:39 UTC
Maik, 

For info, I assigned this file to my new student Phước Khánh Lê to start to fix some issues in bugzilla for next GoSC 2021.

Gilles
Comment 3 Phuoc Khanh LE 2021-01-26 13:38:09 UTC
Created attachment 135207 [details]
change to handle ccache in compilation Digikam

Gilles,
Inspired by code cmake for compilation of exiv2, i inserted an option to handle ccache in compilation of DK. 
For testing, i re-compiled DK with and without ccache to compare the speed. The compilation is accelerated by turning on option BUILD_WITH_CCACHE.
Comment 4 caulier.gilles 2021-01-26 14:41:20 UTC
Git commit 78798218f5de3d2298f354b9a8aaf2361ef87960 by Gilles Caulier.
Committed on 26/01/2021 at 14:39.
Pushed by cgilles into branch 'master'.

Apply patch #135207 from Phuoc Khanh LE to support ccache to speed-up compilations
FIXED-IN: 7.2.0

M  +1    -0    Mainpage.dox
M  +1    -0    bootstrap.linux
M  +19   -0    core/CMakeLists.txt

https://invent.kde.org/graphics/digikam/commit/78798218f5de3d2298f354b9a8aaf2361ef87960
Comment 5 caulier.gilles 2021-01-26 14:47:04 UTC
Git commit 2f021068af0223e84a01c07ebf54f5e6abd96fb3 by Gilles Caulier.
Committed on 26/01/2021 at 14:45.
Pushed by cgilles into branch 'master'.

We can enable ccache with macports and mxe too...

M  +1    -0    bootstrap.macports
M  +1    -0    bootstrap.mxe
M  +1    -0    project/bundles/appimage/01-build-host.sh
M  +1    -0    project/bundles/macports/01-build-macports.sh

https://invent.kde.org/graphics/digikam/commit/2f021068af0223e84a01c07ebf54f5e6abd96fb3
Comment 6 Maik Qualmann 2021-01-26 17:25:32 UTC
I don't know whether we will activate it by default, there are also bugs with ccache. 

https://github.com/ccache/ccache/issues/738

Maik
Comment 7 caulier.gilles 2021-01-26 19:35:53 UTC
Maik,

The option is disabled by default.

MXE use CCache since 2 years now to speed-up compilation, and i must admit that it work well, considerating the amont of code compiled with MXE on my computers.

So we will see step by step how last ccache version work with DK source code with users feedback.

Gilles
Comment 8 maderios 2021-01-27 10:38:33 UTC
I've been using ccache for at least two years to build digikam without any problem.
I use ccache to build other git projects softwares (efl, enlightenment, linux kernel, etc...) it works fine, except with digikam *very recently*. I guess that something has changed in Digikam during last weeks.
Comment 9 caulier.gilles 2021-01-27 17:25:28 UTC
Maik,

i will release the RC this week end and we will see the feedback for few weeks before the final release.

Gilles
Comment 10 maderios 2021-01-27 18:22:50 UTC
Error again with last git master today

IN Arch PKGBUILD
-DBUILD_WITH_CCACHE=ON 

Then when building:
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ - skipped
-- Looking for ccache...
-- ccache program found: /usr/bin/ccache
--  ccache found............................. YES (optional)
-- Using ccache to speed-up compilations..... YES

[ 58%] Building CXX object core/app/CMakeFiles/digikamcore.dir/utils/digikam_version.cpp.o
ccache: error: Failed to create directory /run/user/0/ccache-tmp: Permission denied
make[2]: *** [core/app/CMakeFiles/digikamcore.dir/build.make:108: core/app/CMakeFiles/digikamcore.dir/utils/digikam_version.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9918: core/app/CMakeFiles/digikamcore.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

Odd behaviour: compilation doesn't stop at 58% but reaches about 98% then this error appear, then strangely, all messages from 58% to 98% disappear... I can't get this messages in terminal, even in a "script" file.
Comment 11 maderios 2021-01-27 18:34:02 UTC
> Odd behaviour: compilation doesn't stop at 58% but reaches about 98% then
> this error appear, then strangely, all messages from 58% to 98% disappear...
> I can't get this messages in terminal, even in a "script" file.

Precision: this odd behaviour was already present with previous git versions
Comment 12 Maik Qualmann 2021-01-27 19:24:13 UTC
Could it be that the cache is broken? Maybe just delete the directory. The problem isn't that rare when you google it. But it's always a ccache problem.

Maik
Comment 13 maderios 2021-01-27 20:33:15 UTC
A mistake from me, i didn't see the end of messages, sorry:
It builds successfully to 100% then, it seems there's a problem with package. 
After this digikam build issue, i built successfully efl library and enlightenment with ccache, no issue.
Important: 
- efl and enlightenment use meson and ninja to build, not cmake.
- amarok build uses cmake too. Compilation works normally with ccache.


Here the digikam build end :

[ 98%] [32mBuilding CXX object core/dplugins/bqm/colors/iccconvert/CMakeFiles/Bqm_IccConvert_Plugin.dir/iccconvertplugin.cpp.o[0m
[ 98%] Built target Bqm_BWconvert_Plugin
[35m[1mScanning dependencies of target Bqm_WhiteBalance_Plugin[0m
[ 98%] [32mBuilding CXX object core/dplugins/bqm/colors/whitebalance/CMakeFiles/Bqm_WhiteBalance_Plugin.dir/Bqm_WhiteBalance_Plugin_autogen/mocs_compilation.cpp.o[0m
[ 98%] [32mBuilding CXX object core/dplugins/bqm/colors/iccconvert/CMakeFiles/Bqm_IccConvert_Plugin.dir/iccconvert.cpp.o[0m
[ 98%] [32m[1mLinking CXX shared module Bqm_LensAutoFix_Plugin.so[0m
[ 98%] Built target Bqm_LensAutoFix_Plugin
[ 98%] [32mBuilding CXX object core/dplugins/bqm/colors/whitebalance/CMakeFiles/Bqm_WhiteBalance_Plugin.dir/whitebalanceplugin.cpp.o[0m
[ 98%] [32m[1mLinking CXX shared module Bqm_AutoCorrection_Plugin.so[0m
[ 98%] Built target Bqm_AutoCorrection_Plugin
[ 98%] [32mBuilding CXX object core/dplugins/bqm/colors/whitebalance/CMakeFiles/Bqm_WhiteBalance_Plugin.dir/whitebalance.cpp.o[0m
[ 98%] [32mBuilding CXX object core/dplugins/bqm/colors/convert16to8/CMakeFiles/Bqm_Convert16To8_Plugin.dir/convert16to8.cpp.o[0m
[35m[1mScanning dependencies of target Bqm_BcgCorrection_Plugin[0m
[ 99%] [32mBuilding CXX object core/dplugins/bqm/colors/curvesadjust/CMakeFiles/Bqm_CurvesAdjust_Plugin.dir/curvesadjustplugin.cpp.o[0m
[ 99%] [32mBuilding CXX object core/dplugins/bqm/colors/bcgcorrection/CMakeFiles/Bqm_BcgCorrection_Plugin.dir/Bqm_BcgCorrection_Plugin_autogen/mocs_compilation.cpp.o[0m
[ 99%] [32mBuilding CXX object core/dplugins/bqm/colors/bcgcorrection/CMakeFiles/Bqm_BcgCorrection_Plugin.dir/bcgcorrectionplugin.cpp.o[0m
[ 99%] [32mBuilding CXX object core/dplugins/bqm/colors/bcgcorrection/CMakeFiles/Bqm_BcgCorrection_Plugin.dir/bcgcorrection.cpp.o[0m
[ 99%] [32m[1mLinking CXX shared module Bqm_IccConvert_Plugin.so[0m
[ 99%] Built target Bqm_IccConvert_Plugin
[ 99%] [32mBuilding CXX object core/dplugins/bqm/colors/curvesadjust/CMakeFiles/Bqm_CurvesAdjust_Plugin.dir/curvesadjust.cpp.o[0m
[35m[1mScanning dependencies of target Bqm_ChannelMixer_Plugin[0m
[ 99%] [32m[1mLinking CXX shared module Bqm_Convert16To8_Plugin.so[0m
[ 99%] Built target Bqm_Convert16To8_Plugin
[35m[1mScanning dependencies of target Bqm_ColorBalance_Plugin[0m
[ 99%] [32mBuilding CXX object core/dplugins/bqm/colors/channelmixer/CMakeFiles/Bqm_ChannelMixer_Plugin.dir/Bqm_ChannelMixer_Plugin_autogen/mocs_compilation.cpp.o[0m
[ 99%] [32m[1mLinking CXX shared module Bqm_RedEyeCorrection_Plugin.so[0m
[100%] [32m[1mLinking CXX shared module Bqm_WhiteBalance_Plugin.so[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/colorbalance/CMakeFiles/Bqm_ColorBalance_Plugin.dir/Bqm_ColorBalance_Plugin_autogen/mocs_compilation.cpp.o[0m
[100%] Built target Bqm_RedEyeCorrection_Plugin
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/channelmixer/CMakeFiles/Bqm_ChannelMixer_Plugin.dir/channelmixerplugin.cpp.o[0m
[100%] Built target Bqm_WhiteBalance_Plugin
[35m[1mScanning dependencies of target Bqm_Convert8To16_Plugin[0m
[35m[1mScanning dependencies of target Bqm_HslCorrection_Plugin[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/convert8to16/CMakeFiles/Bqm_Convert8To16_Plugin.dir/Bqm_Convert8To16_Plugin_autogen/mocs_compilation.cpp.o[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/channelmixer/CMakeFiles/Bqm_ChannelMixer_Plugin.dir/channelmixer.cpp.o[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/hslcorrection/CMakeFiles/Bqm_HslCorrection_Plugin.dir/Bqm_HslCorrection_Plugin_autogen/mocs_compilation.cpp.o[0m
[35m[1mScanning dependencies of target Bqm_Invert_Plugin[0m
[100%] [32m[1mLinking CXX shared module Bqm_BcgCorrection_Plugin.so[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/invert/CMakeFiles/Bqm_Invert_Plugin.dir/Bqm_Invert_Plugin_autogen/mocs_compilation.cpp.o[0m
[100%] Built target Bqm_BcgCorrection_Plugin
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/invert/CMakeFiles/Bqm_Invert_Plugin.dir/invertplugin.cpp.o[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/invert/CMakeFiles/Bqm_Invert_Plugin.dir/invert.cpp.o[0m
[100%] [32m[1mLinking CXX shared module Bqm_CurvesAdjust_Plugin.so[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/colorbalance/CMakeFiles/Bqm_ColorBalance_Plugin.dir/colorbalanceplugin.cpp.o[0m
[100%] Built target Bqm_CurvesAdjust_Plugin
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/colorbalance/CMakeFiles/Bqm_ColorBalance_Plugin.dir/colorbalance.cpp.o[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/convert8to16/CMakeFiles/Bqm_Convert8To16_Plugin.dir/convert8to16plugin.cpp.o[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/convert8to16/CMakeFiles/Bqm_Convert8To16_Plugin.dir/convert8to16.cpp.o[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/hslcorrection/CMakeFiles/Bqm_HslCorrection_Plugin.dir/hslcorrectionplugin.cpp.o[0m
[100%] [32m[1mLinking CXX shared module Bqm_ChannelMixer_Plugin.so[0m
[100%] [32mBuilding CXX object core/dplugins/bqm/colors/hslcorrection/CMakeFiles/Bqm_HslCorrection_Plugin.dir/hslcorrection.cpp.o[0m
[100%] Built target Bqm_ChannelMixer_Plugin
[100%] [32m[1mLinking CXX shared module Bqm_Invert_Plugin.so[0m
[100%] Built target Bqm_Invert_Plugin
[100%] [32m[1mLinking CXX shared module Bqm_Convert8To16_Plugin.so[0m
[100%] Built target Bqm_Convert8To16_Plugin
[100%] [32m[1mLinking CXX shared module Bqm_ColorBalance_Plugin.so[0m
[100%] Built target Bqm_ColorBalance_Plugin
[100%] [32m[1mLinking CXX shared module Bqm_HslCorrection_Plugin.so[0m
[100%] Built target Bqm_HslCorrection_Plugin
[1m[32m==>[m[1m Entering fakeroot environment...[m
[1m[33m==> WARNING:[m[1m Cannot find the sudo binary. Will use su to acquire root privileges.[m
[1m[32m==>[m[1m Starting package()...[m
[  0%] [34m[1mAutomatic MOC for target digikamdatabase_obj[0m
[  0%] [34m[1mAutomatic MOC for target core_dimg_obj[0m
[  0%] [34m[1mAutomatic MOC for target core_digikamdatabase_obj[0m
[  0%] [34m[1mAutomatic MOC for target core_dragdrop_obj[0m
[  0%] [34m[1mAutomatic MOC for target core_libdng_obj[0m
[  0%] [34m[1mAutomatic MOC for target gui_digikamdatabasemain_obj[0m
[  0%] [34m[1mAutomatic MOC for target core_libheif_obj[0m
[  0%] Built target digikam-gitversion
[  0%] Built target digikam-builddate
[  0%] Built target core_libheif_obj_autogen
[  0%] Built target core_dragdrop_obj_autogen
[  0%] Built target core_libdng_obj_autogen
[  0%] [34m[1mAutomatic MOC for target core_libxmp_obj[0m
[  0%] [34m[1mAutomatic MOC for target core_dngwriter_obj[0m
[  0%] [34m[1mAutomatic MOC for target core_libmd5_obj[0m
[  0%] [34m[1mAutomatic MOC for target gui_dtrash_obj[0m
[  1%] [34m[1mAutomatic MOC for target libdng[0m
[  1%] Built target core_libxmp_obj_autogen
[  1%] Built target core_libmd5_obj_autogen
[  1%] Built target core_digikamdatabase_obj_autogen
[  1%] Built target libdng_autogen
[  1%] [34m[1mAutomatic MOC for target digikamfacesenginedatabase[0m
[  1%] Built target core_dngwriter_obj_autogen
[  1%] Built target gui_dtrash_obj_autogen
[  1%] [34m[1mAutomatic MOC for target gui_digikamfacesenginedatabase_obj[0m
[  1%] [34m[1mAutomatic MOC for target core_digikamfacesengine_obj[0m
[  1%] Built target digikamfacesenginedatabase_autogen
[  1%] [34m[1mAutomatic MOC for target gui_iojobs_obj[0m
[  1%] [34m[1mAutomatic MOC for target digikamfacesengine[0m
[  1%] [34m[1mAutomatic MOC for target core_libde265_obj[0m
[  1%] Built target digikamfacesengine_autogen
[  1%] Built target core_digikamfacesengine_obj_autogen
[  1%] [34m[1mAutomatic MOC for target core_jpegutils_obj[0m
[  1%] Built target gui_digikamfacesenginedatabase_obj_autogen
[  1%] Built target core_libde265_obj_autogen
[  1%] Built target core_jpegutils_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_pgfutils_obj[0m
[  2%] [34m[1mAutomatic MOC for target core_threadimageio_obj[0m
[  2%] Built target gui_iojobs_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_digikamwidgets_obj[0m
[  2%] [34m[1mAutomatic MOC for target gui_imagehistorywidgets_obj[0m
[  2%] Built target gui_digikamdatabasemain_obj_autogen
[  2%] Built target core_pgfutils_obj_autogen
[  2%] [34m[1mAutomatic MOC for target gui_itempropertiesdigikam_obj[0m
[  2%] [34m[1mAutomatic MOC for target core_itemproperties_obj[0m
[  2%] [34m[1mAutomatic MOC for target core_progressmanager_obj[0m
[  2%] [34m[1mAutomatic MOC for target core_dthread_obj[0m
[  2%] Built target gui_imagehistorywidgets_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_versionmanager_obj[0m
[  2%] Built target core_versionmanager_obj_autogen
[  2%] Built target core_dthread_obj_autogen
[  2%] Built target digikamdatabase_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_notificationmanager_obj[0m
[  2%] [34m[1mAutomatic MOC for target gui_digikammodels_obj[0m
[  2%] Built target core_threadimageio_obj_autogen
[  2%] Built target core_itemproperties_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_digikamgenericmodels_obj[0m
[  2%] [34m[1mAutomatic MOC for target core_onlineversion_obj[0m
[  2%] [34m[1mAutomatic MOC for target gui_digikamtemplate_obj[0m
[  2%] Built target core_digikamgenericmodels_obj_autogen
[  2%] [34m[1mAutomatic MOC for target gui_digikamdeletedialog_obj[0m
[  2%] Built target core_progressmanager_obj_autogen
[  2%] Built target core_notificationmanager_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_digikamdialogs_obj[0m
[  2%] Built target core_onlineversion_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_dpluginsinterface_obj[0m
[  2%] Built target gui_digikamdeletedialog_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_libwso2_obj[0m
[  2%] Built target gui_itempropertiesdigikam_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_kmemoryinfo_obj[0m
[  2%] [34m[1mAutomatic MOC for target gui_fileactionmanager_obj[0m
[  2%] Built target core_kmemoryinfo_obj_autogen
[  2%] Built target gui_digikamtemplate_obj_autogen
[  2%] Built target gui_digikammodels_obj_autogen
[  2%] [34m[1mAutomatic MOC for target gui_digikamsettings_obj[0m
[  2%] [34m[1mAutomatic MOC for target gui_filters_obj[0m
[  2%] [34m[1mAutomatic MOC for target core_rawengine_obj[0m
[  2%] Built target gui_digikamsettings_obj_autogen
[  2%] [34m[1mAutomatic MOC for target libraw[0m
[  2%] Built target core_rawengine_obj_autogen
[  2%] Built target libraw_autogen
[  2%] [34m[1mAutomatic MOC for target core_libraw_obj[0m
[  2%] [34m[1mAutomatic MOC for target gui_digikamalbum_obj[0m
[  2%] Built target core_libraw_obj_autogen
[  2%] [34m[1mAutomatic MOC for target gui_digikamtags_obj[0m
[  2%] Built target gui_fileactionmanager_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_libtransitionmngr_obj[0m
[  2%] Built target gui_filters_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_timeadjust_obj[0m
[  2%] Built target core_libwso2_obj_autogen
[  2%] [34m[1mAutomatic MOC for target core_videotools_obj[0m
[  2%] Built target core_libtransitionmngr_obj_autogen
[  2%] [34m[1mAutomatic MOC for target gui_advancedrename_obj[0m
[  2%] Built target core_digikamdialogs_obj_autogen
[  2%] Built target core_timeadjust_obj_autogen
[  2%] [34m[1mAutomatic MOC for target gui_queuemanager_obj[0m
[  2%] [34m[1mAutomatic MOC for target gui_imageeditorgui_obj[0m
[  2%] Built target gui_imageeditorgui_obj_autogen
[  3%] [34m[1mAutomatic MOC for target core_imageeditor_obj[0m
[  3%] Built target core_videotools_obj_autogen
[  3%] [34m[1mAutomatic MOC for target gui_lighttable_obj[0m
[  3%] Built target gui_digikamtags_obj_autogen
[  3%] Built target gui_lighttable_obj_autogen
[  3%] Built target core_dpluginsinterface_obj_autogen
[  3%] [34m[1mAutomatic MOC for target gui_firstrun_obj[0m
[  3%] [34m[1mAutomatic MOC for target gui_importui_obj[0m
[  3%] [34m[1mAutomatic MOC for target gui_importuibackend_obj[0m
[  3%] Built target gui_importuibackend_obj_autogen
[  3%] Built target gui_queuemanager_obj_autogen
[  3%] Built target core_imageeditor_obj_autogen
[  3%] Built target gui_digikamalbum_obj_autogen
[  3%] [34m[1mAutomatic MOC for target gui_setup_obj[0m
[  3%] [34m[1mAutomatic MOC for target core_setupcommon_obj[0m
[  3%] [34m[1mAutomatic MOC for target gui_maintenance_obj[0m
[  3%] [34m[1mAutomatic MOC for target gui_fuzzysearch_obj[0m
[  3%] Built target gui_firstrun_obj_autogen
[  3%] [34m[1mAutomatic MOC for target gui_searchwindow_obj[0m
[  3%] Built target gui_advancedrename_obj_autogen
[  3%] Built target gui_fuzzysearch_obj_autogen
[  3%] [34m[1mAutomatic MOC for target core_baloowrap_obj[0m
[  3%] Built target core_setupcommon_obj_autogen
[  3%] [34m[1mAutomatic MOC for target gui_facemanagement_obj[0m
[  3%] Built target core_baloowrap_obj_autogen
[  3%] [34m[1mAutomatic MOC for target digikamcore[0m
[  3%] [34m[1mAutomatic MOC for target gui_digikam_obj[0m
[  3%] Built target digikamcore_autogen
[  3%] [34m[1mAutomatic MOC for target mediawikibackend[0m
[  3%] Built target core_digikamwidgets_obj_autogen
[  4%] [34m[1mAutomatic MOC for target vkontaktebackend[0m
[  4%] Built target mediawikibackend_autogen
[  4%] Built target gui_maintenance_obj_autogen
[  5%] Built target core_libheif_obj
[  5%] Built target gui_searchwindow_obj_autogen
[  5%] Built target core_dragdrop_obj
[  5%] Built target gui_setup_obj_autogen
[  6%] Built target core_digikamdatabase_obj
[  6%] Built target gui_facemanagement_obj_autogen
[  7%] Built target gui_digikamdatabasemain_obj
[  8%] Built target core_libxmp_obj
[  9%] Built target gui_importui_obj_autogen
[ 11%] Built target core_libdng_obj
[ 11%] Built target core_libmd5_obj
[ 11%] Built target core_dimg_obj_autogen
[ 11%] Built target core_dngwriter_obj
[ 11%] Built target gui_dtrash_obj
[ 11%] Built target vkontaktebackend_autogen
[ 11%] Built target gui_iojobs_obj
[ 12%] Built target core_digikamfacesengine_obj
[ 16%] Built target gui_digikamfacesenginedatabase_obj
[ 17%] Built target digikamdatabase_obj
[ 17%] Built target core_jpegutils_obj
[ 17%] Built target core_pgfutils_obj
[ 19%] Built target core_libde265_obj
[ 19%] Built target gui_imagehistorywidgets_obj
[ 20%] Built target core_dthread_obj
[ 20%] Built target core_versionmanager_obj
[ 21%] Built target core_threadimageio_obj
[ 21%] Built target core_progressmanager_obj
[ 21%] Built target core_itemproperties_obj
[ 21%] Built target gui_itempropertiesdigikam_obj
[ 21%] Built target core_notificationmanager_obj
[ 21%] Built target core_digikamgenericmodels_obj
[ 21%] Built target gui_digikammodels_obj
[ 21%] Built target core_onlineversion_obj
[ 21%] Built target gui_digikamdeletedialog_obj
[ 22%] Built target gui_digikamtemplate_obj
[ 23%] Built target core_libwso2_obj
[ 23%] Built target core_kmemoryinfo_obj
[ 23%] Built target core_digikamdialogs_obj
[ 24%] Built target core_dpluginsinterface_obj
[ 27%] Built target core_digikamwidgets_obj
[ 27%] Built target gui_fileactionmanager_obj
[ 28%] Built target gui_filters_obj
[ 28%] Built target gui_digikamsettings_obj
[ 31%] Built target core_libraw_obj
[ 31%] Built target core_rawengine_obj
[ 31%] Built target core_libtransitionmngr_obj
[ 31%] Built target core_timeadjust_obj
[ 32%] Built target core_videotools_obj
[ 33%] Built target gui_imageeditorgui_obj
[ 34%] Built target gui_digikamtags_obj
[ 35%] Built target gui_queuemanager_obj
[ 37%] Built target gui_advancedrename_obj
[ 37%] Built target gui_firstrun_obj
[ 38%] Built target gui_digikamalbum_obj
[ 39%] Built target gui_lighttable_obj
[ 40%] Built target gui_importuibackend_obj
[ 40%] Built target core_imageeditor_obj
[ 41%] Built target core_setupcommon_obj
[ 41%] Built target gui_fuzzysearch_obj
[ 41%] Built target core_baloowrap_obj
[ 42%] Built target gui_importui_obj
[ 43%] Built target gui_setup_obj
[ 44%] Built target gui_maintenance_obj
[ 45%] [34m[1mAutomatic MOC for target core_dmetadata_obj[0m
[ 45%] Built target libdng
[ 45%] Built target gui_searchwindow_obj
[ 46%] Built target mediawikibackend
[ 46%] Built target vkontaktebackend
[ 46%] Built target digikamfacesenginedatabase
[ 47%] Built target gui_facemanagement_obj
[ 47%] Built target core_dmetadata_obj_autogen
[ 47%] Built target digikamfacesengine
[ 47%] Built target libraw
[ 47%] Built target gui_digikam_obj_autogen
[ 48%] Built target core_dmetadata_obj
[ 54%] Built target core_dimg_obj
[35m[1mScanning dependencies of target digikamcore[0m
[ 58%] Built target gui_digikam_obj
[ 58%] [32mBuilding CXX object core/app/CMakeFiles/digikamcore.dir/utils/digikam_version.cpp.o[0m
ccache: error: Failed to create directory /run/user/0/ccache-tmp: Permission denied
make[2]: *** [core/app/CMakeFiles/digikamcore.dir/build.make:108: core/app/CMakeFiles/digikamcore.dir/utils/digikam_version.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9918: core/app/CMakeFiles/digikamcore.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
[1m[31m==> ERROR:[m[1m A failure occurred in package()
Comment 14 Maik Qualmann 2021-01-28 09:47:48 UTC
I see these error messages in your log. Have you possibly accidentally compiled / worked as a root user, so that there are now cache files to which you have no rights? Please check it out. The problem cannot be caused by digiKam, as the current code compiles under different architectures and compilers without any problem. And Phuoc Khanh LE has also successfully compiled digiKam with ccache.

---------------------------------------------------------
[==>[Entering fakeroot environment...[m
[==> WARNING:[Cannot find the sudo binary. Will use su to acquire root privileges.

ccache: error: Failed to create directory /run/user/0/ccache-tmp: Permission denied
---------------------------------------------------------

Maik
Comment 15 caulier.gilles 2021-01-28 10:05:07 UTC
Same here. Now digiKam build successfully under Windows, Mac and Linux in CI/CD workflow, with ccache activated....

Gilles Caulier
Comment 16 maderios 2021-01-28 10:38:38 UTC
(In reply to Maik Qualmann from comment #14)
> I see these error messages in your log. Have you possibly accidentally
> compiled / worked as a root user, so that there are now cache files to which
> you have no rights? Please check it out. The problem cannot be caused by
> digiKam, as the current code compiles under different architectures and
> compilers without any problem. And Phuoc Khanh LE has also successfully
> compiled digiKam with ccache.
I never compile as root. As Arch user, I compile with 'makepkg', "a script to automate the building of packages". It doesn't allow to compile as root for security reason.
After deleting whole ./ccache directory, i meet same issue
Digikam is the only software i can't compile with ccache, *now*. This issue appeared only recently. It didn't exist on December 22,23 2020. I keep two digikam git versions i compiled at this date.
digikam-git-r49275.1d890ed602
digikam-git-r49281.a1645c3afe


> 
> ---------------------------------------------------------
> [==>[Entering fakeroot environment...[m
> [==> WARNING:[Cannot find the sudo binary. Will use su to acquire root
> privileges.
> 
> ccache: error: Failed to create directory /run/user/0/ccache-tmp: Permission
> denied
> ---------------------------------------------------------
> 
> Maik
Comment 17 Maik Qualmann 2021-01-28 10:54:31 UTC
Now I don't see anything special at "digikam_version.cpp", the header file is created in the build directory at compile time. Possibly the problem, but it was the same before. You have probably already deleted the build directory?

Maik
Comment 18 caulier.gilles 2021-01-28 11:11:38 UTC
To second Maik,

We have many header created at build time to share information in source codes. These .h are generated by cmake automatically in temporary build directory: 

[gilles@localhost utils]$ pwd
/mnt/data2/7.x/build/core/app/utils

[gilles@localhost utils]$ ll
total 40
-rw-r--r-- 1 gilles gilles  988 janv. 20 14:34 digikam_builddate.h
-rw-r--r-- 1 gilles gilles 4241 janv. 14 17:50 digikam_config.h
-rw-r--r-- 1 gilles gilles 1035 janv. 14 17:50 digikam_core_export.h
-rw-r--r-- 1 gilles gilles 1246 janv. 14 17:50 digikam_database_export.h
-rw-r--r-- 1 gilles gilles 1052 janv. 14 17:50 digikam_dbconfig.h
-rw-r--r-- 1 gilles gilles 1017 janv. 20 14:25 digikam_gitversion.h
-rw-r--r-- 1 gilles gilles 1126 janv. 14 17:50 digikam_gui_export.h
-rw-r--r-- 1 gilles gilles 2780 janv. 14 17:50 digikam_opencv.h
-rw-r--r-- 1 gilles gilles 1860 janv. 14 17:50 digikam_version.h

...with a corresponding .cpp files from source code:

[gilles@localhost utils]$ pwd
/mnt/data2/7.x/core/app/utils
[gilles@localhost utils]$ ll
total 60
-rw-r--r-- 1 gilles gilles 4427 janv. 14 17:06 digikam_config.h.cmake.in
-rw-r--r-- 1 gilles gilles 1077 janv. 14 17:06 digikam_dbconfig.h.cmake.in
-rw-r--r-- 1 gilles gilles 4751 janv. 14 17:06 digikam_debug.cpp
-rw-r--r-- 1 gilles gilles 3872 janv. 14 17:06 digikam_debug.h
-rw-r--r-- 1 gilles gilles 1273 janv. 14 17:06 digikam_export.h
-rw-r--r-- 1 gilles gilles 9895 janv. 25 09:02 digikam_globals.cpp
-rw-r--r-- 1 gilles gilles 5334 janv. 14 17:06 digikam_globals.h
-rw-r--r-- 1 gilles gilles 2776 janv. 14 17:06 digikam_opencv.h.cmake.in
-rw-r--r-- 1 gilles gilles 2632 janv. 14 17:06 digikam_version.cpp
-rw-r--r-- 1 gilles gilles 1928 janv. 14 17:06 digikam_version.h.cmake.in

Note the *.cmake.in files parsed by cmake and exported with populated information into the build directory.

The last changes in digikam_version.h file is to include the build date automatically when user rebuild the project. That all. Nothing special...

Gilles Caulier
Comment 19 maderios 2021-01-28 11:50:19 UTC
(In reply to Maik Qualmann from comment #17)
> Now I don't see anything special at "digikam_version.cpp", the header file
> is created in the build directory at compile time. Possibly the problem, but
> it was the same before. You have probably already deleted the build
> directory?
Yes i deleted /home/user/.ccache before compiling
Comment 20 maderios 2021-01-28 11:57:59 UTC
Wow, i deleted the build directory some days ago : 2021-01-17 
https://bugs.kde.org/show_bug.cgi?id=431658
I'll try to do it again then compile. I'm not sure it's useful...
Comment 21 caulier.gilles 2021-01-28 12:11:19 UTC
This is the cmake code used to populate the digikam_version.h with build date:

Prior this call :

https://invent.kde.org/graphics/digikam/-/blob/master/core/CMakeLists.txt#L624

...running this cmake script :


https://invent.kde.org/graphics/digikam/-/blob/master/core/cmake/modules/MacroBuildDateHeader.cmake

...and later patching header :

https://invent.kde.org/graphics/digikam/-/blob/master/core/app/CMakeLists.txt#L13

Gilles Caulier
Comment 22 maderios 2021-01-28 19:27:16 UTC
After deleting build directory, same compiling error.
Comment 23 Maik Qualmann 2021-01-29 07:01:09 UTC
I installed ccache with the default settings of openSUSE. The cache is created in the ".cache" folder in the user directory. No problem with compilation and installation.
The only thing that strikes me is that digikam_version.cpp "is recompiled with" make install "because a new time is available. Perhaps that is the point where it fails for you because you now have no rights for the cache.

Maik
Comment 24 caulier.gilles 2021-01-29 08:52:12 UTC
You are right Maik, date build must be only updated for make not "make install". We need a rules in cmake script to prevent it. But it's a normal behaviour as make install will pass all codes to see if someting has changed.

Note, here i always use "make install/fast" to install, and i never seen this problem.

@Maderios: please change your "make install" to "make install/fast" in your build script to see if this fix your problem. Note that "make install/fast" is a standard target definition in cmake and KDE applications, it's not specific to digiKam.

Gilles Caulier
Comment 25 maderios 2021-01-29 13:32:57 UTC
> @Maderios: please change your "make install" to "make install/fast" in your
> build script to see if this fix your problem. Note that "make install/fast"
> is a standard target definition in cmake and KDE applications, it's not
> specific to digiKam.
It works, i can build and install Digikam with ccache this way.
I edited the end of PKGBUILD:

package() {
  cd "${srcdir}/build"
  make DESTDIR="${pkgdir}" install/fast
}
Comment 26 caulier.gilles 2021-01-29 13:59:56 UTC
Thanks for the feedback. I can close this file now.

Gilles Caulier
Comment 27 maderios 2021-01-29 14:12:04 UTC
I’m going to be annoying :) but I don't understand why Digikam is the only one application that needs "make install/fast"
Comment 28 maderios 2021-05-11 07:52:11 UTC
For information:
After RTF :) , I solved issue without 'install/fast"
I created /home /user./config/ccache.conf
with inside
temporary_dir = /run/user/1000/ccache-tmp
It works for all softwares
Comment 29 maderios 2021-05-23 12:44:54 UTC
> I created /home /user./config/ccache.conf
Mistake it's :
/home/user/.config/ccache/ccache.conf