From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oPhrAPKdbGBuDgAAgWs5BA (envelope-from ) for ; Tue, 06 Apr 2021 19:44:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0G/4NfGdbGAkLAAA1q6Kng (envelope-from ) for ; Tue, 06 Apr 2021 17:44:17 +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 034F823051 for ; Tue, 6 Apr 2021 19:44:17 +0200 (CEST) Received: from localhost ([::1]:55880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTpkN-0006Xs-My for larch@yhetil.org; Tue, 06 Apr 2021 13:44:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTpkD-0006Ua-7j for bug-guix@gnu.org; Tue, 06 Apr 2021 13:44:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58373) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTpkA-00007s-0t for bug-guix@gnu.org; Tue, 06 Apr 2021 13:44:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTpk9-00085q-Ut for bug-guix@gnu.org; Tue, 06 Apr 2021 13:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47569: =?UTF-8?Q?=E2=80=98qt-build-system=E2=80=99?= retains too many references via wrappers Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 06 Apr 2021 17:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47569 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer Received: via spool by 47569-submit@debbugs.gnu.org id=B47569.161773103231087 (code B ref 47569); Tue, 06 Apr 2021 17:44:01 +0000 Received: (at 47569) by debbugs.gnu.org; 6 Apr 2021 17:43:52 +0000 Received: from localhost ([127.0.0.1]:41686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTpjz-00085K-Nl for submit@debbugs.gnu.org; Tue, 06 Apr 2021 13:43:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTpjw-000857-Os for 47569@debbugs.gnu.org; Tue, 06 Apr 2021 13:43:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55513) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTpjr-0008NY-Fd; Tue, 06 Apr 2021 13:43:43 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39466 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lTpjp-0001Ny-NX; Tue, 06 Apr 2021 13:43:42 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87czvczbsv.fsf@inria.fr> <87blaurbya.fsf@gmail.com> <878s5wseaz.fsf@gnu.org> <87r1jnmu0v.fsf@gnu.org> Date: Tue, 06 Apr 2021 19:43:39 +0200 In-Reply-To: <87r1jnmu0v.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 06 Apr 2021 15:17:52 +0200") Message-ID: <87zgybl35g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 47569@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617731057; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=IbHOXUg0BaKWKfjD33mP5kDLRpD+SpvsKULoI/TNjyI=; b=qsbqNy34ZIIiHV0VXdzE0DEHf/afp67fCLzla+oJBdUXSCqa41rZ0RAPSuXMbCzeWnd8gT 4HUcxgcYzmy5M80iBg18Dm5TC37i8ksy48zju1vtcTmWQQQERHQQpkz1xzlsJPImV9xaJ6 8yHa/SUhRyaCif2rSuruFx4anazvBdGlHhXiRqXDVs+5GqUxTIw8N+x6leB0Q5ay9KUwO4 nNC9243uiKBD8Npuku8mmAyk0S0dTWtVTmqnZpOHnOYJfbRNvaKRYIda+E7gun1S+WrarS NPYNju7Hz3uZlZWX19apHkZRu1i8FvUl/+4Hz8k8b0h0fi+IJAvCd/0sAiT9Qw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617731057; a=rsa-sha256; cv=none; b=bq1FSJZlJ1KFhHXSaUchjeBFp7oESaU8YKIPLMsuFjVNq4uFByQaVGqW74Djb4WgWAQUye gZESHUjiQQQdEugGccyDgREiY/2IrQCynMlfI547OfhB5xtb48D2Wc+VrVxAMVMgdRMN54 XbIu9lzm/+n5oWkShTWOl8WGZdle4WnZQAvYLqeiky0CwuXuyR9paOcp8ypwdBswpof0Zf XPTwB/dn/3HyYb+nsuSy372KF42GoYphU8AbL/2+E7XAEVGPAdYU64taTN2jezCd3+JmpS 82kcAvurEDbrd2xuIGiAePpUNjwAmVBszUy4PLXuhiXJ1LHBh2Kz2zuWWYQ/uw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.44 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 034F823051 X-Spam-Score: -1.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: ib9lLipcPBLT --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi again! The attached patch fixes this problem AFAICS by filtering out of XDG_DATA_DIRS directories that are unlikely to be of any use. It follows the same strategy as =E2=80=98glib-or-gtk-build-system=E2=80=99, wh= ich is to only include share/ sub-directories that also contain one of the given =E2=80=9Cselectors=E2=80=9D: /glib-2.0/schemas, /sounds, /themes, etc. It gives me a working ktouch, with a wrapper sets a much shorter XDG_DATA_DIR: --8<---------------cut here---------------start------------->8--- $ head -2 $(./pre-inst-env guix build --no-grafts ktouch)/bin/ktouch #!/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash export XDG_DATA_DIRS=3D"/gnu/store/mgzijzw7yn03pbk54zy0f81gyph9jh3k-ktouch-= 20.12.1/share:/gnu/store/5g95qdh0p46qszv199rmdd2lx4mninm7-kcoreaddons-5.70.= 0/share" $ head -2 $(guix build --no-grafts ktouch)/bin/ktouch #!/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash export XDG_DATA_DIRS=3D"/gnu/store/f821syw55jd0l04xkmnbvp562flrw6fm-ktouch-= 20.12.1/share:/gnu/store/3dsl2jalrcyldkrsqab1hc6sv8pyag9z-cmake-minimal-3.1= 6.5/share:/gnu/store/3x63j4ndhbzkjwr6mhnp4h86r550gs7q-extra-cmake-modules-5= .70.0/share:/gnu/store/w08sglxbfpmcvz25pfgnq7v27m1rlkf9-kdoctools-5.70.0/sh= are:/gnu/store/krpyb0zi700dcrg9cc8932w4v0qivdg9-pkg-config-0.29.2/share:/gn= u/store/v6f44zccwh9z5zk3pjlywjybbi8n2hjh-tar-1.32/share:/gnu/store/ncydgq2z= nms5n1d2k5yqshhf58nsixwv-gzip-1.10/share:/gnu/store/i8h2pcxqdq07ijm3ibkka8f= 4smn1w48v-bzip2-1.0.8/share:/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-= 5.2.4/share:/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/share:/gn= u/store/n4n560pfvvw50a9369axw5vj5rrqfj1n-diffutils-3.7/share:/gnu/store/cd5= qf3kcnlq35p9k392pjdpdzpsnds70-patch-2.7.6/share:/gnu/store/hic7snhayfl7m6cp= fqqr73nmm19bpqkg-findutils-4.7.0/share:/gnu/store/swqdvwri9dbv6zssg6v0by7l0= 5hd6wxp-gawk-5.0.1/share:/gnu/store/ishk7fswcs4gkwcp8mh788z4mvvl9bxh-sed-4.= 8/share:/gnu/store/bhs4rj58v8j1narb2454raan2ps38xd8-grep-3.4/share:/gnu/sto= re/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/share:/gnu/store/hm40bxn= v8jxmbc1lpb7zfimii4xm9m81-make-4.3/share:/gnu/store/pwcp239kjf7lnj5i4lkdzcf= cxwcfyk72-bash-minimal-5.0.16/share:/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkc= g3m4-binutils-2.34/share:/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.= 5.0/share:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/share:/gnu= /store/s3dcqzwqaakv1yx37by9chksdbkgih17-glibc-2.31-static/share:/gnu/store/= 5rj71g09qc9g20mv0lh5a28jhwa5d6dl-kcmutils-5.70.0/share:/gnu/store/3vdmy5gjn= 1a23ky6l907byc3917xfh2a-kcompletion-5.70.0/share:/gnu/store/ba8nl7wflsf1s95= x72kpaj0rzval908b-kconfig-5.70.0/share:/gnu/store/r4120j3v7cnv5qlmp2kqb6xbc= 63gplpa-kconfigwidgets-5.70.0/share:/gnu/store/5g95qdh0p46qszv199rmdd2lx4mn= inm7-kcoreaddons-5.70.0/share:/gnu/store/lbq73h2snwpn4wf9wkp8j0rxw0lyhyp4-k= declarative-5.70.0/share:/gnu/store/k4k0mrgv31clkpl38zjnpb3l0nin2nnl-ki18n-= 5.70.0/share:/gnu/store/agmzjiqcv1lb77jmr7xwx0br4sy12i6d-kiconthemes-5.70.0= /share:/gnu/store/0mbm58p5mybimbvv8ainkzz7mdpynd25-kitemviews-5.70.0/share:= /gnu/store/yqpk8haa1z5plgb134f95vryjxghlyjv-kqtquickcharts-20.04.1/share:/g= nu/store/5mfz0faj9lc9m1ppijgqkxz03j89dyil-ktextwidgets-5.70.0/share:/gnu/st= ore/fwmp85k5hqy7fw0rnq5560pg4amiblz4-kwidgetsaddons-5.70.0/share:/gnu/store= /xslnsy6sxjp66l99mvj67v1x30bh55xi-kwindowsystem-5.70.0/share:/gnu/store/n79= ns6y3cc7ny4mkp5qidf57j1cxbg6p-kxmlgui-5.70.0/share:/gnu/store/3x6y8kpbwjmzp= ndjfhdbn654g7dm85cp-libxcb-1.14/share:/gnu/store/zc9bpa1v46cnqc05xk8njm08bw= k8a70m-libxkbfile-1.1.0/share:/gnu/store/j7110r2rhs9pdypx2x0h8nx4r082fbdk-q= tbase-5.15.2/share:/gnu/store/8r5y5bnblc4s6w8j5sfxv06ra6lz12j8-qtdeclarativ= e-5.15.2/share:/gnu/store/c020rcd650ikq7gqfnkga46kzis3v2hi-qtgraphicaleffec= ts-5.15.2/share:/gnu/store/2iwman5hbgg15r99rshl6lsxz35dq2b2-qtquickcontrols= 2-5.15.2/share:/gnu/store/n7dbg5cgcpslrym4zmsimps1ch1p0q8w-qtx11extras-5.15= .2/share:/gnu/store/7yjd1h08li3dr2188pfwfnwlq0p3av9p-qtxmlpatterns-5.15.2/s= hare:/gnu/store/gfapkk5c6hvl1d94m4sqnhn7f9l5gqyh-linux-libre-headers-5.4.20= /share:/gnu/store/kvdrfyi50zsmy0ykmc9p8qzjlahqfa4p-kservice-5.70.0/share:/g= nu/store/yk425lbm0wnjpqm1z964l9l6li5x0wbn-kcodecs-5.70.0/share:/gnu/store/2= z5nfmzxhqaalcrswp8nn3yk5ys8q261-kauth-5.70.0/share:/gnu/store/vhmyxywsdy92b= gqxy6fnmcpr81xsfcys-kpackage-5.70.0/share:/gnu/store/rz42ba0my9vrgbkjpkzr2d= rmnjk5ah50-python-3.8.2/share:/gnu/store/n9wx4dp68bfsw9bb1bwmklzl34ggrmgm-g= ettext-minimal-0.20.1/share:/gnu/store/yqs5mkp20m58sr744cs2pn8sqb5m59sq-son= net-5.70.0/share:/gnu/store/6cdl970wcv4jhvpgbh8sdj54a5gwhmwj-libxdmcp-1.1.3= /share:/gnu/store/h7sy4hr7arjknbyy1aq0xwv6fksnzw9n-libxau-1.0.9/share:/gnu/= store/klk98l8czl05lvanrr7xl7a9hksac4ak-libpthread-stubs-0.4/share:/gnu/stor= e/k30a2pgmc6b3ifmq3rn0dr5ng9gr8w81-which-2.21/share:/gnu/store/7disnxqw8i3n= 4zhw5s0xj9kkdckkmr1p-mesa-20.2.4/share:/gnu/store/wxl57nkbqgamfp73b7v62kk3f= 1hiv0cz-xorgproto-2019.2/share:/gnu/store/c3zbbynb590yxrpwcxrkll80mn66h3kf-= libxxf86vm-1.1.4/share:/gnu/store/jwga98k68l0h5c45jx7z4jdjzhfc34vm-libxshmf= ence-1.3/share:/gnu/store/9z9gd76la5bww3sqgg2ax0h00msl28k6-libxfixes-5.0.3/= share:/gnu/store/2wysr1lr7b5mc444m39qz107n92xm5xq-libxdamage-1.1.5/share:/g= nu/store/fx3979c88s9yxdbchyf36qryawgzpwb5-libx11-1.6.10/share:/gnu/store/kx= 58xc3hxa9b0mp1hl7pzz43bl7gh18h-libdrm-2.4.103/share:/gnu/store/lc8irxnwazq3= 40ygkbqh0ask446jzy9k-util-macros-1.19.2/share:/gnu/store/qrs0p8j3wq6q5a4dm0= ndjdavk9gyal5q-libxext-1.3.4/share" --8<---------------cut here---------------end--------------->8--- The closure is still awfully big but smaller: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix size ktouch | tail -1 total: 1298.0 MiB $ guix size ktouch | tail -1 total: 1752.4 MiB --8<---------------cut here---------------end--------------->8--- Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm index 005157b0a4..bb17c362d1 100644 --- a/guix/build/qt-build-system.scm +++ b/guix/build/qt-build-system.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2014 Federico Beffa -;;; Copyright =C2=A9 2014, 2015 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2014, 2015, 2021 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Mark H Weaver ;;; Copyright =C2=A9 2019, 2020 Hartmut Goebel ;;; @@ -49,25 +49,44 @@ =20 (define (variables-for-wrapping base-directories) =20 - (define (collect-sub-dirs base-directories subdirectory) - (filter-map - (lambda (dir) - (let ((directory (string-append dir subdirectory))) - (if (directory-exists? directory) directory #f))) - base-directories)) + (define (collect-sub-dirs base-directories subdirectory + selectors) + ;; Append SUBDIRECTORY and each of BASE-DIRECTORIES, and return the su= bset + ;; that exists and has at least one of the SELECTORS sub-directories, + ;; unless SELECTORS is the empty list. + (filter-map (lambda (dir) + (let ((directory (string-append dir subdirectory))) + (and (directory-exists? directory) + (or (null? selectors) + (any (lambda (selector) + (directory-exists? + (string-append directory selector))) + selectors)) + directory))) + base-directories)) =20 - (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 va= r-spec)))) - (list - ;; these shall match the search-path-specification for Qt and KDE - ;; libraries - '("XDG_DATA_DIRS" "/share") - '("XDG_CONFIG_DIRS" "/etc/xdg") - '("QT_PLUGIN_PATH" "/lib/qt5/plugins") - '("QML2_IMPORT_PATH" "/lib/qt5/qml"))))) + (filter-map + (match-lambda + ((variable directory selectors ...) + (match (collect-sub-dirs base-directories directory + selectors) + (() + #f) + (directories + `(,variable =3D ,directories))))) + + ;; These shall match the search-path-specification for Qt and KDE + ;; libraries. + (list '("XDG_DATA_DIRS" "/share" + + ;; These are "selectors": consider /share if and only if these + ;; sub-directories exist. This avoids adding irrelevant packag= es + ;; to XDG_DATA_DIRS just because they have a /share sub-directo= ry. + "/glib-2.0/schemas" "/sounds" "/themes" + "/cursors" "/wallpapers" "/icons" "/mime") + '("XDG_CONFIG_DIRS" "/etc/xdg") + '("QT_PLUGIN_PATH" "/lib/qt5/plugins") + '("QML2_IMPORT_PATH" "/lib/qt5/qml")))) =20 (define* (wrap-all-programs #:key inputs outputs (qt-wrap-excluded-outputs '()) --=-=-=--