aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/bazel/bazel-native_0.21.0.bb5
-rw-r--r--recipes-devtools/bazel/files/0001-python3.patch47
2 files changed, 50 insertions, 2 deletions
diff --git a/recipes-devtools/bazel/bazel-native_0.21.0.bb b/recipes-devtools/bazel/bazel-native_0.21.0.bb
index 60131ca..5a2d0ad 100644
--- a/recipes-devtools/bazel/bazel-native_0.21.0.bb
+++ b/recipes-devtools/bazel/bazel-native_0.21.0.bb
@@ -9,9 +9,10 @@ SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${P
file://0001-HttpDownloader-save-download-tarball-to-distdir.patch \
file://0001-Rename-gettid-functions.patch \
file://0001-fix-unzip-command-not-found.patch \
+ file://0001-python3.patch \
"
-inherit native pythonnative
+inherit native python3native
INHIBIT_SYSROOT_STRIP = "1"
@@ -27,7 +28,7 @@ do_compile () {
export JAVA_HOME="${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native"
TMPDIR="${TOPDIR}/bazel" \
VERBOSE=yes \
- EXTRA_BAZEL_ARGS="--distdir=${TS_DL_DIR}" \
+ EXTRA_BAZEL_ARGS="--distdir=${TS_DL_DIR} --python_path=python3" \
./compile.sh
}
diff --git a/recipes-devtools/bazel/files/0001-python3.patch b/recipes-devtools/bazel/files/0001-python3.patch
new file mode 100644
index 0000000..50eaaf4
--- /dev/null
+++ b/recipes-devtools/bazel/files/0001-python3.patch
@@ -0,0 +1,47 @@
+From f3dcad42a53e78efdb87adbc98121dc66b53ec5f Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sun, 5 Apr 2020 23:40:31 +0800
+Subject: [PATCH] set python3 interpreter
+
+Since many distrobution choose python3, and drop python2,
+If host does not provides `python', python rules failed
+...
+/usr/bin/env: 'python': No such file or directory
+...
+
+set python3 interpreter to shebang
+
+Upstream-Status: Inappropriate [wr-installer specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ .../build/lib/bazel/rules/python/BazelPythonSemantics.java | 2 +-
+ .../build/lib/bazel/rules/python/python_stub_template.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+index 0ff5d15..997cfc9 100755
+--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+@@ -185,7 +185,7 @@ public class BazelPythonSemantics implements PythonSemantics {
+ .addOutput(executable)
+ .setShellCommand(
+ shExecutable,
+- "echo '#!/usr/bin/env python' | cat - "
++ "echo '#!/usr/bin/env python3' | cat - "
+ + zipFile.getExecPathString()
+ + " > "
+ + executable.getExecPathString())
+diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
+index 129ce90..959e3a5 100755
+--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ import os
+ import re
+--
+2.17.1
+