ccache no longer works for NCS in Windows with newer versions of ccache

There was no problem when the current version of ccache was 4.6.1. However, the current version of ccache, 4.10.2, behaves differently with the --specs option. It will do nothing at all with NCS. To correct this, I make this change

diff --git a/cmake/modules/ccache.cmake b/cmake/modules/ccache.cmake
index c1d41d6b9e4..14b9b683519 100644
--- a/cmake/modules/ccache.cmake
+++ b/cmake/modules/ccache.cmake
@@ -9,7 +9,7 @@ if(USE_CCACHE STREQUAL "0")
else()
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "ccache ignore_options=--specs=picolibc.specs")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
endif()

Thank you for any possible correction. I guess in the Linux case you include ccache in the Zephyr toolchain and it is a version that works.

Burt Silverman

Parents Reply Children
  • Hi Charlie,

    I agree with you up to where you say that this relates to zephyr/scripts/west_commands/build.py. Perhaps you are conflating ccache with the CMake cache that is referenced in build.py.

    A more interesting question would be why we find for example ncs/toolchains/e9dba88316/usr/bin/ccache in the Linux case but do not find for example a C:\ncs\toolchains\c57af46cb7\usr\bin\ccache.exe in the Windows case. Are not the contents of the various ncs/toolchains put together by NS based on input from zephyr but customized by NS? I see this as a primarily NS issue at this time, as you could include the same version of ccache in the Windows toolchain as the one which works for Linux; granted if you put the latest version of ccache into either Linux or Windows then we'd have to ask Zephyr to fix zephyr/cmake/modules/ccache.cmake. There is an argument for either method, I'd say, but currently your Windows users are at a disadvantage because most probably are not looking so closely to see that ccache is either absent or not doing its job.

    Burt

Related