diff mbox series

[meta-tensorflow,7/14] bazel-native: upgrade 6.0.0 -> 7.7.0

Message ID 20260325021719.1526525-8-hongxu.jia@windriver.com
State New
Headers show
Series Upgrade tensorflow from 2.19.0 to 2.21.0 | expand

Commit Message

Hongxu Jia March 25, 2026, 2:17 a.m. UTC
Tensorflow 2.21 requires bazel 7.7.0

Drop obsolete patches:
- 0001-fix-compile-failure-on-gcc-13.patch
- 1f2b3ed4ac717b814d02a0d125f160ddabe78003.patch
- include_stdint.patch

Refresh patches to 7.7.0
- 0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
- 0001-cutsomize-native-toolchains-for-Yocto.patch
- 0001-fix-unzip-command-not-found.patch

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...-native_6.0.0.bb => bazel-native_7.7.0.bb} |  6 +-
 ...-sysroot-dir-to-the-default-Bazel-to.patch | 16 ++---
 ...utsomize-native-toolchains-for-Yocto.patch | 16 ++---
 .../0001-fix-compile-failure-on-gcc-13.patch  | 71 -------------------
 .../0001-fix-unzip-command-not-found.patch    | 16 ++---
 ...3ed4ac717b814d02a0d125f160ddabe78003.patch | 57 ---------------
 .../bazel/files/include_stdint.patch          | 28 --------
 7 files changed, 25 insertions(+), 185 deletions(-)
 rename recipes-devtools/bazel/{bazel-native_6.0.0.bb => bazel-native_7.7.0.bb} (83%)
 delete mode 100644 recipes-devtools/bazel/files/0001-fix-compile-failure-on-gcc-13.patch
 delete mode 100644 recipes-devtools/bazel/files/1f2b3ed4ac717b814d02a0d125f160ddabe78003.patch
 delete mode 100644 recipes-devtools/bazel/files/include_stdint.patch
diff mbox series

Patch

diff --git a/recipes-devtools/bazel/bazel-native_6.0.0.bb b/recipes-devtools/bazel/bazel-native_7.7.0.bb
similarity index 83%
rename from recipes-devtools/bazel/bazel-native_6.0.0.bb
rename to recipes-devtools/bazel/bazel-native_7.7.0.bb
index 12351ff..a02844d 100644
--- a/recipes-devtools/bazel/bazel-native_6.0.0.bb
+++ b/recipes-devtools/bazel/bazel-native_7.7.0.bb
@@ -2,17 +2,13 @@  DESCRIPTION = "Bazel build and test tool"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
 
-SRC_URI[md5sum] = "f79f57d82795b591e95f9f7fa0f9a8da"
-SRC_URI[sha256sum] = "7bc0c5145c19a56d82a08fce6908c5e1a0e75e4fbfb3b6f12b4deae7f4b38cbc"
+SRC_URI[sha256sum] = "277946818c77fff70be442864cecc41faac862b6f2d0d37033e2da0b1fee7e0f"
 
 SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${PV}-dist.zip \
            file://0001-HttpDownloader-save-download-tarball-to-distdir.patch \
            file://0001-fix-unzip-command-not-found.patch \
            file://0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch \
            file://0001-cutsomize-native-toolchains-for-Yocto.patch \
-           file://0001-fix-compile-failure-on-gcc-13.patch \
-           file://1f2b3ed4ac717b814d02a0d125f160ddabe78003.patch \
-           file://include_stdint.patch \
 "
 
 UPSTREAM_CHECK_URI = "https://github.com/bazelbuild/bazel/releases/"
diff --git a/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch b/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
index 7d73eb7..bd8d969 100644
--- a/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
+++ b/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
@@ -1,6 +1,6 @@ 
-From 34c4dc1a10140addf75d3503d4b9f427303fe212 Mon Sep 17 00:00:00 2001
+From 3459b53f52abe448158954adf1370c2485085450 Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Mon, 14 Dec 2020 16:45:31 +0800
+Date: Wed, 11 Mar 2026 01:44:26 -0700
 Subject: [PATCH] add Yocto native sysroot dir to the default Bazel toolchain
 
 While using the default Bazel C++ toolchain to build Yocto native tools
@@ -14,19 +14,19 @@  If not set YOCTO_NATIVE_SYSROOT, use NOT_SET_YOCTO_NATIVE_SYSROOT
 to replace as a warning
 
 Upstream-Status: Inappropriate [oe specific]
-
+Rebase tot 7.7.0
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
  tools/cpp/unix_cc_configure.bzl | 3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
-index d48485b..0d297bf 100755
+index bbbba7e50d..69bea13b3a 100644
 --- a/tools/cpp/unix_cc_configure.bzl
 +++ b/tools/cpp/unix_cc_configure.bzl
-@@ -443,6 +443,9 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
-             paths["@bazel_tools//tools/cpp:generate_system_module_map.sh"],
-         ))
+@@ -573,6 +573,9 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
+         if "-fno-cxx-modules" not in result.stderr:
+             extra_flags_per_feature["use_module_maps"] = ["-Xclang", "-fno-cxx-modules"]
  
 +    # Customize for Yocto
 +    builtin_include_directories.append(get_env_var(repository_ctx,"YOCTO_NATIVE_SYSROOT", "NOT_SET_YOCTO_NATIVE_SYSROOT"))
@@ -35,5 +35,5 @@  index d48485b..0d297bf 100755
      repository_ctx.template(
          "BUILD",
 -- 
-2.18.2
+2.49.0
 
diff --git a/recipes-devtools/bazel/files/0001-cutsomize-native-toolchains-for-Yocto.patch b/recipes-devtools/bazel/files/0001-cutsomize-native-toolchains-for-Yocto.patch
index 5758b5e..5de56dd 100644
--- a/recipes-devtools/bazel/files/0001-cutsomize-native-toolchains-for-Yocto.patch
+++ b/recipes-devtools/bazel/files/0001-cutsomize-native-toolchains-for-Yocto.patch
@@ -1,26 +1,26 @@ 
-From 81c9eae49a10fa8d5ede088e90632db0103e2168 Mon Sep 17 00:00:00 2001
+From f0c6f3420acdbfd22e06603ca3bbeae3e7d98fc2 Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Thu, 19 May 2022 01:11:05 -0700
+Date: Wed, 11 Mar 2026 01:48:31 -0700
 Subject: [PATCH] cutsomize native toolchains for Yocto
 
 Yocto use environment HOSTTOOLS_DIR to provide native toolchains,
 explicitly set it rather than detect
 
 Upstream-Status: Inappropriate [Yocto specific]
-
+Rebase to 7.7.0
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
  tools/cpp/unix_cc_configure.bzl | 6 ++++++
  1 file changed, 6 insertions(+)
 
 diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
-index 1b6aeb2..4a36685 100755
+index 69bea13b3a..e7e34a1e45 100644
 --- a/tools/cpp/unix_cc_configure.bzl
 +++ b/tools/cpp/unix_cc_configure.bzl
-@@ -373,6 +373,12 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
+@@ -387,6 +387,12 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
      if darwin:
          overriden_tools["gcc"] = "cc_wrapper.sh"
-         overriden_tools["ar"] = "/usr/bin/libtool"
+         overriden_tools["ar"] = _find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools)
 +
 +    hosttools_dir = get_env_var(repository_ctx,"HOSTTOOLS_DIR", False)
 +    if hosttools_dir:
@@ -29,7 +29,7 @@  index 1b6aeb2..4a36685 100755
 +
      auto_configure_warning_maybe(repository_ctx, "CC used: " + str(cc))
      tool_paths = _get_tool_paths(repository_ctx, overriden_tools)
-     cc_toolchain_identifier = escape_string(get_env_var(
+ 
 -- 
-2.36.0
+2.49.0
 
diff --git a/recipes-devtools/bazel/files/0001-fix-compile-failure-on-gcc-13.patch b/recipes-devtools/bazel/files/0001-fix-compile-failure-on-gcc-13.patch
deleted file mode 100644
index 2fce1dc..0000000
--- a/recipes-devtools/bazel/files/0001-fix-compile-failure-on-gcc-13.patch
+++ /dev/null
@@ -1,71 +0,0 @@ 
-From 02fcd86787da1ebb2afad1909cb70839cdac24dc Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Wed, 13 Sep 2023 10:56:02 +0800
-Subject: [PATCH] fix compile failure on gcc 13
-
-external/com_google_absl/absl/strings/internal/str_format/extension.h:34:33: error: found ':' in nested-name-specifier, expected '::'
-   34 | enum class FormatConversionChar : uint8_t;
-
-Upstream-Status: Pending
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- distdir_deps.bzl                              |  4 +++
- .../0001-fix-compile-failure-on-gcc-13.patch  | 30 +++++++++++++++++++
- 2 files changed, 34 insertions(+)
- create mode 100644 third_party/com_google_absl/0001-fix-compile-failure-on-gcc-13.patch
-
-diff --git a/distdir_deps.bzl b/distdir_deps.bzl
-index 2ca988e..c460025 100755
---- a/distdir_deps.bzl
-+++ b/distdir_deps.bzl
-@@ -163,6 +163,10 @@ DIST_DEPS = {
-     },
-     "com_google_absl": {
-         "archive": "20211102.0.tar.gz",
-+        "patch_args": ["-p1"],
-+        "patches": [
-+            "//third_party:com_google_absl/0001-fix-compile-failure-on-gcc-13.patch",
-+        ],
-         "sha256": "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4",
-         "urls": [
-             "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz",
-diff --git a/third_party/com_google_absl/0001-fix-compile-failure-on-gcc-13.patch b/third_party/com_google_absl/0001-fix-compile-failure-on-gcc-13.patch
-new file mode 100644
-index 0000000..257e887
---- /dev/null
-+++ b/third_party/com_google_absl/0001-fix-compile-failure-on-gcc-13.patch
-@@ -0,0 +1,30 @@
-+From 4cb33b2e98fd0b2f201e765a5a0d9c1d4277041e Mon Sep 17 00:00:00 2001
-+From: Hongxu Jia <hongxu.jia@windriver.com>
-+Date: Wed, 13 Sep 2023 11:17:34 +0800
-+Subject: [PATCH] fix compile failure on gcc 13
-+
-+external/com_google_absl/absl/strings/internal/str_format/extension.h:34:33: error: found ':' in nested-name-specifier, expected '::'
-+   34 | enum class FormatConversionChar : uint8_t;
-+
-+Upstream-Status: Pending
-+
-+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-+---
-+ absl/strings/internal/str_format/extension.h | 1 +
-+ 1 file changed, 1 insertion(+)
-+
-+diff --git a/absl/strings/internal/str_format/extension.h b/absl/strings/internal/str_format/extension.h
-+index 55cbb56..67d4cc8 100644
-+--- a/absl/strings/internal/str_format/extension.h
-++++ b/absl/strings/internal/str_format/extension.h
-+@@ -21,6 +21,7 @@
-+ #include <cstddef>
-+ #include <cstring>
-+ #include <ostream>
-++#include <cstdint>
-+ 
-+ #include "absl/base/config.h"
-+ #include "absl/base/port.h"
-+-- 
-+2.17.1
-+
--- 
-2.27.0
-
diff --git a/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch b/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch
index eccc34a..5e0ac97 100644
--- a/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch
+++ b/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch
@@ -1,6 +1,6 @@ 
-From 23e2aff67a03127572641c7286e306c2a20990e2 Mon Sep 17 00:00:00 2001
+From c79e5132e313335dbeafe650c1c4e43e52a5508c Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 8 Dec 2020 11:05:13 +0800
+Date: Wed, 11 Mar 2026 01:41:58 -0700
 Subject: [PATCH] fix unzip: command not found
 
 If host does not provide unzip, build bazel will fail even though
@@ -11,19 +11,19 @@  The reason is var-PATH was not passed to bazel build in some cases.
 Remove hardcoded /bin and /usr/bin from PATH
 
 Upstream-Status: Inappropriate [wr-installer specific]
-
+Rebase to 7.7.0
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
  .../devtools/build/lib/bazel/rules/BazelRuleClassProvider.java  | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-index 16252df..e7cd609 100755
+index c039229731..287d71695a 100644
 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
 +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-@@ -469,7 +469,7 @@ public class BazelRuleClassProvider {
-       // Note that --action_env does not propagate to the host config, so it is not a viable
-       // workaround when a genrule is itself built in the host config (e.g. nested genrules). See
+@@ -568,7 +568,7 @@ public class BazelRuleClassProvider {
+       // Note that --action_env does not propagate to the exec config, so it is not a viable
+       // workaround when a genrule is itself built in the exec config (e.g. nested genrules). See
        // #8536.
 -      return "/bin:/usr/bin:/usr/local/bin";
 +      return System.getenv("PATH");
@@ -31,5 +31,5 @@  index 16252df..e7cd609 100755
  
      String newPath = "";
 -- 
-2.18.2
+2.49.0
 
diff --git a/recipes-devtools/bazel/files/1f2b3ed4ac717b814d02a0d125f160ddabe78003.patch b/recipes-devtools/bazel/files/1f2b3ed4ac717b814d02a0d125f160ddabe78003.patch
deleted file mode 100644
index 0d20e66..0000000
--- a/recipes-devtools/bazel/files/1f2b3ed4ac717b814d02a0d125f160ddabe78003.patch
+++ /dev/null
@@ -1,57 +0,0 @@ 
-From 1f2b3ed4ac717b814d02a0d125f160ddabe78003 Mon Sep 17 00:00:00 2001
-From: Yun Peng <pcloudy@google.com>
-Date: Wed, 5 Apr 2023 15:13:26 +0200
-Subject: [PATCH] Patch zlib to fix compatibility with latest Xcode
-
-Fixes https://github.com/bazelbuild/bazel/issues/17956
-
-Partial commit for third_party/*, see #17987.
-
-Closes #17987
-
-Signed-off-by: Yun Peng <pcloudy@google.com>
-
-Upstream-Status: Backport [https://github.com/bazelbuild/bazel/commit/1f2b3ed4ac717b814d02a0d125f160ddabe78003]
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- third_party/zlib/gzguts.h   |  4 ++++
- third_party/zlib/zlib.patch | 15 +++++++++++++++
- 2 files changed, 19 insertions(+)
- create mode 100644 third_party/zlib/zlib.patch
-
-diff --git a/third_party/zlib/gzguts.h b/third_party/zlib/gzguts.h
-index 57faf37165a354..54f668fcb20536 100644
---- a/third_party/zlib/gzguts.h
-+++ b/third_party/zlib/gzguts.h
-@@ -3,6 +3,10 @@
-  * For conditions of distribution and use, see copyright notice in zlib.h
-  */
-
-+#ifndef _WIN32
-+  #include <unistd.h>
-+#endif
-+
- #ifdef _LARGEFILE64_SOURCE
- #  ifndef _LARGEFILE_SOURCE
- #    define _LARGEFILE_SOURCE 1
-diff --git a/third_party/zlib/zlib.patch b/third_party/zlib/zlib.patch
-new file mode 100644
-index 00000000000000..7181d44aa9f9b1
---- /dev/null
-+++ b/third_party/zlib/zlib.patch
-@@ -0,0 +1,15 @@
-+diff --git a/third_party/zlib/gzguts.h b/third_party/zlib/gzguts.h
-+index 57faf37165..54f668fcb2 100644
-+--- a/third_party/zlib/gzguts.h
-++++ b/third_party/zlib/gzguts.h
-+@@ -3,6 +3,10 @@
-+  * For conditions of distribution and use, see copyright notice in zlib.h
-+  */
-+
-++#ifndef _WIN32
-++  #include <unistd.h>
-++#endif
-++
-+ #ifdef _LARGEFILE64_SOURCE
-+ #  ifndef _LARGEFILE_SOURCE
-+ #    define _LARGEFILE_SOURCE 1
diff --git a/recipes-devtools/bazel/files/include_stdint.patch b/recipes-devtools/bazel/files/include_stdint.patch
deleted file mode 100644
index 35c57c2..0000000
--- a/recipes-devtools/bazel/files/include_stdint.patch
+++ /dev/null
@@ -1,28 +0,0 @@ 
-https://github.com/lihaohong6/COPR/blob/bf48c5450a909cf8358e3cbd81cdde26df426e12/bazel7/include_stdint.patch
-
-Upstream-Status: Submitted [https://github.com/bazelbuild/bazel/issues/25514]
-
-diff --git a/src/main/cpp/archive_utils.h b/src/main/cpp/archive_utils.h
-index 18856ab..5298a36 100644
---- a/src/main/cpp/archive_utils.h
-+++ b/src/main/cpp/archive_utils.h
-@@ -15,6 +15,7 @@
- #ifndef BAZEL_SRC_MAIN_CPP_ARCHIVE_UTILS_H_
- #define BAZEL_SRC_MAIN_CPP_ARCHIVE_UTILS_H_
-
-+#include <cstdint>
- #include <string>
- #include <vector>
-
-diff --git a/src/main/cpp/util/logging.h b/src/main/cpp/util/logging.h
-index b2cd459..7bf5a00 100644
---- a/src/main/cpp/util/logging.h
-+++ b/src/main/cpp/util/logging.h
-@@ -14,6 +14,7 @@
- #ifndef BAZEL_SRC_MAIN_CPP_LOGGING_H_
- #define BAZEL_SRC_MAIN_CPP_LOGGING_H_
-
-+#include <cstdint>
- #include <memory>
- #include <sstream>
- #include <string>