21 lines
1.1 KiB
Diff
21 lines
1.1 KiB
Diff
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java 2020-05-25 14:46:01.608403087 +0200
|
|
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java 2020-05-25 14:50:52.881398320 +0200
|
|
@@ -238,14 +238,15 @@
|
|
// TODO(#8685): Remove this special-case handling as part of making the proper shebang a
|
|
// property of the Python toolchain configuration.
|
|
String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python";
|
|
+ String pythonShebang = "#!/usr/bin/env " + pythonExecutableName;
|
|
ruleContext.registerAction(
|
|
new SpawnAction.Builder()
|
|
.addInput(zipFile)
|
|
.addOutput(executable)
|
|
.setShellCommand(
|
|
shExecutable,
|
|
- "echo '#!/usr/bin/env "
|
|
- + pythonExecutableName
|
|
+ "echo '"
|
|
+ + pythonShebang
|
|
+ "' | cat - "
|
|
+ zipFile.getExecPathString()
|
|
+ " > "
|