Re: More than 10% of all Fedora spec files are not POSIX sh compliant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 22, 2019 at 6:04 PM Japheth Cleaver <cleaver@xxxxxxxxxxxxxx> wrote:
>
> On 3/21/2019 3:23 PM, Richard W.M. Jones wrote:
>
>
> So what?  On Fedora /bin/sh is bash, and bash is a fine shell.
>
> All this nonsense of using dash for /bin/sh on Debian is IMO a
> pointless bunch of make-work.
>
> Fedora has certainly made a lot of make-work projects over the last decade, under arguably more questionable reasoning.
>
> IMO the situation that we're in now ("Assume you're running in bash, but called as -/bin/sh") is a worst-of-both-worlds middle ground, somewhat akin to mandating webpages be written in IE Quirks Mode for all time. It's neither pedantically correct, nor flexible for users and downstreams. And the resolution from all of this last time remains lacking in the guarantees that an independent spec should have:

The result is what we call bashisms where people put /bin/sh in their
shebangs but don't realize they are using GNU extensions, and that
goes for "standard" programs like awk too where people are not aware
of the differences regarding what's on their machine and what POSIX
mandates.

So with both a default non-POSIX-compliant shell (by default, I'm
aware) and non-POSIX-compliant options to the basic commands it takes
more effort to write portable shell.

To be clear, bash is my favorite shell and the one I use, but I'd prefer that
running it as sh or /bin/sh would be enough to enter POSIX mode.

> http://web.archive.org/web/20150821020837/http://rpm.org/ticket/877
> https://pagure.io/packaging-committee/issue/184
> https://bugzilla.redhat.com/show_bug.cgi?id=850706
> via https://lists.fedoraproject.org/pipermail/devel/2014-October/202998.html
>
> RPM should IMHO indicate scriptlets are to be written in Bourne shell, give a 'SHOULD'-level recommendation for POSIX-correctness, and provide a mechanism for distros to override that default. And If Fedora's packaging guidelines are going to continue to state that bashisms are completely OK, then it should use that override mechanism to set the shell to "/bin/bash" explicitly.

Maybe there is a macro like %_buildshell that should explicitly refer
to /usr/bin/bash when the default scriplet interpreter is used.

At this point trying to make dash own /bin/sh would be downright
impossible within the lifespan of a Fedora release (maybe the extended
development time for f31 could, but it was already allocated for
something else).

My 2 cents...


Dridi
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux