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
pull/13171/head
Vincent Thiberville 1 year ago committed by Copybara-Service
parent f12a727c3d
commit 558c772b63
  1. 2
      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))

Loading…
Cancel
Save