8000 Shebang Update for Compatibility Across RHEL Versions by shi-vaniparmar · Pull Request #870 · openmainframeproject/feilong · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Shebang Update for Compatibility Across RHEL Versions #870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shi-vaniparmar
Copy link
@shi-vaniparmar shi-vaniparmar commented May 27, 2025

This PR updates Python shebangs from:

#!/usr/bin/python
to:
#!/usr/bin/env python
Reason for Change
On RHEL 8 and RHEL 9, it is not permitted (and not recommended) to modify or symlink the platform-provided /usr/bin/python. This path is managed by the system and reserved for platform tooling.

To ensure consistent and portable execution of Python scripts across environments — without interfering with system Python — we:

  • Use /usr/bin/env python as a more flexible and version-agnostic shebang.

  • Recommend setting up custom Python symlinks in:

    • /usr/local/bin

    • ~/bin

This allows each environment to control which Python interpreter is used when invoking python, without relying on or modifying the system Python binary.

Benefits

  • Cross-version compatibility (RHEL 8/9)

  • Cleaner separation from platform Python

  • Easier integration with virtual environments or user-installed interpreters

Signed-off-by: Shivani Parmar <shivaniparmar2494@gmail.com>
@Bischoff
Copy link
Contributor
Bischoff commented May 27, 2025

Thanks for the PR @shi-vaniparmar .

On Ubuntu, I see this as the shebang, in the installed files (like /usr/bin/zvmsdk-getpchid):

#!/usr/bin/python3

and not

#!/usr/bin/python

as I can see in the source code.

I think that the shebang line gets modified by the "debian helper":

%: 
       dh $@ --with python3 --buildsystem=pybuild

I am not sure how this helper will behave with your changed shebang. I think it will just not care, but to be on the safe side, in theory, we should try to repackage the Ubuntu version with your change...

@Bischoff
Copy link
Contributor
Bischoff commented May 27, 2025

Also:

scripts/zvmsdk-gentoken uses #!/bin/python as shebang.

Maybe it would need to be modified as well.

Copy link
Contributor
@Bischoff Bischoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my 2 suggestions:

  • check that ubuntu packaging still works after shebang change
  • modify one more file in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0