From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WNI9EPhrZl/5OgAA0tVLHw (envelope-from ) for ; Sat, 19 Sep 2020 20:37:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id gEozDPhrZl+9awAAB5/wlQ (envelope-from ) for ; Sat, 19 Sep 2020 20:37:12 +0000 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 9DB45940237 for ; Sat, 19 Sep 2020 20:37:11 +0000 (UTC) Received: from localhost ([::1]:54124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJjbZ-0003OX-8Z for larch@yhetil.org; Sat, 19 Sep 2020 16:37:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJjbS-0003OP-PQ for guix-patches@gnu.org; Sat, 19 Sep 2020 16:37:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJjbS-0005b4-Ci for guix-patches@gnu.org; Sat, 19 Sep 2020 16:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJjbS-000078-9s for guix-patches@gnu.org; Sat, 19 Sep 2020 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42547] [PATCH] build-system/qt: Don't include useless inputs in wrapped variables. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Sep 2020 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42547 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Cc: 42547@debbugs.gnu.org Received: via spool by 42547-submit@debbugs.gnu.org id=B42547.1600547798399 (code B ref 42547); Sat, 19 Sep 2020 20:37:02 +0000 Received: (at 42547) by debbugs.gnu.org; 19 Sep 2020 20:36:38 +0000 Received: from localhost ([127.0.0.1]:48209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJjb4-00006L-8z for submit@debbugs.gnu.org; Sat, 19 Sep 2020 16:36:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJjb1-000065-Sk for 42547@debbugs.gnu.org; Sat, 19 Sep 2020 16:36:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51991) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJjaw-0005a4-3G; Sat, 19 Sep 2020 16:36:30 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49222 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kJjav-00067w-Gq; Sat, 19 Sep 2020 16:36:29 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200726122234.6593-1-kuba@kadziolka.net> Date: Sat, 19 Sep 2020 22:36:27 +0200 In-Reply-To: <20200726122234.6593-1-kuba@kadziolka.net> ("Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?="'s message of "Sun, 26 Jul 2020 14:22:34 +0200") Message-ID: <87imc9pkqc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: P8nHrBQlih3h Hi Jakub, Jakub K=C4=85dzio=C5=82ka skribis: > * guix/build-system/qt.scm (qt-build)[qt-wrap-excluded-inputs]: New argum= ent. > * guix/build/qt-build-system.scm (variables-for-wrapping): Take the > output directory as an argument for special handling. Check for > subdirectories of /share used by Qt before including inputs in > XDG_DATA_DIRS. > (wrap-all-programs): Pass the output directory to variables-for-wrappin= g. > (wrap-all-programs)[qt-wrap-excluded-inputs]: New argument. This sounds like a good idea. Do you know what impact this has on the closure size of packages you looked at? There are quite a few packages using =E2=80=98qt-build-system=E2=80=99. Pr= obably a change for =E2=80=98staging=E2=80=99 or =E2=80=98core-updates=E2=80=99? > +(define (variables-for-wrapping base-directories output-directory) >=20=20 > - (define (collect-sub-dirs base-directories subdirectory) > + (define (collect-sub-dirs base-directories subdir-spec) > (filter-map > (lambda (dir) > - (let ((directory (string-append dir subdirectory))) > - (if (directory-exists? directory) directory #f))) > + (and > + (match subdir-spec > + ((subdir) (directory-exists? (string-append dir subdir))) > + ((subdir children) > + (or > + (or-map > + (lambda (child) > + (directory-exists? (string-append dir subdir child))) > + children) > + (and (eq? dir output-directory) > + (directory-exists? (string-append dir subdir)))))) > + (string-append dir (car subdir-spec)))) > base-directories)) I=E2=80=99d move =E2=80=98match=E2=80=99 around =E2=80=98and=E2=80=99 to av= oid =E2=80=98car=E2=80=99 on the next-to-last line. (eq? dir output-directory) should probably be (string=3D? dir output-directory). (=E2=80=98eq?=E2=80=99 is pointer equality.) I=E2=80=99m also not a fan of =E2=80=98or-map=E2=80=99. > (filter > (lambda (var-to-wrap) (not (null? (last var-to-wrap)))) > (map > - (lambda (var-spec) > - `(,(first var-spec) =3D ,(collect-sub-dirs base-directories (last = var-spec)))) > + (match-lambda > + ((var . subdir-spec) > + `(,var =3D ,(collect-sub-dirs base-directories subdir-spec)))) > (list > ;; these shall match the search-path-specification for Qt and KDE > ;; libraries > - '("XDG_DATA_DIRS" "/share") > + '("XDG_DATA_DIRS" "/share" ("/applications" "/fonts" "/icons" "/mim= e")) So the goal here is to refine what goes to XDG_DATA_DIRS, is that correct? Perhaps this should be separate from the patch that removes qttools from the PATH of wrapped programs? > (define* (wrap-all-programs #:key inputs outputs > + (qt-wrap-excluded-inputs '("qttools")) > (qt-wrap-excluded-outputs '()) > #:allow-other-keys) > "Implement phase \"qt-wrap\": look for GSettings schemas and > @@ -90,10 +106,13 @@ add a dependency of that output on Qt." > (string-append directory "/lib/libexec")))) >=20=20 > (define input-directories > - ;; FIXME: Filter out unwanted inputs, e.g. cmake > - (match inputs > - (((_ . dir) ...) > - dir))) > + (filter-map > + (match-lambda > + ((name . dir) > + (if (member name qt-wrap-excluded-inputs) > + #f > + dir))) > + inputs)) Rather: (filter-map (match-lambda ((label . directory) (and (member label qt-wrap-excluded-inputs) directory))) inputs) Could you send an updated patch? Thanks, Ludo=E2=80=99.