Sonarscanner cache not working properly

  • ALM used: GitHub
  • CI system used: Travis CI
  • Error observed

The build-in cache of the sonarscanner (CFamily) does not seem to work correctly. Files analyzed in the previous build are not found in the cache, even though they did not change.

  • Steps to reproduce

We have merged a PR affecting multiple files, which had to be analyzed again. For that reason we hit the Travis 50 min build deadline.

We have tried to skip some folders, which led to a successful build and a cache update.
However, when we reverted the changes, the build failed on timeout.
Closer inspection of the log shows that files that have been analyzed in the earlier build (and should be in the cache), were analyzed again in the latest build.

As you can see from the commits, there were no other changes between the builds.
I don’t see any obvious reason why the files are analyzed again, and I would be grateful for any hints.

Thanks.

Hi @David_Strelak,

if those files you are talking about are depending on some files which were part of the exclusion during the successful build then those files have to be reanalyzed to properly compute header files issues.

Hi @mpaladin,

Thanks for fast answer. You are right. I have excluded a ‘core’ folder.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.