-
Notifications
You must be signed in to change notification settings - Fork 147
Description
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).