Received: from mx1.mailbun.net (unknown [170.39.20.100]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 8F66A782C0C for <~alpine/devel@lists.alpinelinux.org>; Tue, 6 Apr 2021 18:17:36 +0000 (UTC) Received: from nanabozho.lan (unknown [107.125.25.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ariadne@dereferenced.org) by mx1.mailbun.net (Postfix) with ESMTPSA id CD9DD144D11 for <~alpine/devel@lists.alpinelinux.org>; Tue, 6 Apr 2021 18:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dereferenced.org; s=mailbun; t=1617733052; bh=BkzEkXZu2B5Pc0sUTascpwIbqPGTV+6uraq4VL3ktow=; h=Date:From:To:Subject; b=QmyRFsRtheSmUPABUgxua2nW1Oh+RM0L4ssulAVI5yLdem1MleEqhCs1KGMUwUmDi 3ASH5HT+CGSHx9p1sU7IzUK5I/YVvT4Nzm8NtSRWdW/qrtYMm7pknOxWCethexfrrm ix5gk7IJw4tNd/MIXAbITAIfKDvLrThJxwuHVzrZLUJE0PcxZwxazOoyn3DrlRVJjn +kBMDY4y4Yw2F7UyP3HSJX0HV5445l+f56/HJyJNxDx2is1Kk92o6tw+6vCeMXsGqn w62u+gkx07BgPrSedl2VloCKCCfgtWgoqxgnC4cEIBDHU+gJE6bgdlb4f7Ulq8Nq4I zWM8vUxMOtoRg== Date: Tue, 6 Apr 2021 12:17:33 -0600 (MDT) From: Ariadne Conill To: ~alpine/devel@lists.alpinelinux.org Subject: [3.15] System change proposal: Use netbsd-curses instead of GNU ncurses Message-ID: MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Hello, This proposal is largely centered around normalizing our package set with other musl distributions, such as Sabotage and Adelie, which already ship netbsd-curses in favor of GNU ncurses. ## GNU ncurses vs netbsd-curses * GNU ncurses is presently the standard curses library on Linux systems. Some applications may access private mechanisms inside the curses implementation and need patching. * Both libraries implement the POSIX curses API. This means, 99% of applications won't need patching and should be basically compatible. * ncurses ships a huge terminfo database. Ncurses presently ships a database which takes 7MiB on disk. We split this into `ncurses-terminfo` and `ncurses-terminfo-base` to reduce the installed size to only 216KiB by default. netbsd-curses precompiles the terminfo database into a small CDB format database. * ncurses is large. At present, we try to avoid using curses support in programs which optionally use it, because ncurses is a heavy dependency (ncurses-libs is 500KiB, plus the 216KiB base terminfo database, plus 284KiB for tools). netbsd-curses is only 1.3MiB on disk for everything and can be split in the same way to reduce size. * GNU ncurses code quality is lacking. GNU ncurses is littered with macros and other layers of preprocessing. This makes it hard to understand the source code, which makes hotfixing security vulnerabilities a potential challenge. netbsd-curses is written in straightforward C89/C99, one of the preferred languages for tools and base system components in Alpine. It is much easier to hack on than GNU ncurses. Simpler code also makes for more portable code in general. ## Benefits to Alpine Alpine benefits from switching to a curses implementation that is actively developed on musl systems, in addition to the other benefits outlined above. ## Contingency Plan We will do an experimental rebuild with netbsd-curses-dev providing ncurses-dev. If this goes well, then we will switch to netbsd-curses. If there is a problem, then we will try to fix netbsd-curses first, failing that, we will revert back to GNU ncurses. Ariadne