diff options
| author | Oleg Titov <oleg.titov@gmail.com> | 2019-05-12 14:22:35 -0500 |
|---|---|---|
| committer | Rasmus Thomsen <oss@cogitri.dev> | 2019-12-30 17:49:54 +0100 |
| commit | a47e956de4896ec3ee053ddbc144568444ac35a0 (patch) | |
| tree | cb442bbafc503d4c3b186ee2477276dcfc4347df /testing/bazel/python3.patch | |
| parent | 1d2aa57717d54e74db0787fa44d83685c88b7079 (diff) | |
| download | aports-a47e956de4896ec3ee053ddbc144568444ac35a0.tar.bz2 aports-a47e956de4896ec3ee053ddbc144568444ac35a0.tar.xz | |
testing/bazel: new aport
https://bazel.build
A fast, scalable, multi-language and extensible build system
Diffstat (limited to 'testing/bazel/python3.patch')
| -rw-r--r-- | testing/bazel/python3.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/bazel/python3.patch b/testing/bazel/python3.patch new file mode 100644 index 0000000000..e427ba83ad --- /dev/null +++ b/testing/bazel/python3.patch @@ -0,0 +1,36 @@ +Some scripts rely on /usr/bin/pyhton. + +python2 package provides /usr/bin/python as a link to /usr/bin/python2 +so there is no any issue here, but we do not want python2. + +python3 package do not provide /usr/bin/python, only /usr/bin/python3. + +To make things work we need to change shebang '#!/usr/bin/env python' to +'#!/usr/bin/env python3'. + +This is a longstanding issue, one of the first traces to it could be seen +here [1] and here [2]. + +[1] https://github.com/bazelbuild/bazel/issues/544 +[2] https://github.com/bazelbuild/bazel/issues/8446 + + +--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt.orig ++++ 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 + + from __future__ import absolute_import + from __future__ import division +--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java.orig ++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java +@@ -241,7 +241,7 @@ + .addOutput(executable) + .setShellCommand( + shExecutable, +- "echo '#!/usr/bin/env python' | cat - " ++ "echo '#!/usr/bin/env python3' | cat - " + + zipFile.getExecPathString() + + " > " + + executable.getExecPathString()) |
