From 7f24a7bfced66c2f52269521981e4639e0f57853 Mon Sep 17 00:00:00 2001 From: Thomas Gibson-Robinson Date: Wed, 25 May 2022 08:00:08 +0100 Subject: [PATCH] Don't include pyc files as part of the hermetic toolchain pyc files don't appear to be generated deterministically, so including them as part of the :files filegroup means that actions that use the hermetic toolchain do not have deterministic hashes, and so bazel needlessly re-executes them. This can be seen when using bazel together with a remote cache: builds on separate machines will generate pyc files with different hashes, leading to cache misses. --- python/repositories.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/repositories.bzl b/python/repositories.bzl index 687388c62e..62f076b56b 100644 --- a/python/repositories.bzl +++ b/python/repositories.bzl @@ -128,7 +128,8 @@ filegroup( "share/**", ], exclude = [ - "**/* *", # Bazel does not support spaces in file names. + "**/* *", # Bazel does not support spaces in file names. + "**/*.pyc", # These are not deterministically generated, breaking remote caching ], ), )