all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Don't add propagated-inputs for all outputs
@ 2023-08-26 11:36 宋文武
  2023-08-26 13:53 ` [bug#65550] [PATCH] profiles: Don't propagate inputs for non-development packages iyzsong--- via Guix-patches via
  0 siblings, 1 reply; 15+ messages in thread
From: 宋文武 @ 2023-08-26 11:36 UTC (permalink / raw)
  To: guix-patches; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Hello, we have a TODO for "extend `propagated-inputs` with support for
multiple outputs".  I try to do it for a while, but unable to find a
clear way, since add a new syntax for specify output in
propagated-inputs require changes in too many places..

Think about the intention, what we want is to avoid unwanted
propagated-inputs for building a package or user profiles, and
propagated-inputs is mostly used for development packages which
requiring headers/libraries from its inputs.  It seems I can hardcode
the choice here to the "dev" output (if a package have both "dev" and
"out", its "out" should considered be an application) or the "out"
output (a library/development package).


Then the change is straight:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-packages-Don-t-propagate-inputs-for-non-development-.patch --]
[-- Type: text/x-patch, Size: 1610 bytes --]

From 98a8666a0cbf33e24efff615243b98144a92c950 Mon Sep 17 00:00:00 2001
Message-ID: <98a8666a0cbf33e24efff615243b98144a92c950.1693047369.git.iyzsong@member.fsf.org>
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Sat, 26 Aug 2023 18:27:09 +0800
Subject: [PATCH] packages: Don't propagate inputs for non-development package
 outputs.

* guix/packages.scm (transitive-inputs): Only include propagated inputs from a
package for its "dev" output, or its "out" output if the package doesn't have
a "dev" one.
---
 guix/packages.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index ba98bb0fb4..435d55de71 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1143,7 +1143,13 @@ (define (transitive-inputs inputs)
            (loop rest result propagated first? seen)
            (loop rest
                  (cons input result)
-                 (cons (package-propagated-inputs package) propagated)
+                 ;; Only add propagated inputs for PACKAGE:dev, or PACKAGE:out
+                 ;; when PACKAGE doesn't have a "dev" output.
+                 (if (if (member "dev" (package-outputs package))
+                         (member "dev" outputs)
+                         (or (null? outputs) (member "out" outputs)))
+                     (cons (package-propagated-inputs package) propagated)
+                     propagated)
                  first?
                  (vhash-consq package outputs seen))))
       ((input rest ...)

base-commit: eeb71d778f149834015858467fbeeb1276d96d1d
-- 
2.41.0


[-- Attachment #3: Type: text/plain, Size: 230 bytes --]



Not much benifits now, but i think it will helps when we have more
mulitple outputs packages.  Also how about add a slimming team aiming to
reduce the closure size of packages and system, anyone interested?

Thanks. 🥳

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-09-09 10:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-26 11:36 Don't add propagated-inputs for all outputs 宋文武
2023-08-26 13:53 ` [bug#65550] [PATCH] profiles: Don't propagate inputs for non-development packages iyzsong--- via Guix-patches via
2023-08-26 14:21   ` Liliana Marie Prikler
2023-08-27  7:30     ` 宋文武 via Guix-patches via
2023-08-27  9:31       ` Liliana Marie Prikler
2023-08-29 10:24         ` 宋文武 via Guix-patches via
2023-08-29 17:01           ` Liliana Marie Prikler
2023-08-30 10:55             ` 宋文武 via Guix-patches via
2023-09-01  2:16           ` [bug#65550] Don't add propagated-inputs for all outputs Maxim Cournoyer
2023-08-27  7:34     ` [bug#65550] [PATCH] profiles: Don't propagate inputs for non-development packages Josselin Poiret via Guix-patches via
2023-09-01  2:34     ` [bug#65550] Don't add propagated-inputs for all outputs Maxim Cournoyer
2023-09-01 12:53       ` 宋文武 via Guix-patches via
2023-09-01 15:03         ` Maxim Cournoyer
2023-09-02  0:43           ` bug#65550: " 宋文武 via Guix-patches via
2023-09-09 10:38   ` [bug#65550] [PATCH] profiles: Don't propagate inputs for non-development packages Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.