Skip to content

Invalid cache hits for compilation actions using different version of CC - the other side of the coin #9296

Closed

Description

@hlopko

Typical problem that Bazel C++ users face is that they have to run bazel clean --expunge or with Bazel 1.0 bazel sync --configure each time they upgrade their compiler or system header versions.

A variation of this problem that bazel clean --expunge doesn't fix is remote cache poisoning. Action outputs produced by the old version of CC are stored in the cache and used for builds with the new version of CC. And C++ header validation fails the build because the current C++ toolchain expects headers for new CC, and remote cache returned .d file with old headers.

As the result users cannot build unless they disable the remote cache or somehow ensure the poisoned cache entry is not taken. Typical workaround is passing --copt=-Dfoo=bar. That will change the action command line and action will be reexecuted.

Activity

  1. self-assigned this
    on Aug 30, 2019
  2. added
    P1
    team-Rules-CPP
    on Aug 30, 2019
  3. hlopko commented on Aug 30, 2019

    @hlopko
    MemberAuthor

    I'll mark this as a release blocker, even though this is not strictly a regression, it was always like this.

  4. keith commented on Sep 18, 2019

    @keith
    Member

    FYI this kinda causes an issue for iOS builds where these paths include the paths to Xcode.app which can differ between developer machines. Because iOS builds have --xcode_version as a key we're just disabling this though. I'm not suggesting we change it since I guess that's by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1team-Rules-CPPtype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions