Skip to contentSkip to conversation

bazel: fix typo in .patch file

PATCH In review [email protected] 2 participants 4 messages Apr 2 – Apr 3

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 bazel: fix typo in .patch file

From: Martin Jansa <[email protected]>

---
 recipes-devtools/bazel/bazel-native_7.7.0.bb                    | 2 +-
 ...o.patch => 0001-customize-native-toolchains-for-Yocto.patch} | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename recipes-devtools/bazel/files/{0001-cutsomize-native-toolchains-for-Yocto.patch => 0001-customize-native-toolchains-for-Yocto.patch} (95%)
recipes-devtools/bazel/bazel-native_7.7.0.bb +1 -1
index 76c3983..5fcd55a 100644
@@ -8,7 +8,7 @@ SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${P
            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-customize-native-toolchains-for-Yocto.patch \
 "
 
 UPSTREAM_CHECK_URI = "https://github.com/bazelbuild/bazel/releases/"
recipes-devtools/bazel/files/0001-customize-native-toolchains-for-Yocto.patch renamed from recipes-devtools/bazel/files/0001-cutsomize-native-toolchains-for-Yocto.patch +1 -1
similarity index 95%
rename from recipes-devtools/bazel/files/0001-cutsomize-native-toolchains-for-Yocto.patch
rename to recipes-devtools/bazel/files/0001-customize-native-toolchains-for-Yocto.patch
index 5de56dd..3f5fce5 100644
@@ -1,7 +1,7 @@
 From f0c6f3420acdbfd22e06603ca3bbeae3e7d98fc2 Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <[email protected]>
 Date: Wed, 11 Mar 2026 01:48:31 -0700
-Subject: [PATCH] cutsomize native toolchains for Yocto
+Subject: [PATCH] customize native toolchains for Yocto
 
 Yocto use environment HOSTTOOLS_DIR to provide native toolchains,
 explicitly set it rather than detect
#1 lore raw

PATCH 2/3 bazel: disable color in bazel output

From: Martin Jansa <[email protected]>

Doesn't interact well with the log files stored for bitbake tasks

---
 classes/bazel.bbclass                        | 2 ++
 recipes-devtools/bazel/bazel-native_7.7.0.bb | 1 +
 2 files changed, 3 insertions(+)
classes/bazel.bbclass +2 -0
index 3d5e7b3..43e2c9c 100644
@@ -113,6 +113,8 @@ build --python_path=python3
 fetch --distdir=${TS_DL_DIR}
 build --distdir=${TS_DL_DIR}
 
+build --color=no
+
 ${@bazel_get_flags(d)}
 
 EOF
recipes-devtools/bazel/bazel-native_7.7.0.bb +1 -0
index 5fcd55a..042f456 100644
@@ -33,6 +33,7 @@ EXTRA_BAZEL_ARGS = " \
     --tool_java_runtime_version=local_jdk \
     --python_path=python3 \
     --distdir=${TS_DL_DIR} \
+    --color=no \
     ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--jobs=${BAZEL_JOBS}", d )} \
     ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--local_cpu_resources=${BAZEL_JOBS}", d )} \
     ${@oe.utils.conditional("BAZEL_MEM", "", "", "--local_ram_resources=${BAZEL_MEM}", d )} \
#2 lore raw

PATCH 3/3 bazel: update the arguments for local resources

In reply to [email protected]

From: Martin Jansa <[email protected]>

Fixes:
WARNING: Option 'local_cpu_resources' is deprecated: --local_cpu_resources is deprecated, please use --local_resources=cpu= instead.
WARNING: Option 'local_ram_resources' is deprecated: --local_ram_resources is deprecated, please use --local_resources=memory= instead.

---
 classes/bazel.bbclass                        | 4 ++--
 recipes-devtools/bazel/bazel-native_7.7.0.bb | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
classes/bazel.bbclass +2 -2
index 43e2c9c..085eff1 100644
@@ -85,11 +85,11 @@ def bazel_get_flags(d):
 
     if d.getVar("BAZEL_JOBS"):
         flags += "# From BAZEL_JOBS\n"
-        flags += "build --jobs=%s --local_cpu_resources=%s\n" % (d.getVar("BAZEL_JOBS"), d.getVar("BAZEL_JOBS"))
+        flags += "build --jobs=%s --local_resources=cpu=%s\n" % (d.getVar("BAZEL_JOBS"), d.getVar("BAZEL_JOBS"))
 
     if d.getVar("BAZEL_MEM"):
         flags += "# From BAZEL_MEM\n"
-        flags += "build --local_ram_resources=%s\n" % (d.getVar("BAZEL_MEM"))
+        flags += "build --local_resources=memory=%s\n" % (d.getVar("BAZEL_MEM"))
 
     return flags
 
recipes-devtools/bazel/bazel-native_7.7.0.bb +2 -2
index 042f456..3b81be5 100644
@@ -35,8 +35,8 @@ EXTRA_BAZEL_ARGS = " \
     --distdir=${TS_DL_DIR} \
     --color=no \
     ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--jobs=${BAZEL_JOBS}", d )} \
-    ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--local_cpu_resources=${BAZEL_JOBS}", d )} \
-    ${@oe.utils.conditional("BAZEL_MEM", "", "", "--local_ram_resources=${BAZEL_MEM}", d )} \
+    ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--local_resources=cpu=${BAZEL_JOBS}", d )} \
+    ${@oe.utils.conditional("BAZEL_MEM", "", "", "--local_resources=memory=${BAZEL_MEM}", d )} \
 "
 
 do_compile[network] = "1"
#3 lore raw

Re: [meta-tensorflow][PATCH 3/3] bazel: update the arguments for local resources

Thanks for your contribution, merged

//Hongxu

Quoted 48 lines · On 4/2/26 08:16, [email protected] wrote:

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

From: Martin Jansa <[email protected]>

Fixes:
WARNING: Option 'local_cpu_resources' is deprecated: --local_cpu_resources is deprecated, please use --local_resources=cpu= instead.
WARNING: Option 'local_ram_resources' is deprecated: --local_ram_resources is deprecated, please use --local_resources=memory= instead.

---
  classes/bazel.bbclass                        | 4 ++--
  recipes-devtools/bazel/bazel-native_7.7.0.bb | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
classes/bazel.bbclass +2 -2
index 43e2c9c..085eff1 100644
@@ -85,11 +85,11 @@ def bazel_get_flags(d):
 
      if d.getVar("BAZEL_JOBS"):
          flags += "# From BAZEL_JOBS\n"
-        flags += "build --jobs=%s --local_cpu_resources=%s\n" % (d.getVar("BAZEL_JOBS"), d.getVar("BAZEL_JOBS"))
+        flags += "build --jobs=%s --local_resources=cpu=%s\n" % (d.getVar("BAZEL_JOBS"), d.getVar("BAZEL_JOBS"))
 
      if d.getVar("BAZEL_MEM"):
          flags += "# From BAZEL_MEM\n"
-        flags += "build --local_ram_resources=%s\n" % (d.getVar("BAZEL_MEM"))
+        flags += "build --local_resources=memory=%s\n" % (d.getVar("BAZEL_MEM"))
 
      return flags
 
recipes-devtools/bazel/bazel-native_7.7.0.bb +2 -2
index 042f456..3b81be5 100644
@@ -35,8 +35,8 @@ EXTRA_BAZEL_ARGS = " \
      --distdir=${TS_DL_DIR} \
      --color=no \
      ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--jobs=${BAZEL_JOBS}", d )} \
-    ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--local_cpu_resources=${BAZEL_JOBS}", d )} \
-    ${@oe.utils.conditional("BAZEL_MEM", "", "", "--local_ram_resources=${BAZEL_MEM}", d )} \
+    ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--local_resources=cpu=${BAZEL_JOBS}", d )} \
+    ${@oe.utils.conditional("BAZEL_MEM", "", "", "--local_resources=memory=${BAZEL_MEM}", d )} \
  "
 
  do_compile[network] = "1"