8000 fix: Ignore tempoary pyc.NNN files in wheels (#1266) · chrislovecnm/rules_python@68db955 · GitHub
[go: up one dir, main page]

Skip to content

Commit 68db955

Browse files
authored
fix: Ignore tempoary pyc.NNN files in wheels (bazel-contrib#1266)
We ignore pyc files most everywhere (because they aren't deterministic), but part of the pyc creation process involves creating temporary files named `*.pyc.NNN`. Though these are supposed to be temporary files nobody sees, they seem to get picked up by a glob somewhere, somehow. I'm unable to figure out how that is happening, but ignoring them in the glob expressions should also suffice. Fixes bazel-contrib#1261
1 parent 9ffb1ec commit 68db955

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

python/pip_install/repositories.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ py_library(
106106
# to avoid non-determinism following pip install's behavior.
107107
"**/*.py",
108108
"**/*.pyc",
109+
"**/*.pyc.*", # During pyc creation, temp files named *.pyc.NNN are created
109110
"**/* *",
110111
"**/*.dist-info/RECORD",
111112
"BUILD",

python/pip_install/tools/wheel_installer/wheel_installer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def _generate_build_file_contents(
226226
"**/* *",
227227
"**/*.py",
228228
"**/*.pyc",
229+
"**/*.pyc.*", # During pyc creation, temp files named *.pyc.NNNN are created
229230
# RECORD is known to contain sha256 checksums of files which might include the checksums
230231
# of generated files produced when wheels are installed. The file is ignored to avoid
231232
# Bazel caching issues.

python/repositories.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def _python_repository_impl(rctx):
219219
# the definition of this filegroup will change, and depending rules will get invalidated."
220220
# See https://github.com/bazelbuild/rules_python/issues/1008 for unconditionally adding these to toolchains so we can stop ignoring them."
221221
"**/__pycache__/*.pyc",
222+
"**/__pycache__/*.pyc.*", # During pyc creation, temp files named *.pyc.NNN are created
222223
"**/__pycache__/*.pyo",
223224
]
224225

0 commit comments

Comments
 (0)
0