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
  • Hi Burt,

    After discussing with our toolchain maintainers, I have the following information to share:

    The reason ccache is not included in the NCS toolchain for Windows is that it has never fully supported Windows, including 4.8.2 and latest version(4.10.2 currently).

    Probably works, may work or is partially supported. Not part of the test procedure before a new release. Bug fixing and testing largely depend on contributions from the community.

    While developers are welcome to manually include and test ccache on Windows, we encourage using the same version included in the Linux toolchain for consistency. The specific software versions included in the toolchain can be found here:

    Let me know if you have additional questions or need further clarification.

    Best regards,

    Charlie

  • Thanks, Charlie, at least now I know the reason for no built in ccache in the Windows Toolchain. I'll say that this is one of those cases where a well-intentioned and generally smart policy ends up giving a non-optimal result. Anyway, it's too bad that some remarks could not be included in the nRF Connect SDK documentation (installation section); a helpful hint like, "although not officially supported, some users may wish to install ccache externally, and we recommend version 4.8.2 (rather than the latest version) for maximum compatibility with Zephyr" maybe adding "Use at your own risk."

    I'm only making such an issue out of this because:

    1. At first, I didn't realize I needed to add my own ccache, but when I did, I always would add the latest version.
    2. Strange but I didn't realize for a long time that my ccache wasn't doing anything. (Maybe it was when I first installed ccache.)
    3. It was time consuming figuring out the trick to make the latest version work.
    4. My bad, I didn't look at what version was in the Linux toolchain. I actually thought you folks had used a customized version.
    5. Windows builds are slow enough that any extra help is a good thing.
    6. My colleague never takes my advice if it is an addition to what you provide!

    The good news is that this ticket has 86 views so some people will know all their options (if they use Windows!)

    I will close the ticket now. Thanks again for giving me the official word from the Toolchain developers.

    Burt

Reply
  • Thanks, Charlie, at least now I know the reason for no built in ccache in the Windows Toolchain. I'll say that this is one of those cases where a well-intentioned and generally smart policy ends up giving a non-optimal result. Anyway, it's too bad that some remarks could not be included in the nRF Connect SDK documentation (installation section); a helpful hint like, "although not officially supported, some users may wish to install ccache externally, and we recommend version 4.8.2 (rather than the latest version) for maximum compatibility with Zephyr" maybe adding "Use at your own risk."

    I'm only making such an issue out of this because:

    1. At first, I didn't realize I needed to add my own ccache, but when I did, I always would add the latest version.
    2. Strange but I didn't realize for a long time that my ccache wasn't doing anything. (Maybe it was when I first installed ccache.)
    3. It was time consuming figuring out the trick to make the latest version work.
    4. My bad, I didn't look at what version was in the Linux toolchain. I actually thought you folks had used a customized version.
    5. Windows builds are slow enough that any extra help is a good thing.
    6. My colleague never takes my advice if it is an addition to what you provide!

    The good news is that this ticket has 86 views so some people will know all their options (if they use Windows!)

    I will close the ticket now. Thanks again for giving me the official word from the Toolchain developers.

    Burt

Children
No Data
Related