Use Bazel's builtin patch support.
This removes a dependency on the system having a patch executable.
This commit is contained in:
parent
11b8948857
commit
80aaf0c417
@ -1,103 +1,8 @@
|
|||||||
--- ./absl/time/internal/cctz/BUILD.bazel 2019-09-23 13:20:52.000000000 -0700
|
diff --git a/absl/container/internal/compressed_tuple.h b/absl/container/internal/compressed_tuple.h
|
||||||
+++ ./absl/time/internal/cctz/BUILD.bazel.fixed 2019-09-23 13:20:48.000000000 -0700
|
index 4bfe92f..01db713 100644
|
||||||
@@ -74,15 +74,6 @@
|
--- a/absl/container/internal/compressed_tuple.h
|
||||||
"include/cctz/time_zone.h",
|
+++ b/absl/container/internal/compressed_tuple.h
|
||||||
"include/cctz/zone_info_source.h",
|
@@ -32,7 +32,6 @@
|
||||||
],
|
|
||||||
- linkopts = select({
|
|
||||||
- ":osx": [
|
|
||||||
- "-framework Foundation",
|
|
||||||
- ],
|
|
||||||
- ":ios": [
|
|
||||||
- "-framework Foundation",
|
|
||||||
- ],
|
|
||||||
- "//conditions:default": [],
|
|
||||||
- }),
|
|
||||||
visibility = ["//visibility:public"],
|
|
||||||
deps = [
|
|
||||||
":civil_time",
|
|
||||||
--- ./absl/strings/string_view.h 2019-09-23 13:20:52.000000000 -0700
|
|
||||||
+++ ./absl/strings/string_view.h.fixed 2019-09-23 13:20:48.000000000 -0700
|
|
||||||
@@ -283,7 +283,14 @@
|
|
||||||
// Returns the ith element of the `string_view` using the array operator.
|
|
||||||
// Note that this operator does not perform any bounds checking.
|
|
||||||
constexpr const_reference operator[](size_type i) const {
|
|
||||||
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
|
||||||
+ // An NVCC bug treats the original return expression as a non-constant,
|
|
||||||
+ // which is not allowed in a constexpr function. This will be fixed in the
|
|
||||||
+ // CUDA 10.2 release.
|
|
||||||
+ return ptr_[i];
|
|
||||||
+#else
|
|
||||||
return ABSL_ASSERT(i < size()), ptr_[i];
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// string_view::at()
|
|
||||||
@@ -292,25 +299,46 @@
|
|
||||||
// and an exception of type `std::out_of_range` will be thrown on invalid
|
|
||||||
// access.
|
|
||||||
constexpr const_reference at(size_type i) const {
|
|
||||||
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
|
||||||
+ // An NVCC bug treats the original return expression as a non-constant,
|
|
||||||
+ // which is not allowed in a constexpr function. This will be fixed in the
|
|
||||||
+ // CUDA 10.2 release.
|
|
||||||
+ return ptr_[i];
|
|
||||||
+#else
|
|
||||||
return ABSL_PREDICT_TRUE(i < size())
|
|
||||||
? ptr_[i]
|
|
||||||
: ((void)base_internal::ThrowStdOutOfRange(
|
|
||||||
"absl::string_view::at"),
|
|
||||||
ptr_[i]);
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// string_view::front()
|
|
||||||
//
|
|
||||||
// Returns the first element of a `string_view`.
|
|
||||||
constexpr const_reference front() const {
|
|
||||||
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
|
||||||
+ // An NVCC bug treats the original return expression as a non-constant,
|
|
||||||
+ // which is not allowed in a constexpr function. This will be fixed in the
|
|
||||||
+ // CUDA 10.2 release.
|
|
||||||
+ return ptr_[0];
|
|
||||||
+#else
|
|
||||||
return ABSL_ASSERT(!empty()), ptr_[0];
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// string_view::back()
|
|
||||||
//
|
|
||||||
// Returns the last element of a `string_view`.
|
|
||||||
constexpr const_reference back() const {
|
|
||||||
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
|
||||||
+ // An NVCC bug treats the original return expression as a non-constant,
|
|
||||||
+ // which is not allowed in a constexpr function. This will be fixed in the
|
|
||||||
+ // CUDA 10.2 release.
|
|
||||||
+ return ptr_[size() - 1];
|
|
||||||
+#else
|
|
||||||
return ABSL_ASSERT(!empty()), ptr_[size() - 1];
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// string_view::data()
|
|
||||||
@@ -519,7 +547,14 @@
|
|
||||||
(std::numeric_limits<difference_type>::max)();
|
|
||||||
|
|
||||||
static constexpr size_type CheckLengthInternal(size_type len) {
|
|
||||||
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
|
||||||
+ // An NVCC bug treats the original return expression as a non-constant,
|
|
||||||
+ // which is not allowed in a constexpr function. This will be fixed in the
|
|
||||||
+ // CUDA 10.2 release.
|
|
||||||
+ return len;
|
|
||||||
+#else
|
|
||||||
return (void)ABSL_ASSERT(len <= kMaxSize), len;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static constexpr size_type StrlenInternal(const char* str) {
|
|
||||||
--- ./absl/container/internal/compressed_tuple.h 2020-03-04 12:57:37.000000000 -0800
|
|
||||||
+++ ./absl/container/internal/compressed_tuple.h.fixed 2019-06-20 11:54:01.000000000 -0700
|
|
||||||
@@ -32,7 +32,6 @@ Revert to commit 43ef2148c0936ebf7cb4be6b19927a9d9d145b8f as commit e9324d926a9189e222741fce6e676f0944661a72 includes a change not compatible with CUDA on Windows.
|
|
||||||
#ifndef ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_
|
#ifndef ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_
|
||||||
#define ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_
|
#define ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_
|
||||||
|
|
||||||
@ -105,7 +10,7 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -77,110 +76,61 @@
|
@@ -77,110 +76,61 @@ constexpr bool IsFinal() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +139,7 @@
|
|||||||
//
|
//
|
||||||
// To access the members, use member .get<N>() function.
|
// To access the members, use member .get<N>() function.
|
||||||
//
|
//
|
||||||
@@ -196,58 +146,36 @@
|
@@ -196,58 +146,36 @@ using TupleMoveConstructible = typename std::conditional<
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple
|
class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple
|
||||||
: private internal_compressed_tuple::CompressedTupleImpl<
|
: private internal_compressed_tuple::CompressedTupleImpl<
|
||||||
@ -302,3 +207,104 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h
|
||||||
|
index 1861ea6..c7a916b 100644
|
||||||
|
--- a/absl/strings/string_view.h
|
||||||
|
+++ b/absl/strings/string_view.h
|
||||||
|
@@ -283,7 +283,14 @@ class string_view {
|
||||||
|
// Returns the ith element of the `string_view` using the array operator.
|
||||||
|
// Note that this operator does not perform any bounds checking.
|
||||||
|
constexpr const_reference operator[](size_type i) const {
|
||||||
|
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
||||||
|
+ // An NVCC bug treats the original return expression as a non-constant,
|
||||||
|
+ // which is not allowed in a constexpr function. This will be fixed in the
|
||||||
|
+ // CUDA 10.2 release.
|
||||||
|
+ return ptr_[i];
|
||||||
|
+#else
|
||||||
|
return ABSL_ASSERT(i < size()), ptr_[i];
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// string_view::at()
|
||||||
|
@@ -292,25 +299,46 @@ class string_view {
|
||||||
|
// and an exception of type `std::out_of_range` will be thrown on invalid
|
||||||
|
// access.
|
||||||
|
constexpr const_reference at(size_type i) const {
|
||||||
|
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
||||||
|
+ // An NVCC bug treats the original return expression as a non-constant,
|
||||||
|
+ // which is not allowed in a constexpr function. This will be fixed in the
|
||||||
|
+ // CUDA 10.2 release.
|
||||||
|
+ return ptr_[i];
|
||||||
|
+#else
|
||||||
|
return ABSL_PREDICT_TRUE(i < size())
|
||||||
|
? ptr_[i]
|
||||||
|
: ((void)base_internal::ThrowStdOutOfRange(
|
||||||
|
"absl::string_view::at"),
|
||||||
|
ptr_[i]);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// string_view::front()
|
||||||
|
//
|
||||||
|
// Returns the first element of a `string_view`.
|
||||||
|
constexpr const_reference front() const {
|
||||||
|
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
||||||
|
+ // An NVCC bug treats the original return expression as a non-constant,
|
||||||
|
+ // which is not allowed in a constexpr function. This will be fixed in the
|
||||||
|
+ // CUDA 10.2 release.
|
||||||
|
+ return ptr_[0];
|
||||||
|
+#else
|
||||||
|
return ABSL_ASSERT(!empty()), ptr_[0];
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// string_view::back()
|
||||||
|
//
|
||||||
|
// Returns the last element of a `string_view`.
|
||||||
|
constexpr const_reference back() const {
|
||||||
|
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
||||||
|
+ // An NVCC bug treats the original return expression as a non-constant,
|
||||||
|
+ // which is not allowed in a constexpr function. This will be fixed in the
|
||||||
|
+ // CUDA 10.2 release.
|
||||||
|
+ return ptr_[size() - 1];
|
||||||
|
+#else
|
||||||
|
return ABSL_ASSERT(!empty()), ptr_[size() - 1];
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// string_view::data()
|
||||||
|
@@ -519,7 +547,14 @@ class string_view {
|
||||||
|
(std::numeric_limits<difference_type>::max)();
|
||||||
|
|
||||||
|
static constexpr size_type CheckLengthInternal(size_type len) {
|
||||||
|
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__ < 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ < 2))
|
||||||
|
+ // An NVCC bug treats the original return expression as a non-constant,
|
||||||
|
+ // which is not allowed in a constexpr function. This will be fixed in the
|
||||||
|
+ // CUDA 10.2 release.
|
||||||
|
+ return len;
|
||||||
|
+#else
|
||||||
|
return (void)ABSL_ASSERT(len <= kMaxSize), len;
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr size_type StrlenInternal(const char* str) {
|
||||||
|
diff --git a/absl/time/internal/cctz/BUILD.bazel b/absl/time/internal/cctz/BUILD.bazel
|
||||||
|
index 7a53c81..159b0f0 100644
|
||||||
|
--- a/absl/time/internal/cctz/BUILD.bazel
|
||||||
|
+++ b/absl/time/internal/cctz/BUILD.bazel
|
||||||
|
@@ -74,15 +74,6 @@ cc_library(
|
||||||
|
"include/cctz/time_zone.h",
|
||||||
|
"include/cctz/zone_info_source.h",
|
||||||
|
],
|
||||||
|
- linkopts = select({
|
||||||
|
- ":osx": [
|
||||||
|
- "-framework Foundation",
|
||||||
|
- ],
|
||||||
|
- ":ios": [
|
||||||
|
- "-framework Foundation",
|
||||||
|
- ],
|
||||||
|
- "//conditions:default": [],
|
||||||
|
- }),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
":civil_time",
|
||||||
|
2
third_party/eigen3/gpu_packet_math.patch
vendored
2
third_party/eigen3/gpu_packet_math.patch
vendored
@ -1,3 +1,4 @@
|
|||||||
|
diff -ru a/Eigen/src/Geometry/arch/Geometry_SSE.h b/Eigen/src/Geometry/arch/Geometry_SSE.h
|
||||||
--- a/Eigen/src/Geometry/arch/Geometry_SSE.h
|
--- a/Eigen/src/Geometry/arch/Geometry_SSE.h
|
||||||
+++ b/Eigen/src/Geometry/arch/Geometry_SSE.h
|
+++ b/Eigen/src/Geometry/arch/Geometry_SSE.h
|
||||||
@@ -33,13 +33,14 @@
|
@@ -33,13 +33,14 @@
|
||||||
@ -22,6 +23,7 @@
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
diff -ru a/Eigen/src/Core/arch/Default/BFloat16.h a/Eigen/src/Core/arch/Default/BFloat16.h
|
||||||
--- a/Eigen/src/Core/arch/Default/BFloat16.h
|
--- a/Eigen/src/Core/arch/Default/BFloat16.h
|
||||||
+++ a/Eigen/src/Core/arch/Default/BFloat16.h
|
+++ a/Eigen/src/Core/arch/Default/BFloat16.h
|
||||||
@@ -291,7 +291,7 @@
|
@@ -291,7 +291,7 @@
|
||||||
|
34
third_party/icu/udata.patch
vendored
34
third_party/icu/udata.patch
vendored
@ -1,19 +1,6 @@
|
|||||||
--- a/icu4c/source/common/unicode/uconfig.h
|
diff -ru a/icu4c/source/common/udata.cpp b/icu4c/source/common/udata.cpp
|
||||||
+++ b/icu4c/source/common/unicode/uconfig.h
|
--- a/icu4c/source/common/udata.cpp 2019-04-17 12:03:04.000000000 +0000
|
||||||
@@ -55,6 +55,11 @@
|
+++ b/icu4c/source/common/udata.cpp 2020-07-14 23:49:37.836668741 +0000
|
||||||
#include "uconfig_local.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+// Tensorflow is statically linked on all platforms.
|
|
||||||
+#ifndef U_STATIC_IMPLEMENTATION
|
|
||||||
+#define U_STATIC_IMPLEMENTATION
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/**
|
|
||||||
* \def U_DEBUG
|
|
||||||
* Determines whether to include debugging code.
|
|
||||||
--- a/icu4c/source/common/udata.cpp
|
|
||||||
+++ b/icu4c/source/common/udata.cpp
|
|
||||||
@@ -18,11 +18,10 @@
|
@@ -18,11 +18,10 @@
|
||||||
|
|
||||||
#include "unicode/utypes.h" /* U_PLATFORM etc. */
|
#include "unicode/utypes.h" /* U_PLATFORM etc. */
|
||||||
@ -57,3 +44,18 @@
|
|||||||
#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time
|
#if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time
|
||||||
setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode);
|
setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode);
|
||||||
{
|
{
|
||||||
|
diff -ru a/icu4c/source/common/unicode/uconfig.h b/icu4c/source/common/unicode/uconfig.h
|
||||||
|
--- a/icu4c/source/common/unicode/uconfig.h 2019-04-17 12:03:04.000000000 +0000
|
||||||
|
+++ b/icu4c/source/common/unicode/uconfig.h 2020-07-14 23:49:37.836668741 +0000
|
||||||
|
@@ -55,6 +55,11 @@
|
||||||
|
#include "uconfig_local.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+// Tensorflow is statically linked on all platforms.
|
||||||
|
+#ifndef U_STATIC_IMPLEMENTATION
|
||||||
|
+#define U_STATIC_IMPLEMENTATION
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* \def U_DEBUG
|
||||||
|
* Determines whether to include debugging code.
|
||||||
|
6
third_party/png_fix_rpi.patch
vendored
6
third_party/png_fix_rpi.patch
vendored
@ -1,6 +1,6 @@
|
|||||||
diff -r -u /tmp/libpng-1.6.37/scripts/pnglibconf.h.prebuilt ./scripts/pnglibconf.h.prebuilt
|
diff -r -u ./scripts/pnglibconf.h.prebuilt ./scripts/pnglibconf.h.prebuilt
|
||||||
--- /tmp/libpng-1.6.37/scripts/pnglibconf.h.prebuilt 2019-04-14 11:10:32.000000000 -0700
|
--- ./scripts/pnglibconf.h.prebuilt
|
||||||
+++ ./scripts/pnglibconf.h.prebuilt 2019-05-21 09:40:52.138528512 -0700
|
+++ ./scripts/pnglibconf.h.prebuilt
|
||||||
@@ -19,6 +19,12 @@
|
@@ -19,6 +19,12 @@
|
||||||
#define PNG_ALIGNED_MEMORY_SUPPORTED
|
#define PNG_ALIGNED_MEMORY_SUPPORTED
|
||||||
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
|
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
|
||||||
|
7
third_party/repo.bzl
vendored
7
third_party/repo.bzl
vendored
@ -60,12 +60,9 @@ def _execute_and_check_ret_code(repo_ctx, cmd_and_args):
|
|||||||
def _repos_are_siblings():
|
def _repos_are_siblings():
|
||||||
return Label("@foo//bar").workspace_root.startswith("../")
|
return Label("@foo//bar").workspace_root.startswith("../")
|
||||||
|
|
||||||
# Apply a patch_file to the repository root directory
|
# Apply a patch_file to the repository root directory.
|
||||||
# Runs 'patch -p1' on both Windows and Unix.
|
|
||||||
def _apply_patch(ctx, patch_file):
|
def _apply_patch(ctx, patch_file):
|
||||||
patch_command = ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)]
|
ctx.patch(patch_file, strip=1)
|
||||||
cmd = _wrap_bash_cmd(ctx, patch_command)
|
|
||||||
_execute_and_check_ret_code(ctx, cmd)
|
|
||||||
|
|
||||||
def _apply_delete(ctx, paths):
|
def _apply_delete(ctx, paths):
|
||||||
for path in paths:
|
for path in paths:
|
||||||
|
Loading…
Reference in New Issue
Block a user