Skip to content

Commit

Permalink
Add bash to #! line for python wrapper in nixpkgs
Browse files Browse the repository at this point in the history
Replicate NixOS/nixpkgs#93757 for Bazel generated script.

Fixes #186
  • Loading branch information
YorikSar committed Feb 21, 2022
1 parent de066d5 commit 4b6291b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,9 @@ _nixpkgs_python_toolchain = repository_rule(

def _python_nix_file_content(attribute_path, bin_path, version):
if versions.is_at_least("4.2.0", versions.get()):
stub_shebang = """stub_shebang = "#!${{{attribute_path}}}/{bin_path}",""".format(
# Include bash path to the shebang to avoid problems on macOS
# see https://github.com/NixOS/nixpkgs/pull/93757
stub_shebang = """stub_shebang = "#!${{({attribute_path}).stdenv.shell}} ${{{attribute_path}}}/{bin_path}",""".format(
attribute_path = attribute_path,
bin_path = bin_path,
)
Expand Down

0 comments on commit 4b6291b

Please sign in to comment.