From f0de3b9005fdb647367a04692fb29555d182074a Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 10 Nov 2022 10:13:58 -0800 Subject: [PATCH] fix(determinism): copy two missing entries from data_excludes We install some pip packages to bootstrap the pip_install/pip_parse rules, and these were allowing .pyc files as data deps. In some clients I observe that pip install is creating these with non-determinism and busting the python action caches. We already had a correct solution for user-installed packages, so we just need to include those entries for the built-ins. --- python/pip_install/repositories.bzl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/pip_install/repositories.bzl b/python/pip_install/repositories.bzl index f225616ac4..8b027672df 100644 --- a/python/pip_install/repositories.bzl +++ b/python/pip_install/repositories.bzl @@ -92,7 +92,17 @@ load("@rules_python//python:defs.bzl", "py_library") py_library( name = "lib", srcs = glob(["**/*.py"]), - data = glob(["**/*"], exclude=["**/*.py", "**/* *", "BUILD", "WORKSPACE"]), + data = glob(["**/*"], exclude=[ + # These entries include those put into user-installed dependencies by + # data_exclude in /python/pip_install/extract_wheels/bazel.py + # to avoid non-determinism following pip install's behavior. + "**/*.py", + "**/*.pyc", + "**/* *", + "**/*.dist-info/RECORD", + "BUILD", + "WORKSPACE", + ]), # This makes this directory a top-level in the python import # search path for anything that depends on this. imports = ["."],