Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 8534A782D74 for <~alpine/devel@lists.alpinelinux.org>; Wed, 20 Jan 2021 00:16:03 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id c12so9612541qtv.5 for <~alpine/devel@lists.alpinelinux.org>; Tue, 19 Jan 2021 16:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=alXEgUF7nz21CRmTHcZwxYzFusoeuTwBpcsaq/QKvnM=; b=CKGrp1+JaDRBDVNw1L9fcn5TmLPdAsPDb6fw7v1Zo/HW+8bTg2rRdj20jmUpnhyaSK jhHveHPiDAuUzVgNxvKiZkaL4BpF90qQGy0uZPohv6Grgd6L+dsPAHNOOVCIIoIWWUjl R0AD5tdy+83ooqXtsRLTjmaecLOB1P27kVxOPPEX9qyFnZRZMdjUkwCfJmYXilcaGbgO N09j6PHwNIszJ+65vRy5BBW1WWUDxCgI50KhmV9aAPfJGJB6lMWplWaRQRqvPfMAraI1 K0cDM3Of76jFsT5tUpTyjxZOpD8JJAGC0di+5kMj6gS/3BGEF8bzDqbAeJmHvlcZleAX KGFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=alXEgUF7nz21CRmTHcZwxYzFusoeuTwBpcsaq/QKvnM=; b=ob/XsE5XiGv0R+lB5XyUwQqUTcarkeXmEy+GK5DdeK6o+fHxVhOGxdz7dUi5eopOt8 ZsHR6jleNXlpxrTzDYigkVuETN3Lz6HQI3/2mMTcAp4xa4+6OH8biiV6RXs7SXrY1wDw r5KXq+DIViAQqHPwcvpETmuISW2/eXXVTbaGh5V0lpeESXRydrc7mlDzIbWNpKYXSZHu 671bNqA8zhbCUERsnC4b7N1EOt7qUIU6IyQ5w/PbsTU9SAUYMbqoyDNe+x3BWR+56Snd h9c00x11bXv0EILx8fDQsAh0XIpFq7AL1WvmI6UkrkvMt9ITn4n0XgUtFF7hBIRNisZ5 nP+A== X-Gm-Message-State: AOAM531xEw1gS6zt81ymSaICIwIlne33W7s15Jq1ph24Hve9NVl9jv4G kmSkiVd1fjYs4Od4F/PDmla/D6lcZyeYAQ== X-Google-Smtp-Source: ABdhPJwjK6hoFwuHyxBugIcwSIV8fimI9z0KnMwnd3kRkL7uBlz2fUeCawqN8zyWdOlKGQhgcMGAeQ== X-Received: by 2002:a05:622a:20e:: with SMTP id b14mr1092397qtx.148.1611101761895; Tue, 19 Jan 2021 16:16:01 -0800 (PST) Received: from ?IPv6:2804:431:cfcc:c60a:7365:514b:49c3:8977? ([2804:431:cfcc:c60a:7365:514b:49c3:8977]) by smtp.gmail.com with ESMTPSA id n62sm250602qkn.125.2021.01.19.16.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 16:16:01 -0800 (PST) Message-ID: <9d3541ec2a2890703a1cfdbda9d4d50136308699.camel@gmail.com> Subject: Re: RFC on -static subpackages and being more static-linking friendly From: maxice8 To: Natanael Copa Cc: ~alpine/devel@lists.alpinelinux.org Date: Tue, 19 Jan 2021 21:15:59 -0300 In-Reply-To: <20210119212733.11bcc69b@ncopa-desktop.lan> References: <20210119212733.11bcc69b@ncopa-desktop.lan> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.2 (3.38.2-1.module_f33+10736+4f8d5006) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit On Tue, 2021-01-19 at 21:27 +0100, Natanael Copa wrote: > 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. > Yes. > > 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. > The split has helped me only once, while dealing with skarnet software suite, I don't think it is worth it to have a broken -static package that can't even be used ootb to link statically. > 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. > It is bloat part of the -dev subpackage which I don't consider as important as avoiding bloat in the main packages (which we expect users to install in the containers permanently) most users install -dev and then remove it after compiling the final binary for their docker containers. > > 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. > I prefer letting upstream decide if they want or not, if they(upstream) compile a static library then don't mess with it, if they don't then enable **only** if someone requires it. > > > > > Regards > > Leo > > >