Skip to content

Expose CannotCache reasons somewhere outside of logs #263

@luser

Description

@luser

Currently if sccache determines it can't cache a compile it will log that info and the client will run the compiler, but it's not surfaced outside of the logs anywhere. It would be nice if we saved this info and exposed it somewhere user-visible. Including it in the output of --show-stats is probably sensible. There's an existing TODO on this in the code.

The simplest thing to do would be to maintain a HashMap<&'static str, int> (probably in the ServerStats struct) and do like:

CompilerArguments::CannotCache(why) => {
    *stats.not_cached.entry(why).or_insert(0) += 1
}

Then add some code to print the contents of the HashMap in ServerStats::print.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions