Hardcode two exceptions to the list of files allowed in a 'platform'
authorA. Unique TensorFlower <gardener@tensorflow.org>
Wed, 16 May 2018 03:14:18 +0000 (20:14 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 16 May 2018 03:16:48 +0000 (20:16 -0700)
PiperOrigin-RevId: 196771621

tensorflow/core/platform/default/build_config.bzl

index f6e09ef..63ffe7d 100644 (file)
@@ -448,6 +448,16 @@ def tf_platform_srcs(files):
   base_set = ["platform/default/" + f for f in files]
   windows_set = base_set + ["platform/windows/" + f for f in files]
   posix_set = base_set + ["platform/posix/" + f for f in files]
+
+  # Handle cases where we must also bring the posix file in. Usually, the list
+  # of files to build on windows builds is just all the stuff in the
+  # windows_set. However, in some cases the implementations in 'posix/' are
+  # just what is necessary and historically we choose to simply use the posix
+  # file instead of making a copy in 'windows'.
+  for f in files:
+    if f == "error.cc":
+      windows_set.append("platform/posix/" + f)
+
   return select({
     "//tensorflow:windows" : native.glob(windows_set),
     "//tensorflow:windows_msvc" : native.glob(windows_set),