tech-pkg archive

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

Re: Implement dash as bootstrap shell



* On 2015-12-05 at 11:42 GMT, Richard PALO wrote:

> Not a dash user, I notice on https://wiki.ubuntu.com/DashAsBinSh the following mention:
> > declare or typeset
> > 
> > The 'declare' or 'typeset' warning from the checkbashisms script.
> > 
> > The declare or typeset builtins in bash (they are exact synonyms) permit restricting the properties of variables. For example, you can declare a variable to be an integer type variable by using -i.
> > 
> > Both 'declare' and 'typeset' are not supported in dash. When changing from using declare/typeset, you normally could switch declare/typeset with local and continue as before. 
> ...
> > $LINENO
> > 
> > POSIX requires that conforming shells expand the special parameter $LINENO to the current line number in a script or function; dash does not yet support this feature.
> ...
> > `dash` doesn't expand `~` on path search
> > 
> > This means that if you have ~/bin in the PATH environment variable, bash finds commands located in ~/bin, while dash doesn't.
> > 
> 
> Are these still the case and will going to dash therefore complicate debugging scripts?
> 
> Most of the shells used today support 'typeset' but not necessarily 'local'... dash seems to support only the latter and not the former.
> 
> Can they be 'fixed' prior to switching?

dash only supports strict POSIX features, which is exactly what we
target in our infrastructure.  If any "debugging scripts" (I'm not
exactly sure what you mean here) are using non-POSIX constructs then
they should be fixed.

To be clear, the bootstrap shell is used for bmake's SHELL and for
e.g. running ./configure.  For anything more advanced, the usual
dependency mechanisms (e.g. USE_TOOLS+=bash:run) should be used.  As
shown in my bulk build, there are very very few configure scripts now
(no doubt thanks to Debian moving to dash as /bin/sh) that fail with
dash.

FWIW, $LINENO is now supported.

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index