diff options
Diffstat (limited to 'recipes-devtools/bazel/files')
-rw-r--r-- | recipes-devtools/bazel/files/0001-python3.patch | 47 |
1 files changed, 47 insertions, 0 deletions
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 + |