From owner-freebsd-arch@freebsd.org Sat Jan 26 12:00:51 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1071414C048F for ; Sat, 26 Jan 2019 12:00:51 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 9936A76DD6 for ; Sat, 26 Jan 2019 12:00:50 +0000 (UTC) (envelope-from se@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 5D05914C048A; Sat, 26 Jan 2019 12:00:50 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 225FE14C0488 for ; Sat, 26 Jan 2019 12:00:50 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF3EC76DD0; Sat, 26 Jan 2019 12:00:49 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-402.fritz.box (p200300CD5F0A55008906AEA9084EF296.dip0.t-ipconnect.de [IPv6:2003:cd:5f0a:5500:8906:aea9:84e:f296]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2FF3310E79; Sat, 26 Jan 2019 12:00:49 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Deficiencies compared to /bin/sh To: arch@freebsd.org References: <20190125165751.kpcjjncmf7j7maxd@ivaldir.net> <201901251936.x0PJaepi089796@pdx.rh.CN85.dnsmgr.net> <20190125210833.ltnvsxbnlkc6njaw@ivaldir.net> <20190126102238.3b5e0a80@ernst.home> From: Stefan Esser Openpgp: preference=signencrypt Autocrypt: addr=se@freebsd.org; prefer-encrypt=mutual; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Cc: gljennjohn@gmail.com Message-ID: <2b7adc50-e423-b36e-6f08-a30c69e3f189@freebsd.org> Date: Sat, 26 Jan 2019 13:00:48 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190126102238.3b5e0a80@ernst.home> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BF3EC76DD0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 12:00:51 -0000 Am 26.01.19 um 10:22 schrieb Gary Jennejohn: > On Fri, 25 Jan 2019 22:08:33 +0100 > Baptiste Daroussin wrote: > >> On Fri, Jan 25, 2019 at 11:36:40AM -0800, Rodney W. Grimes wrote: >>>> Hi everyone, >>>> >>>> I would like to import mksh in base, https://www.mirbsd.org/mksh.htm >>>> And make it the default root shell (not necessary in one step) >>>> >>>> Why: >>>> 1/ it is tiny 400k (in the packaged version) all other shells fitting the >>>> expectation are bigger >>> It is more than twice the size of our current /bin/sh, and giving up >>> 200k on the nano/tiny/wifi BSD is hard to justify. 400k is near the >>> size of tcsh. >>> >> To be fair here: >> mksh is 331k on my amd64 machine >> /bin/sh is 165k >> >> mksh only depends on libc >> /bin/sh depends on libc + libedit which adds an additional 231k to the battle. >> >> If now we are comparing to the actual root shell: >> csh is 419k on the same machine and it depends on libncursesw and libcrypt >> > > How large is a statically linked mksh? /rescue/sh is 8.5MB. > Amazingly, that's four times larger than a statically linked > bash. > > If mksh is supposed to be the default, then it might make sense > to have a statically linked binary under /rescue. While I'd appreciate a more feature rich shell in base, I do not think that mksh is a good choice. It even lacks features that have been in our /bin/sh for quite a long time (e.g. 64 bit arithmetics) and diverges from all other shells in non-obvious ways (e.g. shell functions behave differently dependent on whether they are defined as "fn ()" or "function fn"). Unicode handling is also "special" and there are a number of features for which the man page announces planned behavioral changes that are planned for future versions and which will introduce semantic changes that might break shell scripts. There is also no support for associative arrays and the syntax for variable expansion differs in details from other shells (not that relevant for an interactive shell, but I'd really like to have a shell in base with support for associative arrays, if we consider adding one beyond sh and tcsh ...). All these details make it less suited for running shell scripts, and even if the suggestion is to make mksh the default interactive root shell, it will probably be used for scripting, since it offers at least numerically indexed arrays (albeit not fully compatible with e.g. bash). An import of ksh93 would not suffer from these problems, but ksh93 is a much larger shell and not supported on all relevant architectures (broken on aarch64 due to lack of sbrk() according to the port ...). I'd think that such issues should be resolved before any new shell is considered for integration in base ... Regards, STefan