diff options
Diffstat (limited to 'science/py-tensorflow/files')
63 files changed, 614 insertions, 530 deletions
diff --git a/science/py-tensorflow/files/bazel/fix-environ.patch b/science/py-tensorflow/files/bazel/fix-environ.patch index 2e38ce60543d..d1437f158055 100644 --- a/science/py-tensorflow/files/bazel/fix-environ.patch +++ b/science/py-tensorflow/files/bazel/fix-environ.patch @@ -1,18 +1,18 @@ ---- a/llvm/lib/Support/Unix/Program.inc 2022-09-06 21:14:28.808580000 +0100 -+++ b/llvm/lib/Support/Unix/Program.inc 2022-09-06 21:16:15.007790000 +0100 +--- a/llvm/lib/Support/Unix/Program.inc 2023-04-28 21:51:01.000000000 +0200 ++++ b/llvm/lib/Support/Unix/Program.inc 2024-07-02 11:12:41.645169000 +0200 @@ -54,10 +54,8 @@ #define USE_NSGETENVIRON 0 #endif -#if !USE_NSGETENVIRON +#if USE_NSGETENVIRON - extern char **environ; + extern char **environ; -#else -#include <crt_externs.h> // _NSGetEnviron #endif #endif -@@ -240,14 +238,6 @@ +@@ -238,14 +236,6 @@ } } @@ -27,16 +27,16 @@ constexpr int maxRetries = 8; int retries = 0; pid_t PID; -@@ -308,11 +298,7 @@ +@@ -312,11 +302,7 @@ - // Execute! - std::string PathStr = std::string(Program); -- if (Envp != nullptr) -- execve(PathStr.c_str(), const_cast<char **>(Argv), -- const_cast<char **>(Envp)); -- else -- execv(PathStr.c_str(), const_cast<char **>(Argv)); -+ execv(PathStr.c_str(), const_cast<char **>(Argv)); - // If the execve() failed, we should exit. Follow Unix protocol and - // return 127 if the executable was not found, and 126 otherwise. - // Use _exit rather than exit so that atexit functions and static + // Execute! + std::string PathStr = std::string(Program); +- if (Envp != nullptr) +- execve(PathStr.c_str(), const_cast<char **>(Argv), +- const_cast<char **>(Envp)); +- else +- execv(PathStr.c_str(), const_cast<char **>(Argv)); ++ execv(PathStr.c_str(), const_cast<char **>(Argv)); + // If the execve() failed, we should exit. Follow Unix protocol and + // return 127 if the executable was not found, and 126 otherwise. + // Use _exit rather than exit so that atexit functions and static diff --git a/science/py-tensorflow/files/bazel/fix-pybind11_protobuf.patch b/science/py-tensorflow/files/bazel/fix-pybind11_protobuf.patch new file mode 100644 index 000000000000..80d30bf25333 --- /dev/null +++ b/science/py-tensorflow/files/bazel/fix-pybind11_protobuf.patch @@ -0,0 +1,116 @@ +diff --git a/pybind11_protobuf/BUILD b/pybind11_protobuf/BUILD +index b62eb91..1856ad3 100644 +--- a/pybind11_protobuf/BUILD ++++ b/pybind11_protobuf/BUILD +@@ -61,9 +61,11 @@ pybind_library( + "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:optional", +- "@com_google_protobuf//:proto_api", + "@com_google_protobuf//:protobuf", +- ], ++ ] + select({ ++ ":enable_pyproto_api_setting": ["@com_google_protobuf//:proto_api"], ++ "//conditions:default": [], ++ }), + ) + + pybind_library( +diff --git a/pybind11_protobuf/proto_cast_util.cc b/pybind11_protobuf/proto_cast_util.cc +index 52c57c9..771e688 100644 +--- a/pybind11_protobuf/proto_cast_util.cc ++++ b/pybind11_protobuf/proto_cast_util.cc +@@ -14,9 +14,12 @@ + + #include "google/protobuf/descriptor.pb.h" + #include "google/protobuf/descriptor.h" ++#include "google/protobuf/descriptor_database.h" + #include "google/protobuf/dynamic_message.h" + #include "google/protobuf/message.h" ++#if defined(PYBIND11_PROTOBUF_ENABLE_PYPROTO_API) + #include "python/google/protobuf/proto_api.h" ++#endif + #include "absl/container/flat_hash_map.h" + #include "absl/strings/numbers.h" + #include "absl/strings/str_replace.h" +@@ -35,8 +38,12 @@ using ::google::protobuf::FileDescriptor; + using ::google::protobuf::FileDescriptorProto; + using ::google::protobuf::Message; + using ::google::protobuf::MessageFactory; ++#if defined(PYBIND11_PROTOBUF_ENABLE_PYPROTO_API) + using ::google::protobuf::python::PyProto_API; + using ::google::protobuf::python::PyProtoAPICapsuleName; ++#else ++struct PyProto_API; ++#endif + + namespace pybind11_protobuf { + namespace { +@@ -321,6 +328,7 @@ py::object GlobalState::PyMessageInstance(const Descriptor* descriptor) { + module_name + "?"); + } + ++#if defined(PYBIND11_PROTOBUF_ENABLE_PYPROTO_API) + std::pair<py::object, Message*> GlobalState::PyFastCppProtoMessageInstance( + const Descriptor* descriptor) { + assert(descriptor != nullptr); +@@ -361,6 +369,7 @@ std::pair<py::object, Message*> GlobalState::PyFastCppProtoMessageInstance( + } + return {std::move(result), message}; + } ++#endif + + // Create C++ DescriptorPools based on Python DescriptorPools. + // The Python pool will provide message definitions when they are needed. +@@ -500,6 +509,7 @@ class PythonDescriptorPoolWrapper { + private: + bool CopyToFileDescriptorProto(py::handle py_file_descriptor, + FileDescriptorProto* output) { ++#if defined(PYBIND11_PROTOBUF_ENABLE_PYPROTO_API) + if (GlobalState::instance()->py_proto_api()) { + try { + py::object c_proto = py::reinterpret_steal<py::object>( +@@ -518,6 +528,7 @@ class PythonDescriptorPoolWrapper { + PyErr_Print(); + } + } ++#endif + + py::object wire = py_file_descriptor.attr("serialized_pb"); + const char* bytes = PYBIND11_BYTES_AS_STRING(wire.ptr()); +@@ -561,6 +572,9 @@ void ImportProtoDescriptorModule(const Descriptor* descriptor) { + + const Message* PyProtoGetCppMessagePointer(py::handle src) { + assert(PyGILState_Check()); ++#ifndef PYBIND11_PROTOBUF_ENABLE_PYPROTO_API ++ return nullptr; ++#else + if (!GlobalState::instance()->py_proto_api()) return nullptr; + auto* ptr = + GlobalState::instance()->py_proto_api()->GetMessagePointer(src.ptr()); +@@ -571,6 +585,7 @@ const Message* PyProtoGetCppMessagePointer(py::handle src) { + return nullptr; + } + return ptr; ++#endif + } + + absl::optional<std::string> PyProtoDescriptorName(py::handle py_proto) { +@@ -732,6 +747,9 @@ py::handle GenericPyProtoCast(Message* src, py::return_value_policy policy, + + py::handle GenericFastCppProtoCast(Message* src, py::return_value_policy policy, + py::handle parent, bool is_const) { ++#ifndef PYBIND11_PROTOBUF_ENABLE_PYPROTO_API ++ throw std::logic_error("Not implemented"); ++#else + assert(policy != pybind11::return_value_policy::automatic); + assert(policy != pybind11::return_value_policy::automatic_reference); + assert(src != nullptr); +@@ -802,6 +820,7 @@ py::handle GenericFastCppProtoCast(Message* src, py::return_value_policy policy, + std::string message("pybind11_protobuf unhandled return_value_policy::"); + throw py::cast_error(message + ReturnValuePolicyName(policy)); + } ++#endif + } + + py::handle GenericProtoCast(Message* src, py::return_value_policy policy, diff --git a/science/py-tensorflow/files/bazel/add-default-option.patch b/science/py-tensorflow/files/bazel/fix-xnnpack.patch index ce5c250608fb..7a995bbff74d 100644 --- a/science/py-tensorflow/files/bazel/add-default-option.patch +++ b/science/py-tensorflow/files/bazel/fix-xnnpack.patch @@ -1,6 +1,8 @@ ---- a/build_defs.bzl 2022-08-28 12:18:33.375130000 +0100 -+++ b/build_defs.bzl 2022-08-28 12:21:40.701070000 +0100 -@@ -173,7 +173,7 @@ +diff --git a/build_defs.bzl b/build_defs.bzl +index 01b436eb7..ca4abd54d 100644 +--- a/build_defs.bzl ++++ b/build_defs.bzl +@@ -146,7 +146,7 @@ def xnnpack_cc_library( ":emscripten_wasm": wasm_srcs, ":emscripten_wasmsimd": wasmsimd_srcs, ":emscripten_wasmrelaxedsimd": wasmrelaxedsimd_srcs, @@ -9,7 +11,7 @@ }), copts = [ "-Iinclude", -@@ -210,7 +210,7 @@ +@@ -179,7 +179,7 @@ def xnnpack_cc_library( ":emscripten_wasm": wasm_copts, ":emscripten_wasmsimd": wasmsimd_copts, ":emscripten_wasmrelaxedsimd": wasmrelaxedsimd_copts, @@ -18,7 +20,7 @@ }) + select({ ":windows_x86_64_clang": ["/clang:" + opt for opt in gcc_copts], ":windows_x86_64_mingw": gcc_copts, -@@ -233,7 +233,7 @@ +@@ -202,7 +202,7 @@ def xnnpack_cc_library( ":linux_armv7a": ["-lpthread"], ":linux_arm64": ["-lpthread"], ":android": ["-lm"], @@ -27,11 +29,24 @@ }), textual_hdrs = hdrs, visibility = visibility, -@@ -304,6 +304,7 @@ - ":emscripten_wasm": wasm_deps, +@@ -249,6 +249,7 @@ def xnnpack_aggregate_library( ":emscripten_wasmsimd": wasmsimd_deps, ":emscripten_wasmrelaxedsimd": wasmrelaxedsimd_deps, + ":riscv": riscv_deps, + "//conditions:default": x86_deps, }), - ) + defines = defines, + compatible_with = compatible_with, +diff --git a/src/runtime.c b/src/runtime.c +index 0c4649017..29e74a85b 100644 +--- a/src/runtime.c ++++ b/src/runtime.c +@@ -4,7 +4,7 @@ + // LICENSE file in the root directory of this source tree. + #ifndef __MACH__ +-#define _POSIX_C_SOURCE 199309L ++#define _POSIX_C_SOURCE 199506L + #endif + + #include <assert.h> diff --git a/science/py-tensorflow/files/bazel/fix_cpuinfo.patch b/science/py-tensorflow/files/bazel/fix_cpuinfo.patch deleted file mode 100644 index 1041a2319286..000000000000 --- a/science/py-tensorflow/files/bazel/fix_cpuinfo.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- a/src/mach/topology.c 2022-09-01 12:09:36.036365000 +0100 -+++ b/src/mach/topology.c 2022-09-01 12:09:07.146529000 +0100 -@@ -1,5 +1,4 @@ - #include <string.h> --#include <alloca.h> - #include <errno.h> - - #include <sys/types.h> -@@ -8,38 +7,27 @@ - #include <cpuinfo/log.h> - #include <mach/api.h> - --#include <TargetConditionals.h> - -- - struct cpuinfo_mach_topology cpuinfo_mach_detect_topology(void) { - int cores = 1; - size_t sizeof_cores = sizeof(cores); -- if (sysctlbyname("hw.physicalcpu_max", &cores, &sizeof_cores, NULL, 0) != 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.physicalcpu_max\") failed: %s", strerror(errno)); -+ if (sysctlbyname("hw.ncpu", &cores, &sizeof_cores, NULL, 0) != 0) { -+ cpuinfo_log_error("sysctlbyname(\"hw.ncpu\") failed: %s", strerror(errno)); - } else if (cores <= 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.physicalcpu_max\") returned invalid value %d", cores); -+ cpuinfo_log_error("sysctlbyname(\"hw.ncpu\") returned invalid value %d", cores); - cores = 1; - } - - int threads = 1; - size_t sizeof_threads = sizeof(threads); -- if (sysctlbyname("hw.logicalcpu_max", &threads, &sizeof_threads, NULL, 0) != 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.logicalcpu_max\") failed: %s", strerror(errno)); -+ if (sysctlbyname("hw.ncpu", &threads, &sizeof_threads, NULL, 0) != 0) { -+ cpuinfo_log_error("sysctlbyname(\"ncpu\") failed: %s", strerror(errno)); - } else if (threads <= 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.logicalcpu_max\") returned invalid value %d", threads); -+ cpuinfo_log_error("sysctlbyname(\"ncpu\") returned invalid value %d", threads); - threads = cores; - } - - int packages = 1; --#if !TARGET_OS_IPHONE -- size_t sizeof_packages = sizeof(packages); -- if (sysctlbyname("hw.packages", &packages, &sizeof_packages, NULL, 0) != 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.packages\") failed: %s", strerror(errno)); -- } else if (packages <= 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.packages\") returned invalid value %d", packages); -- packages = 1; -- } --#endif - - cpuinfo_log_debug("mach topology: packages = %d, cores = %d, threads = %d", packages, (int) cores, (int) threads); - struct cpuinfo_mach_topology topology = { -@@ -48,26 +36,5 @@ - .threads = (uint32_t) threads - }; - --#if !TARGET_OS_IPHONE -- size_t cacheconfig_size = 0; -- if (sysctlbyname("hw.cacheconfig", NULL, &cacheconfig_size, NULL, 0) != 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.cacheconfig\") failed: %s", strerror(errno)); -- } else { -- uint64_t* cacheconfig = alloca(cacheconfig_size); -- if (sysctlbyname("hw.cacheconfig", cacheconfig, &cacheconfig_size, NULL, 0) != 0) { -- cpuinfo_log_error("sysctlbyname(\"hw.cacheconfig\") failed: %s", strerror(errno)); -- } else { -- size_t cache_configs = cacheconfig_size / sizeof(uint64_t); -- cpuinfo_log_debug("mach hw.cacheconfig count: %zu", cache_configs); -- if (cache_configs > CPUINFO_MACH_MAX_CACHE_LEVELS) { -- cache_configs = CPUINFO_MACH_MAX_CACHE_LEVELS; -- } -- for (size_t i = 0; i < cache_configs; i++) { -- cpuinfo_log_debug("mach hw.cacheconfig[%zu]: %"PRIu64, i, cacheconfig[i]); -- topology.threads_per_cache[i] = cacheconfig[i]; -- } -- } -- } --#endif - return topology; - } diff --git a/science/py-tensorflow/files/bazel/freebsd_python_fix.patch b/science/py-tensorflow/files/bazel/freebsd_python_fix.patch deleted file mode 100644 index e6bcae9950be..000000000000 --- a/science/py-tensorflow/files/bazel/freebsd_python_fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/utils/bazel/configure.bzl 2022-08-27 19:11:41.138993000 +0100 -+++ b/utils/bazel/configure.bzl 2022-08-27 19:12:07.525186000 +0100 -@@ -37,7 +37,7 @@ - overlay_path = bazel_path.get_child("llvm-project-overlay") - script_path = bazel_path.get_child("overlay_directories.py") - -- python_bin = repository_ctx.which("python3") -+ python_bin = repository_ctx.which("%%PYTHON%%") - if not python_bin: - # Windows typically just defines "python" as python3. The script itself - # contains a check to ensure python3. diff --git a/science/py-tensorflow/files/bazel/set-c++17.patch b/science/py-tensorflow/files/bazel/set-c++17.patch deleted file mode 100644 index aef1f6c38467..000000000000 --- a/science/py-tensorflow/files/bazel/set-c++17.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/cc/private/toolchain/freebsd_cc_toolchain_config.bzl 2022-08-28 16:31:59.271838000 +0100 -+++ b/cc/private/toolchain/freebsd_cc_toolchain_config.bzl 2022-08-28 16:32:10.096301000 +0100 -@@ -159,7 +159,7 @@ - ), - flag_set( - actions = all_cpp_compile_actions + [ACTION_NAMES.lto_backend], -- flag_groups = [flag_group(flags = ["-std=c++0x"])], -+ flag_groups = [flag_group(flags = ["-std=c++17"])], - ), - ], - ) diff --git a/science/py-tensorflow/files/bazelrc b/science/py-tensorflow/files/bazelrc index f3a2c1a76cb3..d6488176d91b 100644 --- a/science/py-tensorflow/files/bazelrc +++ b/science/py-tensorflow/files/bazelrc @@ -1,6 +1,5 @@ startup --batch -build --strip=never build --verbose_failures --noshow_loading_progress test --verbose_test_summary --verbose_failures --noshow_loading_progress diff --git a/science/py-tensorflow/files/freebsd/BUILD b/science/py-tensorflow/files/freebsd/BUILD index 4096b1c74d42..116c8428aee9 100644 --- a/science/py-tensorflow/files/freebsd/BUILD +++ b/science/py-tensorflow/files/freebsd/BUILD @@ -50,7 +50,7 @@ cc_toolchain( ) cc_toolchain_config( name = "local_freebsd", - cpu = "k8", + cpu = "freebsd", ) toolchain( diff --git a/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl b/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl index ce3def7dfd66..719a537f3f29 100644 --- a/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl +++ b/science/py-tensorflow/files/freebsd/cc_toolchain_config.bzl @@ -226,17 +226,17 @@ def _impl(ctx): else: features = [supports_dynamic_linker_feature, supports_pic_feature] if (is_bsd): - cxx_builtin_include_directories = ["%%LLVM_PREFIX%%/lib/clang/%%LLVM_VERSION%%.0.0", "%%LLVM_PREFIX%%/lib/clang/%%LLVM_VERSION%%/include", "/usr/include/c++/v1", "/usr/local/include", "/usr/include"] + cxx_builtin_include_directories = ["/usr/lib/clang", "/usr/include/c++/v1", "/usr/local/include", "/usr/include"] else: cxx_builtin_include_directories = [] if is_bsd: tool_paths = [ tool_path(name = "ar", path = "/usr/bin/ar"), - tool_path(name = "cpp", path = "%%LLVM_PREFIX%%/bin/clang-cpp"), + tool_path(name = "cpp", path = "/usr/bin/cpp"), tool_path(name = "dwp", path = "/usr/bin/dwp"), - tool_path(name = "gcc", path = "%%LLVM_PREFIX%%/bin/clang-%%LLVM_VERSION%%"), + tool_path(name = "gcc", path = "/usr/bin/clang"), tool_path(name = "gcov", path = "/usr/bin/gcov"), - tool_path(name = "ld", path = "%%LLVM_PREFIX%%/bin/ld"), + tool_path(name = "ld", path = "/usr/bin/ld"), tool_path(name = "nm", path = "/usr/bin/nm"), tool_path(name = "objcopy", path = "/usr/bin/objcopy"), tool_path(name = "objdump", path = "/usr/bin/objdump"), diff --git a/science/py-tensorflow/files/patch-.bazelrc b/science/py-tensorflow/files/patch-.bazelrc index 49784e41f3b9..fe656d032236 100644 --- a/science/py-tensorflow/files/patch-.bazelrc +++ b/science/py-tensorflow/files/patch-.bazelrc @@ -1,22 +1,22 @@ ---- .bazelrc.orig 2022-05-22 22:28:22 UTC +--- .bazelrc.orig 2023-09-12 16:46:28 UTC +++ .bazelrc -@@ -151,6 +151,19 @@ build --experimental_cc_shared_library - - # Default options should come above this line. +@@ -166,6 +166,19 @@ build:libc++ --linkopt -fuse-ld=lld + build:libc++ --define force_libcpp=enabled + build:libc++ --linkopt -fuse-ld=lld +# Use our custom-configured c++ toolchain. +# Use --cpu as a differentiator. -+build:freebsd --cpu=k8 ++build:freebsd --cpu=freebsd + +# Use the default Bazel C++ toolchain to build the tools used during the +# build. +build:freebsd --crosstool_top=//freebsd:freebsd_clang +build:freebsd --linkopt=-L%%LOCALBASE%%/lib + -+build:freebsd --python_path="%%PYTHON%%" ++build:freebsd --define build_with_onednn_v2=true +build:freebsd --define force_libcpp=enabled +build:freebsd --action_env=CXXFLAGS=-stdlib=libc++ + - # Allow builds using libc++ as a linker library - # This is mostly for OSSFuzz, so we also pass in the flags from environment to clean build file - build:libc++ --action_env=CC + # Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the + # target CPU to build transient dependencies correctly. See + # https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu diff --git a/science/py-tensorflow/files/patch-WORKSPACE b/science/py-tensorflow/files/patch-WORKSPACE deleted file mode 100644 index d037b0785741..000000000000 --- a/science/py-tensorflow/files/patch-WORKSPACE +++ /dev/null @@ -1,18 +0,0 @@ ---- WORKSPACE.orig 2022-05-22 22:28:22 UTC -+++ WORKSPACE -@@ -1,4 +1,15 @@ - workspace(name = "org_tensorflow") -+register_toolchains("//freebsd:freebsd_py_toolchain") -+ -+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -+http_archive( -+ name = "io_bazel_rules_docker", -+ sha256 = "7d453450e1eb70e238eea6b31f4115607ec1200e91afea01c25f9804f37e39c8", -+ strip_prefix = "rules_docker-0.10.0", -+ urls = [ -+ "https://github.com/bazelbuild/rules_docker/releases/download/v0.10.0/rules_docker-v0.10.0.tar.gz", -+ ], -+) - - # Initialize the TensorFlow repository and all dependencies. - # diff --git a/science/py-tensorflow/files/patch-configure b/science/py-tensorflow/files/patch-configure deleted file mode 100644 index bf95a05716ba..000000000000 --- a/science/py-tensorflow/files/patch-configure +++ /dev/null @@ -1,11 +0,0 @@ ---- configure.orig 2022-05-22 22:28:22 UTC -+++ configure -@@ -4,7 +4,7 @@ set -e - set -o pipefail - - if [ -z "$PYTHON_BIN_PATH" ]; then -- PYTHON_BIN_PATH=$(which python3 || which python || true) -+ PYTHON_BIN_PATH=$(which %%PYTHON%% || which python || true) - fi - - # Set all env variables diff --git a/science/py-tensorflow/files/patch-tensorflow_BUILD b/science/py-tensorflow/files/patch-tensorflow_BUILD index 1dfdce1c7da7..f45dad0e6ce2 100644 --- a/science/py-tensorflow/files/patch-tensorflow_BUILD +++ b/science/py-tensorflow/files/patch-tensorflow_BUILD @@ -1,31 +1,12 @@ ---- tensorflow/BUILD.orig 2022-05-23 00:28:22.000000000 +0200 -+++ tensorflow/BUILD 2023-03-30 17:47:04.211287000 +0200 -@@ -938,8 +938,11 @@ +--- tensorflow/BUILD.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/BUILD +@@ -1290,7 +1290,8 @@ tf_cc_shared_library( ], "//tensorflow:windows": [], - "//tensorflow:freebsd": [ -+ "-Wl,--unresolved-symbols=ignore-all", -+ "-Wl,--undefined-version", - "-Wl,--version-script,$(location //tensorflow:tf_framework_version_script.lds)", - "-lexecinfo", -+ "-L/usr/local/lib", - ], - "//conditions:default": [ - "-Wl,--version-script,$(location //tensorflow:tf_framework_version_script.lds)", -@@ -1021,7 +1024,7 @@ - # copybara:uncomment_end - "//conditions:default": [ - "-z defs", -- "-Wl,--version-script,$(location //tensorflow/c:version_script.lds)", -+ "-L/lib,-L/usr/lib,--unresolved-symbols=ignore-all,-Wl,--undefined-version,-Wl,--version-script,$(location //tensorflow/c:version_script.lds)", - ], - }), - per_os_targets = True, -@@ -1054,6 +1057,7 @@ - "//tensorflow:windows": [], "//conditions:default": [ - "-z defs", -+ "-Wl,--undefined-version", +- "-z defs", ++ "-Wl,-z,defs", ++ "-lnsync_cpp", "-Wl,--version-script,$(location //tensorflow:tf_version_script.lds)", ], }), diff --git a/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_hlo_WORKSPACE b/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_hlo_WORKSPACE deleted file mode 100644 index 876a4cd2a5b6..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_hlo_WORKSPACE +++ /dev/null @@ -1,11 +0,0 @@ ---- tensorflow/compiler/mlir/hlo/WORKSPACE.orig 2022-05-22 22:28:22 UTC -+++ tensorflow/compiler/mlir/hlo/WORKSPACE -@@ -34,6 +34,8 @@ http_archive( - name = "llvm-raw", - build_file_content = "# empty", - sha256 = LLVM_SHA256, -+ patch_args = ["-p0"], -+ patches = ["@%%MLIR_LLVM_PATCH%%"], - strip_prefix = "llvm-project-" + LLVM_COMMIT, - urls = ["https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT)], - ) diff --git a/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_lite_python_jax__to__tfl__flatbuffer.cc b/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_lite_python_jax__to__tfl__flatbuffer.cc new file mode 100644 index 000000000000..149f60042f0d --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_lite_python_jax__to__tfl__flatbuffer.cc @@ -0,0 +1,11 @@ +--- tensorflow/compiler/mlir/lite/python/jax_to_tfl_flatbuffer.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/compiler/mlir/lite/python/jax_to_tfl_flatbuffer.cc +@@ -60,7 +60,7 @@ class NoOpErrorCollector : public tensorflow::protobuf + // Error collector that simply ignores errors reported. + class NoOpErrorCollector : public tensorflow::protobuf::io::ErrorCollector { + public: +- void AddError(int line, int column, const string& message) override {} ++ void RecordError(int line, int column, absl::string_view message) override {} + }; + + bool LoadHloProto(const std::string& contents, xla::HloProto* hlo_proto) { diff --git a/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_quantization_tensorflow_BUILD b/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_quantization_tensorflow_BUILD deleted file mode 100644 index 50bc0af36e7b..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_quantization_tensorflow_BUILD +++ /dev/null @@ -1,11 +0,0 @@ ---- tensorflow/compiler/mlir/quantization/tensorflow/BUILD.orig 2022-09-06 21:29:53 UTC -+++ tensorflow/compiler/mlir/quantization/tensorflow/BUILD -@@ -32,7 +32,7 @@ genrule( - outs = [ - "passes/quantized_function_library.h", - ], -- cmd = "$(location gen_quantized_function_library) --output_file $(RULEDIR)/passes/quantized_function_library.h --src $(SRCS)", -+ cmd = "%%PYTHON%% $(location gen_quantized_function_library) --output_file $(RULEDIR)/passes/quantized_function_library.h --src $(SRCS)", - exec_tools = ["gen_quantized_function_library"], - ) - diff --git a/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_tensorflow_utils_parse__text__proto.cc b/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_tensorflow_utils_parse__text__proto.cc new file mode 100644 index 000000000000..9e9b3aadad0b --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_compiler_mlir_tensorflow_utils_parse__text__proto.cc @@ -0,0 +1,11 @@ +--- tensorflow/compiler/mlir/tensorflow/utils/parse_text_proto.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/compiler/mlir/tensorflow/utils/parse_text_proto.cc +@@ -28,7 +28,7 @@ class NoOpErrorCollector : public protobuf::io::ErrorC + // Error collector that simply ignores errors reported. + class NoOpErrorCollector : public protobuf::io::ErrorCollector { + public: +- void AddError(int line, int column, const std::string& message) override {} ++ void RecordError(int line, int column, absl::string_view message) override {} + }; + } // namespace + diff --git a/science/py-tensorflow/files/patch-tensorflow_compiler_xla_stream__executor_host_BUILD b/science/py-tensorflow/files/patch-tensorflow_compiler_xla_stream__executor_host_BUILD new file mode 100644 index 000000000000..3e73733f8e2d --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_compiler_xla_stream__executor_host_BUILD @@ -0,0 +1,10 @@ +--- tensorflow/compiler/xla/stream_executor/host/BUILD.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/compiler/xla/stream_executor/host/BUILD +@@ -95,6 +95,7 @@ cc_library( + hdrs = [ + "host_gpu_executor.h", + ], ++ linkopts = ["-labsl_tracing_internal"], + deps = [ + ":host_platform_id", + ":host_stream", diff --git a/science/py-tensorflow/files/patch-tensorflow_core_BUILD b/science/py-tensorflow/files/patch-tensorflow_core_BUILD deleted file mode 100644 index 91f1f88aee8d..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_core_BUILD +++ /dev/null @@ -1,11 +0,0 @@ ---- tensorflow/core/BUILD.orig 2022-05-22 22:28:22 UTC -+++ tensorflow/core/BUILD -@@ -1284,7 +1284,7 @@ cc_library( - hdrs = [":lib_internal_public_headers"], - copts = tf_copts(), - linkopts = select({ -- "//tensorflow:freebsd": [], -+ "//tensorflow:freebsd": ["-L%%LOCALBASE%%/lib"], - "//tensorflow:windows": [], - "//tensorflow:android": [], - "//conditions:default": [ diff --git a/science/py-tensorflow/files/patch-tensorflow_core_debug_debug__io__utils.cc b/science/py-tensorflow/files/patch-tensorflow_core_debug_debug__io__utils.cc new file mode 100644 index 000000000000..6e492427b425 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_core_debug_debug__io__utils.cc @@ -0,0 +1,11 @@ +--- tensorflow/core/debug/debug_io_utils.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/core/debug/debug_io_utils.cc +@@ -94,7 +94,7 @@ Event PrepareChunkEventProto(const DebugNodeKey& debug + // Encode the data in JSON. + string json_output; + tensorflow::protobuf::util::JsonPrintOptions json_options; +- json_options.always_print_primitive_fields = true; ++ json_options.always_print_fields_with_no_presence = true; + auto status = tensorflow::protobuf::util::MessageToJsonString( + metadata, &json_output, json_options); + if (status.ok()) { diff --git a/science/py-tensorflow/files/patch-tensorflow_core_ir_importexport_parse__text__proto.cc b/science/py-tensorflow/files/patch-tensorflow_core_ir_importexport_parse__text__proto.cc new file mode 100644 index 000000000000..cb19475b9689 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_core_ir_importexport_parse__text__proto.cc @@ -0,0 +1,11 @@ +--- tensorflow/core/ir/importexport/parse_text_proto.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/core/ir/importexport/parse_text_proto.cc +@@ -33,7 +33,7 @@ class NoOpErrorCollector : public tensorflow::protobuf + // Error collector that simply ignores errors reported. + class NoOpErrorCollector : public tensorflow::protobuf::io::ErrorCollector { + public: +- void AddError(int line, int column, const std::string& message) override {} ++ void RecordError(int line, int column, absl::string_view message) override {} + }; + } // namespace + diff --git a/science/py-tensorflow/files/patch-tensorflow_core_lib_png_BUILD b/science/py-tensorflow/files/patch-tensorflow_core_lib_png_BUILD deleted file mode 100644 index 76a365c9a661..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_core_lib_png_BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/core/lib/png/BUILD.orig 2022-08-28 14:35:19 UTC -+++ tensorflow/core/lib/png/BUILD -@@ -23,6 +23,7 @@ cc_library( - "@com_google_absl//absl/base", - "@zlib", - ], -+ copts = ["-std=c++17"], - ) - - alias( diff --git a/science/py-tensorflow/files/patch-tensorflow_core_platform_BUILD b/science/py-tensorflow/files/patch-tensorflow_core_platform_BUILD deleted file mode 100644 index dc2a75c1daa6..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_core_platform_BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/core/platform/BUILD.orig 2022-08-29 08:52:22 UTC -+++ tensorflow/core/platform/BUILD -@@ -680,6 +680,7 @@ cc_library( - ":str_util", - ":stringpiece", - ], -+ copts = ["-std=c++17"], - ) - - cc_library( diff --git a/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_hlo__to__tools__data.cc b/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_hlo__to__tools__data.cc new file mode 100644 index 000000000000..ad9c4d7d7886 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_hlo__to__tools__data.cc @@ -0,0 +1,11 @@ +--- tensorflow/core/profiler/convert/hlo_to_tools_data.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/core/profiler/convert/hlo_to_tools_data.cc +@@ -51,7 +51,7 @@ StatusOr<std::string> ConvertHloProtoToMemoryViewer( + + std::string json_output; + tensorflow::protobuf::util::JsonPrintOptions options; +- options.always_print_primitive_fields = true; ++ options.always_print_fields_with_no_presence = true; + auto encoded_status = tensorflow::protobuf::util::MessageToJsonString( + result_or.value(), &json_output, options); + if (!encoded_status.ok()) { diff --git a/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_xplane__to__memory__profile.cc b/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_xplane__to__memory__profile.cc new file mode 100644 index 000000000000..8dc4e9453872 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_xplane__to__memory__profile.cc @@ -0,0 +1,11 @@ +--- tensorflow/core/profiler/convert/xplane_to_memory_profile.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/core/profiler/convert/xplane_to_memory_profile.cc +@@ -529,7 +529,7 @@ Status ConvertProtoToJson(const Proto& proto_output, s + template <typename Proto> + Status ConvertProtoToJson(const Proto& proto_output, std::string* json_output) { + protobuf::util::JsonPrintOptions json_options; +- json_options.always_print_primitive_fields = true; ++ json_options.always_print_fields_with_no_presence = true; + auto status = protobuf::util::MessageToJsonString(proto_output, json_output, + json_options); + if (!status.ok()) { diff --git a/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_xplane__to__tools__data.cc b/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_xplane__to__tools__data.cc new file mode 100644 index 000000000000..985be6cab23c --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_core_profiler_convert_xplane__to__tools__data.cc @@ -0,0 +1,20 @@ +--- tensorflow/core/profiler/convert/xplane_to_tools_data.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/core/profiler/convert/xplane_to_tools_data.cc +@@ -147,7 +147,7 @@ StatusOr<std::string> ConvertMultiXSpacesToPodViewer( + + std::string json_output; + protobuf::util::JsonPrintOptions opts; +- opts.always_print_primitive_fields = true; ++ opts.always_print_fields_with_no_presence = true; + auto encode_status = protobuf::util::MessageToJsonString( + ConvertOpStatsToPodViewer(combined_op_stats), &json_output, opts); + if (!encode_status.ok()) { +@@ -201,7 +201,7 @@ StatusOr<std::string> ConvertMultiXSpacesToOpProfileVi + profile); + std::string json_output; + protobuf::util::JsonPrintOptions opts; +- opts.always_print_primitive_fields = true; ++ opts.always_print_fields_with_no_presence = true; + + auto encode_status = + protobuf::util::MessageToJsonString(profile, &json_output, opts); diff --git a/science/py-tensorflow/files/patch-tensorflow_core_util_proto_proto__utils.cc b/science/py-tensorflow/files/patch-tensorflow_core_util_proto_proto__utils.cc new file mode 100644 index 000000000000..d2977a24c290 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_core_util_proto_proto__utils.cc @@ -0,0 +1,25 @@ +--- tensorflow/core/util/proto/proto_utils.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/core/util/proto/proto_utils.cc +@@ -101,17 +101,17 @@ StringErrorCollector::StringErrorCollector(string* err + } + } + +-void StringErrorCollector::AddError(int line, int column, +- const string& message) { ++void StringErrorCollector::RecordError(int line, int column, ++ absl::string_view message) { + if (error_text_ != nullptr) { + absl::SubstituteAndAppend(error_text_, "$0($1): $2\n", line + index_offset_, + column + index_offset_, message); + } + } + +-void StringErrorCollector::AddWarning(int line, int column, +- const string& message) { +- AddError(line, column, message); ++void StringErrorCollector::RecordWarning(int line, int column, ++ absl::string_view message) { ++ RecordError(line, column, message); + } + + } // namespace proto_utils diff --git a/science/py-tensorflow/files/patch-tensorflow_core_util_proto_proto__utils.h b/science/py-tensorflow/files/patch-tensorflow_core_util_proto_proto__utils.h new file mode 100644 index 000000000000..049dd023f7fc --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_core_util_proto_proto__utils.h @@ -0,0 +1,18 @@ +--- tensorflow/core/util/proto/proto_utils.h.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/core/util/proto/proto_utils.h +@@ -52,11 +52,11 @@ class StringErrorCollector : public protobuf::io::Erro + StringErrorCollector(const StringErrorCollector&) = delete; + StringErrorCollector& operator=(const StringErrorCollector&) = delete; + +- // Implementation of protobuf::io::ErrorCollector::AddError. +- void AddError(int line, int column, const string& message) override; ++ // Implementation of protobuf::io::ErrorCollector::RecordError. ++ void RecordError(int line, int column, absl::string_view message) override; + +- // Implementation of protobuf::io::ErrorCollector::AddWarning. +- void AddWarning(int line, int column, const string& message) override; ++ // Implementation of protobuf::io::ErrorCollector::RecordWarning. ++ void RecordWarning(int line, int column, absl::string_view message) override; + + private: + string* const error_text_; diff --git a/science/py-tensorflow/files/patch-tensorflow_java_BUILD b/science/py-tensorflow/files/patch-tensorflow_java_BUILD deleted file mode 100644 index 33b7db687b88..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_java_BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/java/BUILD.orig 2023-03-30 17:51:23.641040000 +0200 -+++ tensorflow/java/BUILD 2023-03-30 17:51:34.802406000 +0200 -@@ -446,6 +446,7 @@ - "//tensorflow:windows": [], - "//conditions:default": [ - "-z defs", -+ "-Wl,--undefined-version", - "-s", - "-Wl,--version-script,$(location {})".format(LINKER_VERSION_SCRIPT), - ], diff --git a/science/py-tensorflow/files/patch-tensorflow_lite_BUILD b/science/py-tensorflow/files/patch-tensorflow_lite_BUILD deleted file mode 100644 index 8d54d284e506..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_lite_BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/lite/BUILD.orig 2023-03-30 18:04:54.206396000 +0200 -+++ tensorflow/lite/BUILD 2023-03-30 18:04:24.422539000 +0200 -@@ -1204,6 +1204,7 @@ - "//tensorflow:windows": [], - "//conditions:default": [ - "-Wl,-z,defs", -+ "-Wl,--undefined-version", - "-Wl,--version-script,$(location //tensorflow/lite:tflite_version_script.lds)", - ], - }), diff --git a/science/py-tensorflow/files/patch-tensorflow_lite_build_def.bzl b/science/py-tensorflow/files/patch-tensorflow_lite_build_def.bzl deleted file mode 100644 index 58d62b5e5dd5..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_lite_build_def.bzl +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/lite/build_def.bzl.orig 2023-03-30 17:56:40.338369000 +0200 -+++ tensorflow/lite/build_def.bzl 2023-03-30 17:56:50.244995000 +0200 -@@ -172,6 +172,7 @@ - ], - clean_dep("//tensorflow:windows"): [], - "//conditions:default": [ -+ "-Wl,--undefined-version", - "-Wl,--version-script,$(location {})".format(linkscript), - "-Wl,-soname," + name, - ], diff --git a/science/py-tensorflow/files/patch-tensorflow_lite_c_BUILD b/science/py-tensorflow/files/patch-tensorflow_lite_c_BUILD deleted file mode 100644 index c88f9a6c9aa4..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_lite_c_BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/lite/c/BUILD.orig 2023-03-30 18:05:35.316884000 +0200 -+++ tensorflow/lite/c/BUILD 2023-03-30 18:05:48.639862000 +0200 -@@ -29,6 +29,7 @@ - "//tensorflow:windows": [], - "//conditions:default": [ - "-z defs", -+ "-Wl,--undefined-version", - "-Wl,--version-script,$(location //tensorflow/lite/c:version_script.lds)", - ], - }), diff --git a/science/py-tensorflow/files/patch-tensorflow_lite_delegates_flex_build_def.bzl b/science/py-tensorflow/files/patch-tensorflow_lite_delegates_flex_build_def.bzl deleted file mode 100644 index 9b207ba77c9d..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_lite_delegates_flex_build_def.bzl +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/lite/delegates/flex/build_def.bzl.orig 2023-03-30 17:57:26.322444000 +0200 -+++ tensorflow/lite/delegates/flex/build_def.bzl 2023-03-30 17:58:45.005163000 +0200 -@@ -223,6 +223,7 @@ - "//tensorflow:windows": [], - "//conditions:default": [ - "-Wl,-z,defs", -+ "-Wl,--undefined-version", - "-Wl,--version-script,$(location //tensorflow/lite/delegates/flex:version_script.lds)", - ], - }), diff --git a/science/py-tensorflow/files/patch-tensorflow_lite_delegates_hexagon_hexagon_nn_BUILD b/science/py-tensorflow/files/patch-tensorflow_lite_delegates_hexagon_hexagon_nn_BUILD deleted file mode 100644 index 010da725e1f8..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_lite_delegates_hexagon_hexagon_nn_BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/lite/delegates/hexagon/hexagon_nn/BUILD.orig 2023-03-30 17:50:25.801299000 +0200 -+++ tensorflow/lite/delegates/hexagon/hexagon_nn/BUILD 2023-03-30 17:50:38.457225000 +0200 -@@ -76,6 +76,7 @@ - name = "libhexagon_interface.so", - linkopts = [ - "-Wl,-soname=libhexagon_interface.so", -+ "-Wl,--undefined-version", - "-z defs", - "-Wl,--version-script,$(location //tensorflow/lite/delegates/hexagon/hexagon_nn:version_scripts.lds)", - ] + select({ diff --git a/science/py-tensorflow/files/patch-tensorflow_python_BUILD b/science/py-tensorflow/files/patch-tensorflow_python_BUILD new file mode 100644 index 000000000000..571aaeb6f5ee --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_python_BUILD @@ -0,0 +1,10 @@ +--- tensorflow/python/BUILD.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/python/BUILD +@@ -5043,7 +5043,6 @@ tf_python_pybind_extension( + features = ["-layering_check"], + deps = [ + ":pywrap_densor_device_headers", +- "//tensorflow/dtensor/proto:layout_proto_cc", + "//tensorflow/python/lib/core:pybind11_lib", + "//tensorflow/python/lib/core:pybind11_status_headers", + "//third_party/python_runtime:headers", # buildcleaner: keep diff --git a/science/py-tensorflow/files/patch-tensorflow_python_framework_BUILD b/science/py-tensorflow/files/patch-tensorflow_python_framework_BUILD new file mode 100644 index 000000000000..6333ffbb7fe6 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_python_framework_BUILD @@ -0,0 +1,23 @@ +--- tensorflow/python/framework/BUILD.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/python/framework/BUILD +@@ -421,11 +421,11 @@ py_library( + "//tensorflow/core:protos_all_py", + "//tensorflow/core/function/trace_type", + "//tensorflow/python:pywrap_tensorflow", +- "//tensorflow/python/lib/core:_pywrap_bfloat16", + "//tensorflow/python/lib/core:_pywrap_custom_casts", + "//tensorflow/python/lib/core:_pywrap_float8", + "//tensorflow/python/types:doc_typealias", + "//tensorflow/python/util:tf_export", ++ "//tensorflow/tsl/python/lib/core:pywrap_bfloat16", + ], + ) + +@@ -942,6 +942,7 @@ tf_python_pybind_extension( + "//tensorflow/python/util:function_parameter_canonicalizer_hdrs", + "//third_party/python_runtime:headers", # buildcleaner: keep + "@com_google_absl//absl/container:flat_hash_map", ++ "@com_google_absl//absl/strings", + "@pybind11", + ], + ) diff --git a/science/py-tensorflow/files/patch-tensorflow_python_framework_python__api__dispatcher__wrapper.cc b/science/py-tensorflow/files/patch-tensorflow_python_framework_python__api__dispatcher__wrapper.cc new file mode 100644 index 000000000000..7f87215ca928 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_python_framework_python__api__dispatcher__wrapper.cc @@ -0,0 +1,10 @@ +--- tensorflow/python/framework/python_api_dispatcher_wrapper.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/python/framework/python_api_dispatcher_wrapper.cc +@@ -14,6 +14,7 @@ limitations under the License. + ==============================================================================*/ + // Python bindings for tensorflow/python/framework/python_api_dispatcher.h. + ++#include "absl/strings/str_cat.h" + #include "pybind11/pybind11.h" // from @pybind11 + #include "pybind11/pytypes.h" // from @pybind11 + #include "pybind11/stl.h" // from @pybind11 diff --git a/science/py-tensorflow/files/patch-tensorflow_python_util_BUILD b/science/py-tensorflow/files/patch-tensorflow_python_util_BUILD new file mode 100644 index 000000000000..9c99182fba88 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_python_util_BUILD @@ -0,0 +1,10 @@ +--- tensorflow/python/util/BUILD.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/python/util/BUILD +@@ -442,6 +442,7 @@ cc_library( + "//tensorflow/python/lib/core:safe_pyobject_ptr", + "//third_party/python_runtime:headers", # buildcleaner: keep + "@com_google_absl//absl/container:flat_hash_set", ++ "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:span", + ], + ) diff --git a/science/py-tensorflow/files/patch-tensorflow_python_util_function__parameter__canonicalizer.cc b/science/py-tensorflow/files/patch-tensorflow_python_util_function__parameter__canonicalizer.cc new file mode 100644 index 000000000000..decd6b668369 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_python_util_function__parameter__canonicalizer.cc @@ -0,0 +1,10 @@ +--- tensorflow/python/util/function_parameter_canonicalizer.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/python/util/function_parameter_canonicalizer.cc +@@ -16,6 +16,7 @@ limitations under the License. + #include "tensorflow/python/util/function_parameter_canonicalizer.h" + + #include "absl/container/flat_hash_set.h" ++#include "absl/strings/str_cat.h" + #include "tensorflow/core/platform/logging.h" + #include "tensorflow/core/platform/macros.h" + #include "tensorflow/python/lib/core/py_util.h" diff --git a/science/py-tensorflow/files/patch-tensorflow_tensorflow.bzl b/science/py-tensorflow/files/patch-tensorflow_tensorflow.bzl deleted file mode 100644 index a630a8fa1d09..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_tensorflow.bzl +++ /dev/null @@ -1,26 +0,0 @@ ---- tensorflow/tensorflow.bzl.orig 2023-03-30 17:54:35.641567000 +0200 -+++ tensorflow/tensorflow.bzl 2023-03-30 17:56:12.747346000 +0200 -@@ -2305,6 +2305,7 @@ - ], - clean_dep("//tensorflow:windows"): [], - "//conditions:default": [ -+ "-Wl,--undefined-version", - "-Wl,--version-script", - "$(location %s.lds)" % vscriptname, - ], -@@ -2975,6 +2976,7 @@ - "/ignore:4070", - ] if win_def_file else [], - "//conditions:default": [ -+ "-Wl,--undefined-version", - "-Wl,--version-script", - "$(location %s)" % version_script_file, - ], -@@ -3035,6 +3037,7 @@ - ], - clean_dep("//tensorflow:windows"): [], - "//conditions:default": [ -+ "-Wl,--undefined-version", - "-Wl,--version-script", - "$(location %s)" % version_script_file, - ], diff --git a/science/py-tensorflow/files/patch-tensorflow_tf__framework__version__script.lds b/science/py-tensorflow/files/patch-tensorflow_tf__framework__version__script.lds new file mode 100644 index 000000000000..e20aa6bda712 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tf__framework__version__script.lds @@ -0,0 +1,12 @@ +--- tensorflow/tf_framework_version_script.lds.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tf_framework_version_script.lds +@@ -3,9 +3,6 @@ VERS_1.0 { + local: + jpeg_*; + jinit_*; +- jdiv_round_up; +- jround_up; +- jzero_far; + jcopy_*; + jsimd_*; + hwloc_*; diff --git a/science/py-tensorflow/files/patch-tensorflow_tf_framework_version_script.lds b/science/py-tensorflow/files/patch-tensorflow_tf_framework_version_script.lds deleted file mode 100644 index 890e1456b9ba..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_tf_framework_version_script.lds +++ /dev/null @@ -1,12 +0,0 @@ ---- tensorflow/tf_framework_version_script.lds.orig 2023-03-30 17:42:11.255357000 +0200 -+++ tensorflow/tf_framework_version_script.lds 2023-03-30 17:42:18.431845000 +0200 -@@ -3,9 +3,6 @@ - local: - jpeg_*; - jinit_*; -- jdiv_round_up; -- jround_up; -- jzero_far; - jcopy_*; - jsimd_*; - hwloc_*; diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_build__pip__package.sh b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_build__pip__package.sh new file mode 100644 index 000000000000..643344bac97f --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_build__pip__package.sh @@ -0,0 +1,32 @@ +--- tensorflow/tools/pip_package/build_pip_package.sh.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tools/pip_package/build_pip_package.sh +@@ -183,9 +183,9 @@ function prepare_src() { + bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow \ + "${XLA_AOT_RUNTIME_SOURCES}" + # Copy MKL libs over so they can be loaded at runtime +- # TODO(b/271299337): shared libraries that depend on libbfloat16.so.so have ++ # TODO(b/271299337): shared libraries that depend on libbfloat16.so have + # their NEEDED and RUNPATH set corresponding to a dependency on +- # RUNFILES/_solib_local/libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so.so, ++ # RUNFILES/_solib_local/libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so, + # which is a symlink to tensorflow/tsl/python/lib/core/libbfloat16.so in + # the Bazel build tree. We do not export the file in _solib_local (nor + # symlinks in general, I think Python wheels have poor support for them?) +@@ -193,13 +193,13 @@ function prepare_src() { + if is_macos; then + chmod +rw ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so + chmod +rw ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so +- install_name_tool -change "@loader_path/../../../../../${so_lib_dir}//libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so.so" "@loader_path/libbfloat16.so.so" ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so +- install_name_tool -change "@loader_path/../../${so_lib_dir}//libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so.so" "@loader_path/../tsl/python/lib/core/libbfloat16.so.so" ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so ++ install_name_tool -change "@loader_path/../../../../../${so_lib_dir}//libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so" "@loader_path/libbfloat16.so" ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so ++ install_name_tool -change "@loader_path/../../${so_lib_dir}//libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so" "@loader_path/../tsl/python/lib/core/libbfloat16.so" ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so + else + chmod +rw ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so + chmod +rw ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so +- patchelf --replace-needed libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so.so libbfloat16.so.so ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so +- patchelf --replace-needed libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so.so libbfloat16.so.so ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so ++ patchelf --replace-needed libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so libbfloat16.so ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so ++ patchelf --replace-needed libtensorflow_Stsl_Spython_Slib_Score_Slibbfloat16.so libbfloat16.so ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so + patchelf --set-rpath $(patchelf --print-rpath ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so):\$ORIGIN ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so + patchelf --set-rpath $(patchelf --print-rpath ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so):\$ORIGIN/../tsl/python/lib/core ${TMPDIR}/tensorflow/python/_pywrap_tensorflow_internal.so + patchelf --shrink-rpath ${TMPDIR}/tensorflow/tsl/python/lib/core/pywrap_bfloat16.so diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_setup.py b/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_setup.py deleted file mode 100644 index 76ac3facf928..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_tools_pip__package_setup.py +++ /dev/null @@ -1,34 +0,0 @@ ---- tensorflow/tools/pip_package/setup.py.orig 2022-09-07 19:29:52 UTC -+++ tensorflow/tools/pip_package/setup.py -@@ -77,13 +77,12 @@ REQUIRED_PACKAGES = [ - 'astunparse >= 1.6.0', - # TODO(b/187981032): remove the constraint for 2.0 once the incompatibile - # issue is resolved. -- 'flatbuffers >= 1.12, <2', -+ 'flatbuffers', - # TODO(b/213222745) gast versions above 0.4.0 break TF's tests -- 'gast >= 0.2.1, <= 0.4.0', -+ 'gast', - 'google_pasta >= 0.1.1', - 'h5py >= 2.9.0', -- 'keras_preprocessing >= 1.1.1', # 1.1.0 needs tensorflow==1.7 -- 'libclang >= 13.0.0', -+ 'keras_preprocessing >= 1.1.0', # 1.1.0 needs tensorflow==1.7 - 'numpy >= 1.20', - 'opt_einsum >= 2.3.2', - 'packaging', -@@ -94,13 +93,12 @@ REQUIRED_PACKAGES = [ - # See also: https://github.com/protocolbuffers/protobuf/issues/9954 - # See also: https://github.com/tensorflow/tensorflow/issues/56077 - # This is a temporary patch for now, to patch previous TF releases. -- 'protobuf >= 3.9.2, < 3.20', -+ 'protobuf', - 'setuptools', - 'six >= 1.12.0', - 'termcolor >= 1.1.0', - 'typing_extensions >= 3.6.6', - 'wrapt >= 1.11.0', -- 'tensorflow-io-gcs-filesystem >= 0.23.1', - # grpcio does not build correctly on big-endian machines due to lack of - # BoringSSL support. - # See https://github.com/tensorflow/tensorflow/issues/17882. diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_proto__text_BUILD b/science/py-tensorflow/files/patch-tensorflow_tools_proto__text_BUILD deleted file mode 100644 index 8cdff520c744..000000000000 --- a/science/py-tensorflow/files/patch-tensorflow_tools_proto__text_BUILD +++ /dev/null @@ -1,10 +0,0 @@ ---- tensorflow/tools/proto_text/BUILD.orig 2022-05-22 22:28:22 UTC -+++ tensorflow/tools/proto_text/BUILD -@@ -60,6 +60,7 @@ cc_library( - "-lm", - "-lpthread", - "-lrt", -+ "-L%%LOCALBASE%%/lib", - ], - }), - deps = [ diff --git a/science/py-tensorflow/files/patch-tensorflow_tools_proto__text_gen__proto__text__functions.cc b/science/py-tensorflow/files/patch-tensorflow_tools_proto__text_gen__proto__text__functions.cc new file mode 100644 index 000000000000..ee04155163a4 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tools_proto__text_gen__proto__text__functions.cc @@ -0,0 +1,13 @@ +--- tensorflow/tools/proto_text/gen_proto_text_functions.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tools/proto_text/gen_proto_text_functions.cc +@@ -31,8 +31,8 @@ class CrashOnErrorCollector + public: + ~CrashOnErrorCollector() override {} + +- void AddError(const string& filename, int line, int column, +- const string& message) override { ++ void RecordError(absl::string_view filename, int line, int column, ++ absl::string_view message) override { + LOG(FATAL) << "Unexpected error at " << filename << "@" << line << ":" + << column << " - " << message; + } diff --git a/science/py-tensorflow/files/patch-tensorflow_tsl_platform_default_build__config.bzl b/science/py-tensorflow/files/patch-tensorflow_tsl_platform_default_build__config.bzl new file mode 100644 index 000000000000..2df204c53eae --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tsl_platform_default_build__config.bzl @@ -0,0 +1,25 @@ +--- tensorflow/tsl/platform/default/build_config.bzl.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tsl/platform/default/build_config.bzl +@@ -401,13 +401,6 @@ def py_proto_library( + # is not explicitly listed in py_libs. Instead, host system is assumed to + # have grpc installed. + +- genproto_deps = [] +- for dep in deps: +- if dep != "@com_google_protobuf//:protobuf_python": +- genproto_deps.append(dep + "_genproto") +- else: +- genproto_deps.append("@com_google_protobuf//:well_known_types_py_pb2_genproto") +- + proto_gen( + name = name + "_genproto", + srcs = srcs, +@@ -418,7 +411,7 @@ def py_proto_library( + plugin_language = "grpc", + protoc = protoc, + visibility = ["//visibility:public"], +- deps = genproto_deps, ++ deps = [s + "_genproto" for s in deps], + ) + + if default_runtime and not default_runtime in py_libs + deps: diff --git a/science/py-tensorflow/files/patch-tensorflow_tsl_platform_default_human__readable__json.cc b/science/py-tensorflow/files/patch-tensorflow_tsl_platform_default_human__readable__json.cc new file mode 100644 index 000000000000..b25b238f479a --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tsl_platform_default_human__readable__json.cc @@ -0,0 +1,11 @@ +--- tensorflow/tsl/platform/default/human_readable_json.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tsl/platform/default/human_readable_json.cc +@@ -27,7 +27,7 @@ Status ProtoToHumanReadableJson(const protobuf::Messag + + protobuf::util::JsonPrintOptions json_options; + json_options.preserve_proto_field_names = true; +- json_options.always_print_primitive_fields = true; ++ json_options.always_print_fields_with_no_presence = true; + auto status = + protobuf::util::MessageToJsonString(proto, result, json_options); + if (!status.ok()) { diff --git a/science/py-tensorflow/files/patch-tensorflow_tsl_python_lib_core_BUILD b/science/py-tensorflow/files/patch-tensorflow_tsl_python_lib_core_BUILD new file mode 100644 index 000000000000..4d6d8c57b038 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tsl_python_lib_core_BUILD @@ -0,0 +1,11 @@ +--- tensorflow/tsl/python/lib/core/BUILD.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tsl/python/lib/core/BUILD +@@ -50,7 +50,7 @@ cc_shared_library( + roots = [":bfloat16_lib"], + # TODO(tlongeri): If this is not explicitly specified, dependent DLLs will expect "bfloat16.so" + # and we will generate "bfloat16.so.dll", for some reason +- shared_lib_name = if_windows("bfloat16.so", None), ++ shared_lib_name = if_windows("bfloat16.so", "libbfloat16.so"), + static_deps = [ + # TODO(ddunleavy): If cc_shared_library is ever not a noop in g3, change + # this to be more specific. diff --git a/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl b/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl index 207894ee3c88..91723987576b 100644 --- a/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl +++ b/science/py-tensorflow/files/patch-tensorflow_workspace2.bzl @@ -1,10 +1,32 @@ ---- tensorflow/workspace2.bzl.orig 2022-05-22 22:28:22 UTC +--- tensorflow/workspace2.bzl.orig 2023-09-12 16:46:28 UTC +++ tensorflow/workspace2.bzl -@@ -137,6 +137,7 @@ def _tf_repositories(): +@@ -145,6 +145,7 @@ def _tf_repositories(): name = "XNNPACK", - sha256 = "7e9ad45391e5158fd00e816022bda21d54a6180788af7c455c864a78cee252c6", - strip_prefix = "XNNPACK-11b2812d64e49bab9b6c489f79067fc94e69db9f", -+ patch_file=["//third_party:add-default-option.patch"], - urls = tf_mirror_urls("https://github.com/google/XNNPACK/archive/11b2812d64e49bab9b6c489f79067fc94e69db9f.zip"), + sha256 = "c979b62e8b77af60dfd7567f22ade20d5a9d4d0888f8a2d60d155fc0d31b22ab", + strip_prefix = "XNNPACK-b9d4073a6913891ce9cbd8965c8d506075d2a45a", ++ patch_file=["//third_party:fix-xnnpack.patch"], + urls = tf_mirror_urls("https://github.com/google/XNNPACK/archive/b9d4073a6913891ce9cbd8965c8d506075d2a45a.zip"), ) # LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/xnnpack.cmake) +@@ -165,9 +166,9 @@ def _tf_repositories(): + + tf_http_archive( + name = "cpuinfo", +- strip_prefix = "cpuinfo-3dc310302210c1891ffcfb12ae67b11a3ad3a150", +- sha256 = "ba668f9f8ea5b4890309b7db1ed2e152aaaf98af6f9a8a63dbe1b75c04e52cb9", +- urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/3dc310302210c1891ffcfb12ae67b11a3ad3a150.zip"), ++ strip_prefix = "cpuinfo-fa1c679da8d19e1d87f20175ae1ec10995cd3dd3", ++ sha256 = "2bf2b62eb86e2d2eaf862d0b9683a6c467a4d69fb2f7f1dc47c799809148608f", ++ urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/fa1c679da8d19e1d87f20175ae1ec10995cd3dd3.zip"), + ) + + tf_http_archive( +@@ -875,7 +876,7 @@ def _tf_repositories(): + urls = tf_mirror_urls("https://github.com/pybind/pybind11_protobuf/archive/80f3440cd8fee124e077e2e47a8a17b78b451363.zip"), + sha256 = "c7ab64b1ccf9a678694a89035a8c865a693e4e872803778f91f0965c2f281d78", + strip_prefix = "pybind11_protobuf-80f3440cd8fee124e077e2e47a8a17b78b451363", +- patch_file = ["//third_party/pybind11_protobuf:remove_license.patch"], ++ patch_file = ["//third_party/pybind11_protobuf:remove_license.patch","//third_party:fix-pybind11_protobuf.patch"], + ) + + tf_http_archive( diff --git a/science/py-tensorflow/files/patch-third__party_absl_system.absl.base.BUILD b/science/py-tensorflow/files/patch-third__party_absl_system.absl.base.BUILD new file mode 100644 index 000000000000..c92f6c708ed8 --- /dev/null +++ b/science/py-tensorflow/files/patch-third__party_absl_system.absl.base.BUILD @@ -0,0 +1,18 @@ +--- third_party/absl/system.absl.base.BUILD.orig 2023-09-12 16:46:28 UTC ++++ third_party/absl/system.absl.base.BUILD +@@ -17,7 +17,14 @@ cc_library( + + cc_library( + name = "log_severity", +- linkopts = ["-labsl_log_severity"], ++ linkopts = [ ++ "-labsl_log_severity", ++ "-labsl_log_internal_check_op", ++ "-labsl_log_internal_conditions", ++ "-labsl_log_internal_message", ++ "-labsl_log_internal_nullguard", ++ "-labsl_vlog_config_internal", ++ ], + ) + + cc_library( diff --git a/science/py-tensorflow/files/patch-third__party_absl_system.absl.flags.BUILD b/science/py-tensorflow/files/patch-third__party_absl_system.absl.flags.BUILD new file mode 100644 index 000000000000..1376191228ef --- /dev/null +++ b/science/py-tensorflow/files/patch-third__party_absl_system.absl.flags.BUILD @@ -0,0 +1,10 @@ +--- third_party/absl/system.absl.flags.BUILD.orig 2023-09-12 16:46:28 UTC ++++ third_party/absl/system.absl.flags.BUILD +@@ -97,7 +97,6 @@ cc_library( + + cc_library( + name = "flag", +- linkopts = ["-labsl_flags"], + deps = [ + ":config", + ":flag_internal", diff --git a/science/py-tensorflow/files/patch-third__party_absl_system.absl.functional.BUILD b/science/py-tensorflow/files/patch-third__party_absl_system.absl.functional.BUILD new file mode 100644 index 000000000000..2946aa0a5e86 --- /dev/null +++ b/science/py-tensorflow/files/patch-third__party_absl_system.absl.functional.BUILD @@ -0,0 +1,13 @@ +--- third_party/absl/system.absl.functional.BUILD.orig 2023-09-12 16:46:28 UTC ++++ third_party/absl/system.absl.functional.BUILD +@@ -3,6 +3,10 @@ cc_library( + package(default_visibility = ["//visibility:public"]) + + cc_library( ++ name = "any_invocable", ++) ++ ++cc_library( + name = "bind_front", + ) + diff --git a/science/py-tensorflow/files/patch-third__party_absl_system.absl.log.BUILD b/science/py-tensorflow/files/patch-third__party_absl_system.absl.log.BUILD new file mode 100644 index 000000000000..b148e8424213 --- /dev/null +++ b/science/py-tensorflow/files/patch-third__party_absl_system.absl.log.BUILD @@ -0,0 +1,13 @@ +--- third_party/absl/system.absl.log.BUILD.orig 2024-06-26 12:02:28 UTC ++++ third_party/absl/system.absl.log.BUILD +@@ -0,0 +1,10 @@ ++load("@rules_cc//cc:defs.bzl", "cc_library") ++ ++package(default_visibility = ["//visibility:public"]) ++ ++[cc_library( ++ name = n, ++) for n in [ ++ "log", ++ "check", ++]] diff --git a/science/py-tensorflow/files/patch-third__party_absl_system.absl.strings.BUILD b/science/py-tensorflow/files/patch-third__party_absl_system.absl.strings.BUILD index 5db2e76aff4b..dca3d2c50183 100644 --- a/science/py-tensorflow/files/patch-third__party_absl_system.absl.strings.BUILD +++ b/science/py-tensorflow/files/patch-third__party_absl_system.absl.strings.BUILD @@ -1,15 +1,6 @@ ---- third_party/absl/system.absl.strings.BUILD.orig 2022-05-22 22:28:22 UTC +--- third_party/absl/system.absl.strings.BUILD.orig 2023-09-12 16:46:28 UTC +++ third_party/absl/system.absl.strings.BUILD -@@ -4,7 +4,7 @@ package(default_visibility = ["//visibility:public"]) - - cc_library( - name = "strings", -- linkopts = ["-labsl_strings"], -+ linkopts = ["-L%%LOCALBASE%%/lib", "-labsl_strings"], - deps = [ - ":internal", - "//absl/base", -@@ -26,7 +26,13 @@ cc_library( +@@ -26,7 +26,11 @@ cc_library( cc_library( name = "cord", @@ -17,10 +8,8 @@ + linkopts = [ + "-labsl_cord", + "-labsl_cord_internal", -+ "-labsl_cordz_functions", -+ "-labsl_cordz_handle", -+ "-labsl_cordz_info", -+ "-labsl_cordz_sample_token",], ++ "-labsl_cordz_info" ++ ], deps = [ ":str_format", "//absl/container:compressed_tuple", diff --git a/science/py-tensorflow/files/patch-third__party_absl_system.absl.synchronization.BUILD b/science/py-tensorflow/files/patch-third__party_absl_system.absl.synchronization.BUILD new file mode 100644 index 000000000000..fbd76f00be15 --- /dev/null +++ b/science/py-tensorflow/files/patch-third__party_absl_system.absl.synchronization.BUILD @@ -0,0 +1,31 @@ +--- third_party/absl/system.absl.synchronization.BUILD.orig 2023-09-12 16:46:28 UTC ++++ third_party/absl/system.absl.synchronization.BUILD +@@ -17,13 +17,28 @@ cc_library( + ) + + cc_library( ++ name = "kernel_timeout_internal", ++ visibility = [ ++ ], ++ deps = [ ++ "//absl/base", ++ "//absl/base:config", ++ "//absl/base:core_headers", ++ "//absl/base:raw_logging_internal", ++ "//absl/time", ++ ], ++) ++ ++cc_library( + name = "synchronization", + linkopts = [ + "-labsl_synchronization", ++ "-labsl_kernel_timeout_internal", + "-pthread", + ], + deps = [ + ":graphcycles_internal", ++ ":kernel_timeout_internal", + "//absl/base", + "//absl/base:atomic_hook", + "//absl/base:dynamic_annotations", diff --git a/science/py-tensorflow/files/patch-third__party_absl_workspace.bzl b/science/py-tensorflow/files/patch-third__party_absl_workspace.bzl new file mode 100644 index 000000000000..199a88686264 --- /dev/null +++ b/science/py-tensorflow/files/patch-third__party_absl_workspace.bzl @@ -0,0 +1,10 @@ +--- third_party/absl/workspace.bzl.orig 2023-09-12 16:46:28 UTC ++++ third_party/absl/workspace.bzl +@@ -20,6 +20,7 @@ def repo(): + "flags", + "functional", + "hash", ++ "log", + "memory", + "meta", + "numeric", diff --git a/science/py-tensorflow/files/patch-third__party_cpuinfo_cpuinfo.BUILD b/science/py-tensorflow/files/patch-third__party_cpuinfo_cpuinfo.BUILD deleted file mode 100644 index 738e8bc2abd8..000000000000 --- a/science/py-tensorflow/files/patch-third__party_cpuinfo_cpuinfo.BUILD +++ /dev/null @@ -1,51 +0,0 @@ ---- third_party/cpuinfo/cpuinfo.BUILD.orig 2022-05-22 22:28:22 UTC -+++ third_party/cpuinfo/cpuinfo.BUILD -@@ -100,35 +100,7 @@ EMSCRIPTEN_SRCS = [ - cc_library( - name = "cpuinfo_impl", - srcs = select({ -- ":linux_x86_64": COMMON_SRCS + X86_SRCS + LINUX_SRCS + LINUX_X86_SRCS, -- ":linux_arm": COMMON_SRCS + ARM_SRCS + LINUX_SRCS + LINUX_ARM32_SRCS, -- ":linux_armhf": COMMON_SRCS + ARM_SRCS + LINUX_SRCS + LINUX_ARM32_SRCS, -- ":linux_armv7a": COMMON_SRCS + ARM_SRCS + LINUX_SRCS + LINUX_ARM32_SRCS, -- ":linux_armeabi": COMMON_SRCS + ARM_SRCS + LINUX_SRCS + LINUX_ARM32_SRCS, -- ":linux_aarch64": COMMON_SRCS + ARM_SRCS + LINUX_SRCS + LINUX_ARM64_SRCS, -- ":linux_mips64": COMMON_SRCS + LINUX_SRCS, -- ":linux_riscv64": COMMON_SRCS + LINUX_SRCS, -- ":linux_s390x": COMMON_SRCS + LINUX_SRCS, -- ":macos_x86_64": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, -- ":macos_arm64": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":windows_x86_64": COMMON_SRCS + X86_SRCS + WINDOWS_X86_SRCS, -- ":android_armv7": COMMON_SRCS + ARM_SRCS + LINUX_SRCS + LINUX_ARM32_SRCS + ANDROID_ARM_SRCS, -- ":android_arm64": COMMON_SRCS + ARM_SRCS + LINUX_SRCS + LINUX_ARM64_SRCS + ANDROID_ARM_SRCS, -- ":android_x86": COMMON_SRCS + X86_SRCS + LINUX_SRCS + LINUX_X86_SRCS, -- ":android_x86_64": COMMON_SRCS + X86_SRCS + LINUX_SRCS + LINUX_X86_SRCS, -- ":ios_x86_64": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, -- ":ios_x86": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, -- ":ios_armv7": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":ios_arm64": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":ios_arm64e": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":ios_sim_arm64": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":watchos_x86_64": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, -- ":watchos_x86": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, -- ":watchos_armv7k": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":watchos_arm64_32": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":tvos_x86_64": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, -- ":tvos_arm64": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS, -- ":emscripten_wasm": COMMON_SRCS + EMSCRIPTEN_SRCS, -+ "//conditions:default": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS, - }), - copts = select({ - ":windows_x86_64": [], -@@ -187,6 +159,11 @@ cc_library( - ) - - ############################# Build configurations ############################# -+ -+config_setting( -+ name = "default", -+ values = {"cpu": "k8"}, -+) - - config_setting( - name = "linux_x86_64", diff --git a/science/py-tensorflow/files/patch-third__party_cpuinfo_workspace.bzl b/science/py-tensorflow/files/patch-third__party_cpuinfo_workspace.bzl deleted file mode 100644 index aa701dbd58a5..000000000000 --- a/science/py-tensorflow/files/patch-third__party_cpuinfo_workspace.bzl +++ /dev/null @@ -1,9 +0,0 @@ ---- third_party/cpuinfo/workspace.bzl.orig 2022-08-29 16:23:14 UTC -+++ third_party/cpuinfo/workspace.bzl -@@ -8,5 +8,6 @@ def repo(): - strip_prefix = "cpuinfo-5916273f79a21551890fd3d56fc5375a78d1598d", - sha256 = "2a160c527d3c58085ce260f34f9e2b161adc009b34186a2baf24e74376e89e6d", - urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/5916273f79a21551890fd3d56fc5375a78d1598d.zip"), -+ patch_file = ["//third_party:fix_cpuinfo.patch"], - build_file = "//third_party/cpuinfo:cpuinfo.BUILD", - ) diff --git a/science/py-tensorflow/files/patch-third__party_llvm_macos__build__fix.patch b/science/py-tensorflow/files/patch-third__party_llvm_macos__build__fix.patch deleted file mode 100644 index 772ba624a877..000000000000 --- a/science/py-tensorflow/files/patch-third__party_llvm_macos__build__fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- third_party/llvm/macos_build_fix.patch.orig 2022-09-06 16:15:49 UTC -+++ third_party/llvm/macos_build_fix.patch -@@ -38,7 +38,7 @@ index ff64df694048..c9c35b01711c 100644 - - "@bazel_tools//src/conditions:darwin_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), - - "@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"), - + "//llvm:macos_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), --+ "@bazel_tools//src/conditions:darwin": native_arch_defines("X86", "x86_64-unknown-darwin"), -++ "@bazel_tools//src/conditions:freebsd": native_arch_defines("X86", "x86_64-unknown-freebsd13.0"), - "@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"), - "//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"), - }) + [ diff --git a/science/py-tensorflow/files/patch-third__party_llvm_workspace.bzl b/science/py-tensorflow/files/patch-third__party_llvm_workspace.bzl index e43914b13105..418755c58645 100644 --- a/science/py-tensorflow/files/patch-third__party_llvm_workspace.bzl +++ b/science/py-tensorflow/files/patch-third__party_llvm_workspace.bzl @@ -1,10 +1,10 @@ ---- third_party/llvm/workspace.bzl.orig 2022-05-22 22:28:22 UTC +--- third_party/llvm/workspace.bzl.orig 2023-09-12 16:46:28 UTC +++ third_party/llvm/workspace.bzl -@@ -16,6 +16,6 @@ def repo(name): - "https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT), +@@ -21,6 +21,7 @@ def repo(name): + "//third_party/llvm:build.patch", + "//third_party/llvm:mathextras.patch", + "//third_party/llvm:zstd.patch", ++ "//third_party:fix-environ.patch" ], - build_file = "//third_party/llvm:llvm.BUILD", -- patch_file = ["//third_party/llvm:macos_build_fix.patch"], -+ patch_file = ["//third_party/llvm:macos_build_fix.patch", "//third_party:freebsd_python_fix.patch", "//third_party:fix-environ.patch"], link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"}, ) diff --git a/science/py-tensorflow/files/patch-third__party_py_BUILD.tpl b/science/py-tensorflow/files/patch-third__party_py_BUILD.tpl deleted file mode 100644 index 664828c179f7..000000000000 --- a/science/py-tensorflow/files/patch-third__party_py_BUILD.tpl +++ /dev/null @@ -1,17 +0,0 @@ ---- third_party/py/BUILD.tpl.orig 2022-09-07 10:53:01 UTC -+++ third_party/py/BUILD.tpl -@@ -9,12 +9,14 @@ load("@bazel_tools//tools/python:toolchain.bzl", "py_r - py_runtime( - name = "py2_runtime", - interpreter_path = "%{PYTHON_BIN_PATH}", -+ stub_shebang = "#!%{PYTHON_BIN_PATH}", - python_version = "PY2", - ) - - py_runtime( - name = "py3_runtime", - interpreter_path = "%{PYTHON_BIN_PATH}", -+ stub_shebang = "#!%{PYTHON_BIN_PATH}", - python_version = "PY3", - ) - diff --git a/science/py-tensorflow/files/patch-third__party_systemlibs_protobuf.BUILD b/science/py-tensorflow/files/patch-third__party_systemlibs_protobuf.BUILD deleted file mode 100644 index 212f48248ef9..000000000000 --- a/science/py-tensorflow/files/patch-third__party_systemlibs_protobuf.BUILD +++ /dev/null @@ -1,25 +0,0 @@ ---- third_party/systemlibs/protobuf.BUILD.orig 2022-09-01 05:13:59 UTC -+++ third_party/systemlibs/protobuf.BUILD -@@ -61,19 +61,19 @@ genrule( - - cc_library( - name = "protobuf", -- linkopts = ["-lprotobuf"], -+ linkopts = ["-L%%LOCALBASE%%/lib", "-lprotobuf"], - visibility = ["//visibility:public"], - ) - - cc_library( - name = "protobuf_headers", -- linkopts = ["-lprotobuf"], -+ linkopts = ["-L%%LOCALBASE%%/lib", "-lprotobuf"], - visibility = ["//visibility:public"], - ) - - cc_library( - name = "protoc_lib", -- linkopts = ["-lprotoc"], -+ linkopts = ["-L%%LOCALBASE%%/lib", "-lprotoc"], - visibility = ["//visibility:public"], - ) - |