diff options
author | lissyx <lissyx+github@lissyx.dyndns.org> | 2018-02-02 03:03:31 +0100 |
---|---|---|
committer | Andrew Harp <andrewharp@users.noreply.github.com> | 2018-02-01 21:03:31 -0500 |
commit | b0d432dcc8c52177ebbaeb3a74d488f0af702f21 (patch) | |
tree | 05688289460d8066d0bf04a007c1ce233e32a9d2 /third_party/py | |
parent | 56663eedd7296d85c9adb3e9537ddac521719445 (diff) |
Force sorting of CUDA and Python headers to avoid spurious rebuilds (#16586)
If one does try to re-use Bazel cache of a TensorFlow CUDA-enabled or
Python-enabled build, then it might happen that readdir() syscall behind
the use of find in _read_dir() will generate a different ordering of the
very same list of headers. This will make new genrules for symlinking
the CUDA headers and in the end it will result in different actionKey
computed by Bazel, hence invalidating the action cache.
Fixes #16585
Diffstat (limited to 'third_party/py')
-rw-r--r-- | third_party/py/python_configure.bzl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl index c16eb3a12a..954f21f5f8 100644 --- a/third_party/py/python_configure.bzl +++ b/third_party/py/python_configure.bzl @@ -118,7 +118,7 @@ def _symlink_genrule_for_dir(repository_ctx, src_dir, dest_dir, genrule_name, if src_dir != None: src_dir = _norm_path(src_dir) dest_dir = _norm_path(dest_dir) - files = _read_dir(repository_ctx, src_dir) + files = '\n'.join(sorted(_read_dir(repository_ctx, src_dir).splitlines())) # Create a list with the src_dir stripped to use for outputs. dest_files = files.replace(src_dir, '').splitlines() src_files = files.splitlines() |