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
diff --git a/bazel/system_python.bzl b/bazel/system_python.bzl
index 5cb34d5..43fa59b 100644
--- a/bazel/system_python.bzl
+++ b/bazel/system_python.bzl
@@ -205,7 +205,7 @@
         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))