-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Revert #!/bin/sh to #!/usr/bin/sh change #640
Comments
See also this discussion which has links for the POSIX takes on the issue and the mandatory mention of using /usr/bin/env (which has its own set of problems such as location of 'env' and people who might have a different 'sh' in their path, accidentally, maliciously, or otherwise): https://news.ycombinator.com/item?id=17069408 One take from that discussion is to just not have a shebang line at all which seems to be the most POSIX compliant solution [1] - POSIX seems to be standoff-ish regarding shebangs. I don't know if that would break on any real world systems, but it works on FreeBSD and Linux. Until I see a survey of how real world systems treat the "no shebang" case, I am not recommending that course of action. I still feel /bin/sh is the best choice (certainly better than /usr/bin/sh). [1] https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html |
Personal i don't mind because i am able to build pluma for fedora with a patch ;) |
After some reading I agree that this commit should be reverted. |
Agreed As for reverting, the mentioned commit has 3 parts:
|
Of the bourne shell scripts touched by the commit, the only script that I saw with bashisms is search-recursive (as checked by 'checkbashisms'). I would use '#!/usr/bin/env bash' for that one (or allow 'configure' to accept the path to the system location for bash) or write it more portably. By the way, the downstream FreeBSD bug report is bug 258928 |
Agree, feel free to do it....... |
fixed by #654 |
In this commit, it was claimed that changing #!/bin/sh to #!/usr/bin/sh was done to "fix shebangs":
9a99c3c
POSIX does not necessarily specify /bin/sh as THE location for the system's standard shell (I think it allows for it to be in different locations [1]), however it is FAR more common for the standard location to be /bin/sh.
This change breaks FreeBSD and many other systems (probably most all non-linux systems). [Note: this was noticed now because FreeBSD just updated its pluma port which pulled in this change from 6 months ago]
Can the packager "fix" this to accommodate its location of the standard POSIX shell? Yes, but I think the fedora script to "mangle" this shebang to use /usr/bin/sh is a poor choice for real world cross-platform compatibility. I also don't see many (any?) projects heeding this ill-advised (my opinion) change.
It certainly is not POSIX to have /bin and /usr/bin to be the same, so in short, this will break lots of systems that do not follow that practice.
While this change (/bin/sh -> /usr/bin/sh) MAY not merit a "bug" moniker, I feel this part of the change should be reverted as it does not reflect de facto practice.
[1] https://unix.stackexchange.com/questions/416725/does-sh-have-to-be-in-the-bin-directory
Originally posted by @jhgit in #626 (comment)
The text was updated successfully, but these errors were encountered: