From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DE624158128 for ; Sun, 15 Jun 2025 14:06:29 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id AFFFB3425F1 for ; Sun, 15 Jun 2025 14:06:29 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 1F6FF1104DC; Sun, 15 Jun 2025 14:06:25 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 12E0E1104DC for ; Sun, 15 Jun 2025 14:06:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B278C342563 for ; Sun, 15 Jun 2025 14:06:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 28C312356 for ; Sun, 15 Jun 2025 14:06:23 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1749996370.796b1516417be66fbd1804ca79f21b63b3af1c14.sam@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: general-concepts/slotting/ X-VCS-Repository: proj/devmanual X-VCS-Files: general-concepts/slotting/text.xml X-VCS-Directories: general-concepts/slotting/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 796b1516417be66fbd1804ca79f21b63b3af1c14 X-VCS-Branch: master Date: Sun, 15 Jun 2025 14:06:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4e6e85f3-e825-45cf-8a20-52e2faebe70d X-Archives-Hash: e069a029c8f57bc38d6a746f2db2381a commit: 796b1516417be66fbd1804ca79f21b63b3af1c14 Author: Sam James gentoo org> AuthorDate: Mon Dec 16 20:22:15 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Jun 15 14:06:10 2025 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=796b1516 general-concepts/slotting: New 'Considerations for slotting' section This is a section I've been wanting to write for quite some time and formalises a talk I've had to give many contributors. Slotting is a powerful tool but easy to abuse and there's a number of non-obvious pitfalls that we should document: attempt to do that here. Signed-off-by: Sam James gentoo.org> general-concepts/slotting/text.xml | 116 +++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/general-concepts/slotting/text.xml b/general-concepts/slotting/text.xml index ca8a77a..0516958 100644 --- a/general-concepts/slotting/text.xml +++ b/general-concepts/slotting/text.xml @@ -45,10 +45,126 @@ To DEPEND upon a package in a specific slot, refer to

+
+Considerations for slotting + + +

+Slotting is a powerful tool and as such, is easily abused. It's critical +that when slotting, package maintainers carefully reflect on implications +for reverse dependencies. +

+ +

+Do not be fooled by the ease in adapting the package itself to slotting: +slotting the package itself may well be the easiest part. +

+ +

+Before proceeding at all, consider the wider implications beyond Gentoo. +Especially examine other distributions and their handling of the problem in +question. Unilaterally moving software can have devastating consequences for +both users and other developers. +

+ +

+Suppose every possible consumer of a slotted package can be adapted in +Gentoo: there is still more work to be done. Keep in mind that users may +develop or test software on Gentoo systems which may be deployed elsewhere. +They both want to be able to build that software without having to adapt to +Gentooisms, and they also don't want to unintentionally write their software +such that it relies on Gentooisms. +

+ +

+For example, slotting software by inventing a Gentoo-specific pkgconfig +file and then patching all packages in the Gentoo repository is usually +the wrong decision, because users won't be able to build software manually +without patching it, and they may ship software that then fails to build +on other distributions. +

+ +

+Even systems that lend themselves to slotting, such as Guile or Lua, cannot +be naively slotted by just adapting the package itself. Other packages +must be primed to handle a slotted landscape: an eclass mechanism usually +needs to exist for packages to declare which versions they support, as well +as force building against the version currently depended upon to avoid +automagic dependencies. +

+ +

+For example, for slotted Guile, it may be trivial to make dev-scheme/guile +itself install itself as guile-3.0 (and other -3.0 suffixes +on its binaries), but packages depending on Guile will need an eclass to +control which Guile the installed files are compatible with. +

+ +

+All reverse dependencies of a package should be tested and examined when +considering any slotting approach, in particular asking the following: +

+ +
    +
  • how does this software use the to-be-slotted package;
  • +
  • how the build system should locate the (right) version of this package;
  • +
  • + how the package (and the right version of it) should be located at runtime, + if required. +
  • +
+ + + + +Libraries + + +

+As a rule of thumb, libraries should not be slotted unless upstream +explicitly intend (major) versions to be installable in parallel. The +presumption should be that a library cannot be slotted until proven otherwise. +

+ +

+If a library is to be slotted, please consult with upstream wherever possible: +ask them to begin installing pkgconfig files to aid porting build systems +to detecting the library portably. +

+ +

+ABI should also be considered with slotted libraries: if a consumer of the +library (in)directly links against another version of the library, loading +two ABI-incompatible versions of the library in the same process, unpredictable +runtime behaviour may occur (including crashes, or worse). +

+ +
+ + +Executables + + +

+For utilities / executables, slotting may be acceptable as long as an +unversioned, generic symlink or wrapper is made available for the benefit +of user scripts or tools, and build systems which expect the generic name +to be available. +

+ +

+An eselect module is often made available for these cases, though +ebuilds normally shouldn't depend on its use. +

+ +
+
+
Sub-slots +

Sometimes a package installs a library that changes interfaces between versions, but it's undesirable or inconvenient to allow some of these versions to be installed