aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mihai Maruseac <mihaimaruseac@google.com>2021-03-05 21:13:14 -0800
committerGravatar GitHub <noreply@github.com>2021-03-05 21:13:14 -0800
commit8b205da3bc3cfaec3823f410d9c789e35732df7e (patch)
tree13daf2fc8484bfb72c5a346f106516292bccaec9
parentd18cc7df58b9b1dae3bceafb9c0a6a3e1edd68e5 (diff)
Fix TensorFlow coverage build. (#5309)
It seems that due to some recent change in `BUILD` rules, `bazel` creates a copy of the code tree under `bazel-tensorflow/external/org_tensorflow` symlink. However, the tree contains a `bazel-tensorflow` symlink so we get to an infinite symlink expansion issue. This breaks coverage build. The fix is simple: before copying `bazel-tensorflow/external` to `${OUT}` in coverage builds, remove `org_tensorflow` symlink. This is not an issue for the coverage build since we copy the entire source tree to the coverage directory in a previous step.
-rwxr-xr-xprojects/tensorflow/build.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/projects/tensorflow/build.sh b/projects/tensorflow/build.sh
index 01264238..ca09f46d 100755
--- a/projects/tensorflow/build.sh
+++ b/projects/tensorflow/build.sh
@@ -92,7 +92,11 @@ then
${RSYNC_CMD} ./bazel-out/k8-opt/bin/tensorflow/core/protobuf ${REMAP_PATH}
# Sync external dependencies. We don't need to include `bazel-tensorflow`.
+ # Also, remove `external/org_tensorflow` which is a copy of the entire source
+ # code that Bazel creates. Not removing this would cause `rsync` to expand a
+ # symlink that ends up pointing to itself!
pushd bazel-tensorflow
+ unlink external/org_tensorflow
${RSYNC_CMD} external/ ${REMAP_PATH}
popd
fi