Received: from mx1.tetrasec.net (mx1.tetrasec.net [66.245.176.36]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 40844782D1F for <~alpine/devel@lists.alpinelinux.org>; Tue, 19 Jan 2021 20:27:41 +0000 (UTC) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 8E59218046F; Tue, 19 Jan 2021 20:27:40 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: alpine@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id D8D7018046E; Tue, 19 Jan 2021 20:27:39 +0000 (UTC) Date: Tue, 19 Jan 2021 21:27:33 +0100 From: Natanael Copa To: maxice8 Cc: ~alpine/devel@lists.alpinelinux.org Subject: Re: RFC on -static subpackages and being more static-linking friendly Message-ID: <20210119212733.11bcc69b@ncopa-desktop.lan> In-Reply-To: References: X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-alpine-linux-musl) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 16 Jan 2021 03:28:08 -0300 maxice8 wrote: > Hello > > Our current -static packages were rushed in without much testing and > prototyping and are suboptimal. > > First, abuild has no automatic dependency tracking like -dev has by > tracking the 'Requires:' field from pkg-config and handling solinks. > > This means that every -static subpackage which requires another package > to link will fail to link. > > As an example: I faced it with libgit2 while working on 'agl', > installing libgit2-static wasn't enough I had to install openssl-libs- > static, http-parser-static, etc separately while they should be > installed all at once when I requested libgit2-static. > > Considering Alpine Linux uses a very static-linking friendly musl and > statically linking is actually feasible and done in some places (apk- > tools-static, busybox-static) I think it is important that doing it > actually works seamlessly for the user (and us). My thinking is that we don't really support static linking for our own packages. We should always use dynamic linking, with a few exceptions. (like qemu user). But we can provide -static when requested and it does not cost us much. > Second, the size reduction is minimal for the -dev package, and -dev > packages aren't really expected to be small. > > Third, the benefit of avoiding accidental linking has materialized (at > least for me) only once when upgrading the skarnet suite of tools. > > While it is a nice benefit it doesn't happen often enough or is not > apparent enough when maintaing packages in aports. > > My proposals are: > > 1. Remove -static subpackages and move the static library to -dev, if > backwards compat is a concern we can make `-dev` provides= and > replaces= `-static` too. The main reason we want have a separate -static package is to avoid accidentally link to static library. By having it in separate package you need to explicitly install it, or you will get dynamic linking. Second reason is that we normally don't need the static libraries so its just bloat. In most cases it does not matter install 3MB extra, but IMHO its just waste. Some of the static packages do have significant size. llvm10-static for example, is 189MB. > 2. Avoid using --disable-static or removing the static library with > 'rm' and respect the upstream decision to build it by default or not. I think we should use --disable-static as the default, and enable static on request. We shouldn't use the static library ourselves (with a few exceptions), but can make it available when someone asks for it. > > Regards > Leo >