Skip to content

local_config_cc is not invalidated by $PATH or compiler changes #515

@pcc

Description

@pcc

When I run PATH=/path/to/some/clang/bin:$PATH bazel build ... followed by PATH=/path/to/other/clang/bin:$PATH bazel build ... I would expect the second command to use the Clang binaries in /path/to/other/clang/bin. However, Bazel ends up using the Clang binaries under /path/to/some/clang/bin instead. These paths are cached in a directory named external/rules_cc++cc_configure_extension+local_config_cc.

A similar but related bug occurs when I update the compiler binaries in place to a newer version. Clang's builtin include paths are under a directory named lib/clang/$clangVersionNumber but these paths are cached in a file named external/rules_cc++cc_configure_extension+local_config_cc/builtin_include_directory_paths which leads to various build failures when the version number changes.

I ended up working around this bug by running bazel shutdown and deleting the rules_cc++cc_configure_extension+local_config_cc directory every time I change the compiler but Bazel should automatically invalidate the cache whenever anything to do with the compiler changes (or ideally not cache any of this at all).

Metadata

Metadata

Assignees

No one assigned

    Labels

    untriagedTeam member has to triage this issue - assign priority, type, and owner (if possible).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions