Sonar CFamily Cache Misses 'Dependencies Changed'

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 9.3 Scanner 4.7 CFamily Plugin 6.30.0.42324 Xcode 13.2

  • what are you trying to achieve
    I’m trying to use the Analysis Cache to speed up my Analysis for an iOS project with C/C++/Objective-C code.

  • what have you tried so far to achieve this
    I can successfully generate a cache (or I appear to be able to), but subsequent analyses show 0/X cache hits. Each file reports that its ‘dependencies changed’. Even if I run multiple Analyses back to back on my local machine.

Any hints as to what might be causing the analyzer to think that the ‘dependencies changed’?

Hello @jarbogast,

Cache invalidation works like a C and C++ compilation. If you change the compilation settings or a header file included everywhere the source file will have to be recompiled/reanalyzed.

  • Are you modifying any files between the two analyses?
  • Are you rerunning build-wrapper between the two analyses? If yes does your build command modify generate files?
  • Can you run sonar-scanner in verbose mode twice back to back and share the entire log? If you prefer I can send you a PM to share the log privately.

Thanks,

Hello @Abbas_Sabra,

  • Are you modifying any files between the two analyses?

No, I’m not.

  • Are you rerunning build-wrapper between the two analyses? If yes does your build command modify generate files?

No, same build-wrapper output is being used.

  • Can you run sonar-scanner in verbose mode twice back to back and share the entire log? If you prefer I can send you a PM to share the log privately.

Absolutely. Yes please send me a PM so I can share the logs privately.

@jarbogast, PM sent.

Hello @jarbogast,

As discussed the issue was identified, the fix is on the way: [CPP-3599] Fix cache "dependency changed" false-positive with OBJ-C - SonarSource.

Thanks for the detailed report.

2 Likes

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