From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iFkSAlkTkGXGtgAAkFu2QA (envelope-from ) for ; Sat, 30 Dec 2023 13:55:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UOIBOlgTkGUiOAEAqHPOHw (envelope-from ) for ; Sat, 30 Dec 2023 13:55:53 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=wolfsden.cz header.s=mail header.b=v3NvWq0k; dkim=pass header.d=wolfsden.cz header.s=mail header.b=v3NvWq0k; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=wolfsden.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703940952; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RqWryBTYZvhx4TmYcONq9xsNLD+gQ1ClObQH3leReWE=; b=Wc4N8m24ji2rfJTjd+QavuParK+zYLjxd6Y5akWH24rCKzkz1wRe7CThr2XafesJnu1Kue iKVlXaxufg/lRRq1m5m4KnBGINhv39jYk9HVonag4Pl4CjEbNcUgdh2h10HkHASjP0JBMZ sdNE1MI5JkDDeH1oVOrjqBuNShYX+mATD4MxjQp4TWXOCevypxgAiERTcvKmDnKf9Q4n7j hTHuAMLsFP9Nz8Bs9A9umYDSPBcOznw1tS1Yrf8uF/3PTc5NwMZnanQ36K9YqQP31QgjHE 72iOwTQGammY3xrlMpiSlMmH8uZRlK7zQ7KMIGGGOyBY+j8g/HcB4Jjnn0hM3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703940952; a=rsa-sha256; cv=none; b=WyNGzWlMByEdtNjEM4aFb7IVqsITtOg80/CFkkv1rDNFuY1e2hZMRJCz6Oku0qjH/Wj808 31MLVHy1VTCuY96sAMHyRygCtR3CLCzkzzM/KeKY2Puu8sK4NqenZrs4hdlKwpZpJ3rhtQ Gbs9djJKUmQJfymogDim0mcLCDKej5t8qIrixIGlZw9nTbXi/rx1EzVihdXvV7orVSqPME 5wJHh9txH4Y5V2DOnQ86ufl4luVJu9rY4exPLgsYmpASnFL3hI84tB01M7Xa0g4esTOjWw XJC6eqonM0pjwjgGFcJiVzPpVZS3/ZCvSP7zpBRkvCNld0B3djABTM9DYYc8+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=wolfsden.cz header.s=mail header.b=v3NvWq0k; dkim=pass header.d=wolfsden.cz header.s=mail header.b=v3NvWq0k; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=wolfsden.cz Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 45DEA23BA6 for ; Sat, 30 Dec 2023 13:55:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJYru-0005DF-Ik; Sat, 30 Dec 2023 07:55:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1rJYrs-0005Ck-IR for guix-devel@gnu.org; Sat, 30 Dec 2023 07:55:08 -0500 Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1rJYrq-0003Uk-0D for guix-devel@gnu.org; Sat, 30 Dec 2023 07:55:08 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id CE10D277F7D; Sat, 30 Dec 2023 12:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1703940900; bh=ZAIzuIW9lpexed0bLmZZF3SgIJrsWYnmlgghFZ+X+Po=; h=Date:From:To:Subject; b=v3NvWq0kwUHAXjhA0OQeUtqyxIReZJyYLWRTiQHbc3vqYWuDxeRatrL/vCXparl+x V0xEH8z5AP/FCHSxMv3wCQeyEsijqjJCARvcl97iTHZI9hpLIhWXGYMtSCrQNL6K+P bhlFlhZrw54Uzs02xN7FNT5fJgS+gjDgo3YU2xZeuN6vJ00TyevHvK+xWC6Z3xPbEa UjADhyKsYQ/TnjFVNTGrsTTAP5X5BGpZMEgEU1JogAlijuxQjce61vhm79V9hXIcnP 7M/LZrwxDgCKhgYZCog2z14FkswXO6jVEj22krj1ecibIw9pIBm8NwDGW8fjmllasn cqEcLqUJC6EFN4yin35mIrnCiMo+9waKf8d9upH72mzPPCOpuxq6AE3DUObICkb/KK vvsWYbSJrgq6TjlkdUTlXCkbcklk9cK6kkcrEVK8Fcb+2IcIjFIqNma7Di3eYkWRz8 ENi3Vgogp7tLaN5oMtJi/xaH0N+lr0dF9vTvB8YhXZxMXOfW74dPf1pZFI/GJmcyMZ taRzuZc/VFya+BqyD31f9srgYDYZnlNUNACjysL/cSGchZFw9+FbKd83Z9xZ8LoMrT O0tEOPRFWrboWlX5SUHxPsiIuqJ4MoLlAtBZ+zBUtBO04U2dHsgHzR9SZLU0sHxBVK /TSUzzKD+A2YW7W/JgM5L4rc= Received: from localhost (unknown [81.17.16.82]) by wolfsden.cz (Postfix) with ESMTPSA id 10759278A46 for ; Sat, 30 Dec 2023 12:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1703940900; bh=ZAIzuIW9lpexed0bLmZZF3SgIJrsWYnmlgghFZ+X+Po=; h=Date:From:To:Subject; b=v3NvWq0kwUHAXjhA0OQeUtqyxIReZJyYLWRTiQHbc3vqYWuDxeRatrL/vCXparl+x V0xEH8z5AP/FCHSxMv3wCQeyEsijqjJCARvcl97iTHZI9hpLIhWXGYMtSCrQNL6K+P bhlFlhZrw54Uzs02xN7FNT5fJgS+gjDgo3YU2xZeuN6vJ00TyevHvK+xWC6Z3xPbEa UjADhyKsYQ/TnjFVNTGrsTTAP5X5BGpZMEgEU1JogAlijuxQjce61vhm79V9hXIcnP 7M/LZrwxDgCKhgYZCog2z14FkswXO6jVEj22krj1ecibIw9pIBm8NwDGW8fjmllasn cqEcLqUJC6EFN4yin35mIrnCiMo+9waKf8d9upH72mzPPCOpuxq6AE3DUObICkb/KK vvsWYbSJrgq6TjlkdUTlXCkbcklk9cK6kkcrEVK8Fcb+2IcIjFIqNma7Di3eYkWRz8 ENi3Vgogp7tLaN5oMtJi/xaH0N+lr0dF9vTvB8YhXZxMXOfW74dPf1pZFI/GJmcyMZ taRzuZc/VFya+BqyD31f9srgYDYZnlNUNACjysL/cSGchZFw9+FbKd83Z9xZ8LoMrT O0tEOPRFWrboWlX5SUHxPsiIuqJ4MoLlAtBZ+zBUtBO04U2dHsgHzR9SZLU0sHxBVK /TSUzzKD+A2YW7W/JgM5L4rc= Date: Sat, 30 Dec 2023 13:54:59 +0100 From: Tomas Volf <~@wolfsden.cz> To: guix-devel@gnu.org Subject: #:modules and #:imported-modules, and more Message-ID: Mail-Followup-To: guix-devel@gnu.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pRABswz25+v2qBhD" Content-Disposition: inline Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz; helo=wolfsden.cz X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.07 X-Spam-Score: -9.07 X-Migadu-Queue-Id: 45DEA23BA6 X-Migadu-Scanner: mx12.migadu.com X-TUID: NVoTV+4OZcla --pRABswz25+v2qBhD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Guix. Table of Contents _________________ 1. My understanding 2. #:extra-modules, #:extra-imported-modules 3. %...-build-system-modules 4. %default-modules 5. Other comments .. 1. What are the reasons for the naming scheme of build systems? 6. Conclusion 1 My understanding ================== In the process of fixing crashes of libreoffice and netsurf (patches coming soon), I was trying to understand the difference between #:modules and #:imported-modules. My conclusion is that the former are modules that are (use-modules)-ed automatically, while the latter are modules that are made available and can be (use-modules)-ed if desired. If one wants to add some modules, the way it is done, for gnu-build-system, is like this: ,---- | #:imported-modules `((some module) | ,@gnu-build-system-modules) `---- Is that summary correct? Assuming it is, I would like to propose few changes. I am willing to supply the implementation(s), but thought I should discuss it first in order not to waste time if it would be a no-go. They would be done in roughly this order over multiple patch series to allow smooth transition. 2 #:extra-modules, #:extra-imported-modules =========================================== As seen in the example above, currently there is a need to manually merge the list of additional modules with the original one. Failing to use the correct base can lead to issues (like crash in netsurf). I would like to propose adding two new fields into the build system, `#:extra-modules' and `#:extra-imported-modules'. Those would be automatically appended to the `#:modules' and `#:imported-modules', removing the need to merge the lists in the package definition. Therefore the example above would turn into: ,---- | #:extra-imported-modules '((some module)) `---- The original fields would still be available, so full control would be possible, if needed. There currently seems to be ~276 occurrences of `-build-system-modules' in the gnu/packages directory, and vast majority of them would be removed. 3 %...-build-system-modules =========================== This variable seems misnamed, since it should be used with `#:imported-modules', so once the above is done (and the usage of it drops down), I would like to rename it to `%...-build-system-imported-modules'. 4 %default-modules ================== Situation with `#:modules' is more interesting, since there is no common pattern. Some build systems have `%default-modules' (non-exported), some just hard-code the list. In the step above the binding was released, so I would like to unify the build systems by reusing as public `%...-build-system-modules', which would be used as default for `#:modules' in all build systems. These steps are somewhat independent, but at least this last one I would think would be useful. Albeit without the previous ones different name would have to be used. 5 Other comments ================ 5.1 What are the reasons for the naming scheme of build systems? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It seems that all the build systems use a prefix-based naming scheme, so `gnu-build-system', `meson-build-system' and such. I am curious what is the reason for that? Since Guile modules support `#:prefix', would it not be a cleaner choice? So I could have something like: ,---- | (define-module (gnu packages foo) | #:use-module ((guix build-system gnu) #:prefix gnu) | #:use-module ((guix build-system python) #:prefix python)) | ...) | | (define-public bar | (package | ... | (build-system gnu:build-system))) | | (define-public baz | (package | ... | (build-system python:build-system))) `---- That, given there is a built-in support in the language, seems somewhat cleaner. And could possibly make introspection easier (maybe?). Could someone enlighten me regarding the reasons for the current implementation? 6 Conclusion ============ Thank you for considering this proposal, and thank you in advance for any helpful insight you are willing to provide. Have a nice day, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --pRABswz25+v2qBhD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWQEyMACgkQL7/ufbZ/ wanlqBAAtPEbzC1lMorAKkkbSFAThpx5Saw5qtq7w6bz5pdltF3SPw/uG2HFHPtF SXgULmzxTgfRFvP7hlw6GbFgdhZTDmkgw6BbXmsdXncnTaLgiRHBsUM2ey120Y1Y UXQo1ujJDz2zdzhaOzVnTgLa/7n/CCb9g6uj6Kay5iYukYsSRrJMVDfQRRb5sqsJ tyEZuVY65bQpMwG/j/7HSJTpd4vWvV8YCMRdNd7mitv+LzhjsVUoC60ZJct9z22T ynDWW9T3Y6c/CAHjZQvP/EMtoUNfzxuOph2PnVeLXWJop+6FVvnZwnCMM3agujJJ yLMB3NXHdPtGfcoRlPVGUHhsGWp6EW32DgCRKOnzhtINKsqyWM5+wt33259K7nSS wLkniK+cUUmlsCSfbqjB87sd0OiUi6Rm24z27DGioMwUU+3aTqt2GyrxuGehEoFi wtw3jjPa4oBTKnHm/HmBP7P/qOLZgrE/i0j8aSw6JJxx63+gD8TOldezPgc59iUN NzNQCR19mdcfpQ05dli1vu/lR5mShDkP6HLNMQ9/7LR1NG9SRYQTa4OWce0oFF0t js0DezLSPukgBa8FaRT99Rb8Qm53SSPIbfWkMdD7kOtX0bF+maiWUUh64iaOQ7j5 cSWRsXwZXuS8MIXEE/U8aZIXl0X79XkJgxLB7gpS2Ou5xspV3e4= =AvIU -----END PGP SIGNATURE----- --pRABswz25+v2qBhD--