Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ccache if available #6085

Merged
merged 1 commit into from
Mar 22, 2018
Merged

Use ccache if available #6085

merged 1 commit into from
Mar 22, 2018

Conversation

lbartoletti
Copy link
Member

Description

What do you think about adding ccache directly if it is found?

An alternative is:

option(USE_CCACHE "Use ccache" OFF)
if (USE_CCACHE)
    find_program(CCACHE_FOUND ccache)
    if(CCACHE_FOUND)
        set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
        set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
    endif(CCACHE_FOUND)
endif()

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and containt sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

@lbartoletti lbartoletti reopened this Jan 17, 2018
@alexispolti
Copy link
Contributor

alexispolti commented Feb 17, 2018

Would love to see merged in master: this speeds-up a lot frequent package reconstructions for distributions such as ArchLinux (package qgis-git) :)

@lbartoletti
Copy link
Member Author

Any news?

@mhugo mhugo merged commit 4c4e8ac into qgis:master Mar 22, 2018
@mhugo
Copy link

mhugo commented Mar 22, 2018

Thanks !

@lbartoletti lbartoletti deleted the ccache branch March 22, 2018 08:36
@nirvn
Copy link
Contributor

nirvn commented Mar 23, 2018

@lbartoletti , @mhugent , I had to delete my .ccache folder after these errors showed up:

ccache: error: Failed to create temporary file for /home/webmaster/.ccache/1/5/401c3d04ed3ea86f21dac3d24710b7-3950467.o.tmp.stdout: Permission denied
src/core/CMakeFiles/qgis_core.dir/build.make:1426: recipe for target 'src/core/CMakeFiles/qgis_core.dir/symbology/qgsellipsesymbollayer.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/qgis_core.dir/symbology/qgsellipsesymbollayer.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
ccache: error: Failed to create temporary file for /home/webmaster/.ccache/2/4/590fb87643411daa9d1a7097bd0986-3996398.o.tmp.stdout: Permission denied
src/core/CMakeFiles/qgis_core.dir/build.make:1402: recipe for target 'src/core/CMakeFiles/qgis_core.dir/symbology/qgscptcityarchive.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/qgis_core.dir/symbology/qgscptcityarchive.cpp.o] Error 1
ccache: error: Failed to create temporary file for /home/webmaster/.ccache/4/5/e8095c0255e3c3c12ca0c05569a9e9-3988776.o.tmp.stdout: Permission denied
src/core/CMakeFiles/qgis_core.dir/build.make:1498: recipe for target 'src/core/CMakeFiles/qgis_core.dir/symbology/qgsgraduatedsymbolrenderer.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/qgis_core.dir/symbology/qgsgraduatedsymbolrenderer.cpp.o] Error 1
ccache: error: Failed to create temporary file for /home/webmaster/.ccache/7/e/0580c12d6a53403be6649521cd0a68-4320909.o.tmp.stdout: Permission denied
src/core/CMakeFiles/qgis_core.dir/build.make:1450: recipe for target 'src/core/CMakeFiles/qgis_core.dir/symbology/qgsfillsymbollayer.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/qgis_core.dir/symbology/qgsfillsymbollayer.cpp.o] Error 1
ccache: error: Failed to create temporary file for /home/webmaster/.ccache/e/5/3c52b11fb8d3b4d14818fda257da75-3881179.o.tmp.stdout: Permission denied
src/core/CMakeFiles/qgis_core.dir/build.make:1522: recipe for target 'src/core/CMakeFiles/qgis_core.dir/symbology/qgsheatmaprenderer.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/qgis_core.dir/symbology/qgsheatmaprenderer.cpp.o] Error 1
ccache: error: Failed to create temporary file for /home/webmaster/.ccache/1/e/356b565d1c7d23683af4360902fea5-3921246.o.tmp.stdout: Permission denied
src/core/CMakeFiles/qgis_core.dir/build.make:1354: recipe for target 'src/core/CMakeFiles/qgis_core.dir/symbology/qgscategorizedsymbolrenderer.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/qgis_core.dir/symbology/qgscategorizedsymbolrenderer.cpp.o] Error 1
CMakeFiles/Makefile2:1246: recipe for target 'src/core/CMakeFiles/qgis_core.dir/all' failed
make[1]: *** [src/core/CMakeFiles/qgis_core.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbartoletti we have very long build time on Travis, I wonder if this is the origin. Do you think it might conflict with the fact that ccache was already set here in the Dockerfile:

ENV CC=/usr/lib/ccache/clang
ENV CXX=/usr/lib/ccache/clang++

ping @m-kuhn

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what's going on. maybe we should clean the cache on travis and start over with a clean one? and if that doesn't help add an option to disable this logic?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@3nids already tried that earlier today - no change unfortunately

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(clearing the cache that is)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened a PR to revert and check if this really is the responsible commit #6741

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about it. I haven't errors at home ( c ).
But if it conflicts, you can use the second option as mentioned in my PR:

option(USE_CCACHE "Use ccache" OFF)
if (USE_CCACHE)
    find_program(CCACHE_FOUND ccache)
    if(CCACHE_FOUND)
        set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
        set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
    endif(CCACHE_FOUND)
endif()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @lbartoletti and @m-kuhn
I merged #6745, it makes no harm to have this option anyway.
I will clean Travis cache once more to start from scratch again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants