From 0d063529f50435abcd7d968660cba307f018941f Mon Sep 17 00:00:00 2001 From: Javier Maestro Date: Sun, 15 Dec 2024 20:28:47 +0000 Subject: [PATCH] fix: pyc files in Meson mesonbuild repo causing rebuilds Fixes #1342 It seems that pyc files appear in the Meson repo between the first and second time a python toolchain is used and if these are not excluded, the new pyc files invalidate dependent rules, forcing a rebuild. For more context, see #1342 and https://bazelbuild.slack.com/archives/CA306CEV6/p1734196424601509 --- toolchains/built_toolchains.bzl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolchains/built_toolchains.bzl b/toolchains/built_toolchains.bzl index e517c568c..5abe0ed8f 100644 --- a/toolchains/built_toolchains.bzl +++ b/toolchains/built_toolchains.bzl @@ -20,7 +20,9 @@ exports_files(["meson.py"]) filegroup( name = "runtime", - srcs = glob(["mesonbuild/**"]), + # NOTE: excluding __pycache__ is important to avoid rebuilding due to pyc + # files, see https://github.com/bazel-contrib/rules_foreign_cc/issues/1342 + srcs = glob(["mesonbuild/**"], exclude = ["**/__pycache__/*"]), visibility = ["//visibility:public"], ) """