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

Re: bash exorcism experiment ('bug' 762923 & 763012)



Russell Stuart <ras@debian.org> writes:

> IMO, if Debian has decided the in the default case /bin/sh ==> dash,
> then the policy should say "#!/bin/sh scripts" must work with dash.  It
> then becomes trivial for Developers to test their code conforms with
> policy.

Up until dash changes, and then you have absolutely no idea what to do
with that sort of policy.  There's a reason why no standards document I've
ever seen says something like this.  The ISO C standard isn't going to say
that anything that compiles with gcc is valid code.

Policy already says that testing the script with dash is a good indicator
that it may be okay, and at least is free of bashisms, which is about as
strong of a statement that you can make.

> If we allow /bin/sh to be linked to other shells, policy should say
> those shells must implement all the features /bin/dash implements so
> that any script that works with dash must also work with them.

Ugh, no.  That's a possibly unbounded future set.

Instead, we started with POSIX and then added the absolute minimum of
features on top of what POSIX required that we decided we really could not
live without.  I think that's a reasonable approach, and it means that
multiple shell authors can make their shells follow the Policy
requirements and work properly with scripts in Debian.  And script authors
in Debian can check the POSIX documentation plus the list of features in
Policy and have a pretty solid idea of what is allowed.

And we *do* have checkbashisms as a way to test.  It's not perfect, but
it's not nothing.  You can also test with posh.

> If Debian really wants to implement the policy as described, then it
> should do the work required to produce robust software that conforms
> with it.  In this case that would mean producing a shell that behaves as
> described, which we make /bin/sh by default.

Being pedantic is not the only, or even the main, goal of our /bin/sh.
Performance, for example, is also quite important.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: