Skip to content

Commit

Permalink
fix: pyc files in Meson mesonbuild repo causing rebuilds
Browse files Browse the repository at this point in the history
Fixes bazel-contrib#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 bazel-contrib#1342 and
https://bazelbuild.slack.com/archives/CA306CEV6/p1734196424601509
  • Loading branch information
jjmaestro committed Dec 15, 2024
1 parent 21e463e commit 0d06352
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion toolchains/built_toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
"""
Expand Down

0 comments on commit 0d06352

Please sign in to comment.