From 558c772b639a29719c2c81428d9ebe1ba03d419b Mon Sep 17 00:00:00 2001 From: Vincent Thiberville Date: Tue, 20 Jun 2023 08:13:46 -0700 Subject: [PATCH] fix: add shebang in python interpreter (#1336) This fixes cases where the interpreter cannot be executed, as there is no indication about how to execute it. Fixes #1212 Closes #1336 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/upb/pull/1336 from vthib:1212-python-interpreter-shebang 956482d9665c15f4781b16d7fa3da45a6615aa54 PiperOrigin-RevId: 541927182 --- bazel/system_python.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/system_python.bzl b/bazel/system_python.bzl index 5cb34d5ffd..43fa59b646 100644 --- a/bazel/system_python.bzl +++ b/bazel/system_python.bzl @@ -205,7 +205,7 @@ def _populate_package(ctx, path, python3, python_version): support = "Supported" if supported else "Unsupported", ) - ctx.file("interpreter", "exec {} \"$@\"".format(python3)) + ctx.file("interpreter", "#!/bin/sh\nexec {} \"$@\"".format(python3)) ctx.file("BUILD.bazel", build_file) ctx.file("version.bzl", "SYSTEM_PYTHON_VERSION = '{}{}'".format(python_version[0], python_version[1])) ctx.file("register.bzl", _register.format(ctx.attr.name))