‘qt-build-system’ retains too many references via wrappers

DoneSubmitted by Ludovic Courtès.
Details
4 participants
  • Efraim Flashner
  • Leo Famulari
  • Ludovic Courtès
  • Maxim Cournoyer
Owner
unassigned
Severity
important
L
L
Ludovic Courtès wrote on 2 Apr 22:11 +0200
(address . bug-guix@gnu.org)
87czvczbsv.fsf@inria.fr
I just noticed this:
Toggle snippet (4 lines)$ guix size ktouch | tail -1total: 1752.4 MiB
Sounds a lot for a touch typing tutor.
Turns out ktouch references all its build-time dependencies: gcc,glibc:static, binutils, findutils, everything. It comes from thewrapper:
Toggle snippet (4 lines)$ grep -r s3dcqzwqaakv1yx37by9chksdbkgih17 /gnu/store/w8i63ghrq64r7f1nxzw50b0j32f2n8v1-ktouch-20.12.1/gnu/store/w8i63ghrq64r7f1nxzw50b0j32f2n8v1-ktouch-20.12.1/bin/ktouch:export XDG_DATA_DIRS="/gnu/store/w8i63ghrq64r7f1nxzw50b0j32f2n8v1-ktouch-20.12.1/share:/gnu/store/ah4az84vjkrssdws7ydvdk1f1mcs70i6-cmake-minimal-3.16.5/share:/gnu/store/3x63j4ndhbzkjwr6mhnp4h86r550gs7q-extra-cmake-modules-5.70.0/share:/gnu/store/qcqghpj3550p94pyqwqmwyd3nqcwflpq-kdoctools-5.70.0/share:/gnu/store/krpyb0zi700dcrg9cc8932w4v0qivdg9-pkg-config-0.29.2/share:/gnu/store/v6f44zccwh9z5zk3pjlywjybbi8n2hjh-tar-1.32/share:/gnu/store/ncydgq2znms5n1d2k5yqshhf58nsixwv-gzip-1.10/share:/gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-1.0.8/share:/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/share:/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/share:/gnu/store/n4n560pfvvw50a9369axw5vj5rrqfj1n-diffutils-3.7/share:/gnu/store/cd5qf3kcnlq35p9k392pjdpdzpsnds70-patch-2.7.6/share:/gnu/store/hic7snhayfl7m6cpfqqr73nmm19bpqkg-findutils-4.7.0/share:/gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/share:/gnu/store/ishk7fswcs4gkwcp8mh788z4mvvl9bxh-sed-4.8/share:/gnu/store/bhs4rj58v8j1narb2454raan2ps38xd8-grep-3.4/share:/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/share:/gnu/store/hm40bxnv8jxmbc1lpb7zfimii4xm9m81-make-4.3/share:/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/share:/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-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/nnri2x0mdfm2y2ci0p5jhlf6xkdsf6i6-kcmutils-5.70.0/share:/gnu/store/ybh1br5ghs1brnwvacfj04jx3203m87p-kcompletion-5.70.0/share:/gnu/store/bnfcann370ad38g7v4pzgklmizk69f7j-kconfig-5.70.0/share:/gnu/store/4w9v0jnx74n542v11ikzxbf352xqrpwy-kconfigwidgets-5.70.0/share:/gnu/store/9nr52vkhj99g4mx1rr349wwsm2aflnv4-kcoreaddons-5.70.0/share:/gnu/store/9ln7cv5s813nf4ny5l56qadq0vnkx5g0-kdeclarative-5.70.0/share:/gnu/store/fg8npcm84k5bii5jpmdypqdwq10k5xrf-ki18n-5.70.0/share:/gnu/store/0b7xb35ihp5h5qzfcdymzi7yn5lngsgf-kiconthemes-5.70.0/share:/gnu/store/gdch1j5vjjzzx9qq29zca2w83h8nz9rj-kitemviews-5.70.0/share:/gnu/store/q8wrlw1g0m35syx5sr3hq44sx6fsxicj-kqtquickcharts-20.04.1/share:/gnu/store/xhcgpv14llkcdcdn39vrm12mbl4b4y07-ktextwidgets-5.70.0/share:/gnu/store/f4ibdx1ldiifdjbpyh75py4q8i24b05w-kwidgetsaddons-5.70.0/share:/gnu/store/x27qq3i8c3vifrj1q5y9p8840k5dvk40-kwindowsystem-5.70.0/share:/gnu/store/ybdzlpnswajsq1acp3l768h21bvzif16-kxmlgui-5.70.0/share:/gnu/store/3x6y8kpbwjmzpndjfhdbn654g7dm85cp-libxcb-1.14/share:/gnu/store/c7vrkq864hsxfvll74wlrxv71arkcd5q-libxkbfile-1.1.0/share:/gnu/store/sbf77k7xzwhkx4ygqjzgkviz9vy4qhf6-qtbase-5.15.2/share:/gnu/store/k6kk02q27nbymwajkvzhlil8c7sym74k-qtdeclarative-5.15.2/share:/gnu/store/hpirydj1mlmhj199z1ng3yn9sb0f1jc1-qtgraphicaleffects-5.15.2/share:/gnu/store/8165pcgy2d1l30vipkv5qz40nkg9qdp3-qtquickcontrols2-5.15.2/share:/gnu/store/63g70yiyvz08v16hdxsnj3c2pqdq9bm0-qtx11extras-5.15.2/share:/gnu/store/9hpw67pf9px9zx75nb8bm21pc0gqwyx9-qtxmlpatterns-5.15.2/share:/gnu/store/gfapkk5c6hvl1d94m4sqnhn7f9l5gqyh-linux-libre-headers-5.4.20/share:/gnu/store/lfizifxrrbmb9dd1wdm5yy7rlqp7mmfp-kservice-5.70.0/share:/gnu/store/yqaafdggah0hac4n6dkw69ib94v03w69-kcodecs-5.70.0/share:/gnu/store/1syzh2ky8qgxzg59g0g97pqn1gb6xm1r-kauth-5.70.0/share:/gnu/store/s7a55hh8gd8r9dr6m04sqxg5kgngnqcj-kpackage-5.70.0/share:/gnu/store/cizh7vg0w09izkv07pxdv8csir8p4sdd-python-3.8.2/share:/gnu/store/n9wx4dp68bfsw9bb1bwmklzl34ggrmgm-gettext-minimal-0.20.1/share:/gnu/store/rqsn0is9frgi7jz1633l4ipa07xfgsbx-sonnet-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/store/k30a2pgmc6b3ifmq3rn0dr5ng9gr8w81-which-2.21/share:/gnu/store/14qgm67plbh8d3m6lc87b9j6s9296vwn-mesa-20.2.4/share:/gnu/store/wxl57nkbqgamfp73b7v62kk3f1hiv0cz-xorgproto-2019.2/share:/gnu/store/qv7x7pz7gi724lkdz8049mjhy1ryg511-libxxf86vm-1.1.4/share:/gnu/store/jwga98k68l0h5c45jx7z4jdjzhfc34vm-libxshmfence-1.3/share:/gnu/store/1v6vap6jaf3hf4ypjx261k44xmc48drc-libxfixes-5.0.3/share:/gnu/store/b67b0a5vda7pv7yqyjjb9736s96hhybi-libxdamage-1.1.5/share:/gnu/store/rwkqxykm91a75w9afhb41saj0dmf30hw-libx11-1.6.12/share:/gnu/store/kx58xc3hxa9b0mp1hl7pzz43bl7gh18h-libdrm-2.4.103/share:/gnu/store/lc8irxnwazq340ygkbqh0ask446jzy9k-util-macros-1.19.2/share:/gnu/store/3rmazp46f6g8w9qs8n3w7qcg8hhs1lig-libxext-1.3.4/share"
This is bad for the closure size and probably not good for applicationstartup time either.
The problem seems that ‘variables-for-wrapping’ in qt-build-system.scmis too naive: it collects in XDG_DATA_DIRS all the /share directories.Conversely, ‘data-directories’ in glib-or-gtk-build-system.scm is a bitmore subtle, keeping only meaningful share/ directories.
I think qt-build-system.scm should copy that strategy.
Thoughts?
Ludo’.
L
L
Ludovic Courtès wrote on 3 Apr 21:41 +0200
control message for bug #47569
(address . control@debbugs.gnu.org)
87a6qfxij7.fsf@gnu.org
severity 47569 importantquit
M
M
Maxim Cournoyer wrote on 4 Apr 05:00 +0200
Re: bug#47569: ‘qt-build-system’ retains too many references via wrappers
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47569@debbugs.gnu.org)
87blaurbya.fsf@gmail.com
Hi Ludovic!
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (18 lines)> I just noticed this:>> $ guix size ktouch | tail -1> total: 1752.4 MiB>>> Sounds a lot for a touch typing tutor.>> Turns out ktouch references all its build-time dependencies: gcc,> glibc:static, binutils, findutils, everything. It comes from the> wrapper:>> $ grep -r s3dcqzwqaakv1yx37by9chksdbkgih17 /gnu/store/w8i63ghrq64r7f1nxzw50b0j32f2n8v1-ktouch-20.12.1> /gnu/store/w8i63ghrq64r7f1nxzw50b0j32f2n8v1-ktouch-20.12.1/bin/ktouch:export XDG_DATA_DIRS="/gnu/store/w8i63ghrq64r7f1nxzw50b0j32f2n8v1-ktouch-20.12.1/share:/gnu/store/ah4az84vjkrssdws7ydvdk1f1mcs70i6-cmake-minimal-3.16.5/share:/gnu/store/3x63j4ndhbzkjwr6mhnp4h86r550gs7q-extra-cmake-modules-5.70.0/share:/gnu/store/qcqghpj3550p94pyqwqmwyd3nqcwflpq-kdoctools-5.70.0/share:/gnu/store/krpyb0zi700dcrg9cc8932w4v0qivdg9-pkg-config-0.29.2/share:/gnu/store/v6f44zccwh9z5zk3pjlywjybbi8n2hjh-tar-1.32/share:/gnu/store/ncydgq2znms5n1d2k5yqshhf58nsixwv-gzip-1.10/share:/gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-1.0.8/share:/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/share:/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/share:/gnu/store/n4n560pfvvw50a9369axw5vj5rrqfj1n-diffutils-3.7/share:/gnu/store/cd5qf3kcnlq35p9k392pjdpdzpsnds70-patch-2.7.6/share:/gnu/store/hic7snhayfl7m6cpfqqr73nmm19bpqkg-findutils-4.7.0/share:/gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/share:/gnu/store/ishk7fswcs4gkwcp8mh788z4mvvl9bxh-sed-4.8/share:/gnu/store/bhs4rj58v8j1narb2454raan2ps38xd8-grep-3.4/share:/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/share:/gnu/store/hm40bxnv8jxmbc1lpb7zfimii4xm9m81-make-4.3/share:/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/share:/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-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/nnri2x0mdfm2y2ci0p5jhlf6xkdsf6i6-kcmutils-5.70.0/share:/gnu/store/ybh1br5ghs1brnwvacfj04jx3203m87p-kcompletion-5.70.0/share:/gnu/store/bnfcann370ad38g7v4pzgklmizk69f7j-kconfig-5.70.0/share:/gnu/store/4w9v0jnx74n542v11ikzxbf352xqrpwy-kconfigwidgets-5.70.0/share:/gnu/store/9nr52vkhj99g4mx1rr349wwsm2aflnv4-kcoreaddons-5.70.0/share:/gnu/store/9ln7cv5s813nf4ny5l56qadq0vnkx5g0-kdeclarative-5.70.0/share:/gnu/store/fg8npcm84k5bii5jpmdypqdwq10k5xrf-ki18n-5.70.0/share:/gnu/store/0b7xb35ihp5h5qzfcdymzi7yn5lngsgf-kiconthemes-5.70.0/share:/gnu/store/gdch1j5vjjzzx9qq29zca2w83h8nz9rj-kitemviews-5.70.0/share:/gnu/store/q8wrlw1g0m35syx5sr3hq44sx6fsxicj-kqtquickcharts-20.04.1/share:/gnu/store/xhcgpv14llkcdcdn39vrm12mbl4b4y07-ktextwidgets-5.70.0/share:/gnu/store/f4ibdx1ldiifdjbpyh75py4q8i24b05w-kwidgetsaddons-5.70.0/share:/gnu/store/x27qq3i8c3vifrj1q5y9p8840k5dvk40-kwindowsystem-5.70.0/share:/gnu/store/ybdzlpnswajsq1acp3l768h21bvzif16-kxmlgui-5.70.0/share:/gnu/store/3x6y8kpbwjmzpndjfhdbn654g7dm85cp-libxcb-1.14/share:/gnu/store/c7vrkq864hsxfvll74wlrxv71arkcd5q-libxkbfile-1.1.0/share:/gnu/store/sbf77k7xzwhkx4ygqjzgkviz9vy4qhf6-qtbase-5.15.2/share:/gnu/store/k6kk02q27nbymwajkvzhlil8c7sym74k-qtdeclarative-5.15.2/share:/gnu/store/hpirydj1mlmhj199z1ng3yn9sb0f1jc1-qtgraphicaleffects-5.15.2/share:/gnu/store/8165pcgy2d1l30vipkv5qz40nkg9qdp3-qtquickcontrols2-5.15.2/share:/gnu/store/63g70yiyvz08v16hdxsnj3c2pqdq9bm0-qtx11extras-5.15.2/share:/gnu/store/9hpw67pf9px9zx75nb8bm21pc0gqwyx9-qtxmlpatterns-5.15.2/share:/gnu/store/gfapkk5c6hvl1d94m4sqnhn7f9l5gqyh-linux-libre-headers-5.4.20/share:/gnu/store/lfizifxrrbmb9dd1wdm5yy7rlqp7mmfp-kservice-5.70.0/share:/gnu/store/yqaafdggah0hac4n6dkw69ib94v03w69-kcodecs-5.70.0/share:/gnu/store/1syzh2ky8qgxzg59g0g97pqn1gb6xm1r-kauth-5.70.0/share:/gnu/store/s7a55hh8gd8r9dr6m04sqxg5kgngnqcj-kpackage-5.70.0/share:/gnu/store/cizh7vg0w09izkv07pxdv8csir8p4sdd-python-3.8.2/share:/gnu/store/n9wx4dp68bfsw9bb1bwmklzl34ggrmgm-gettext-minimal-0.20.1/share:/gnu/store/rqsn0is9frgi7jz1633l4ipa07xfgsbx-sonnet-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/store/k30a2pgmc6b3ifmq3rn0dr5ng9gr8w81-which-2.21/share:/gnu/store/14qgm67plbh8d3m6lc87b9j6s9296vwn-mesa-20.2.4/share:/gnu/store/wxl57nkbqgamfp73b7v62kk3f1hiv0cz-xorgproto-2019.2/share:/gnu/store/qv7x7pz7gi724lkdz8049mjhy1ryg511-libxxf86vm-1.1.4/share:/gnu/store/jwga98k68l0h5c45jx7z4jdjzhfc34vm-libxshmfence-1.3/share:/gnu/store/1v6vap6jaf3hf4ypjx261k44xmc48drc-libxfixes-5.0.3/share:/gnu/store/b67b0a5vda7pv7yqyjjb9736s96hhybi-libxdamage-1.1.5/share:/gnu/store/rwkqxykm91a75w9afhb41saj0dmf30hw-libx11-1.6.12/share:/gnu/store/kx58xc3hxa9b0mp1hl7pzz43bl7gh18h-libdrm-2.4.103/share:/gnu/store/lc8irxnwazq340ygkbqh0ask446jzy9k-util-macros-1.19.2/share:/gnu/store/3rmazp46f6g8w9qs8n3w7qcg8hhs1lig-libxext-1.3.4/share">> This is bad for the closure size and probably not good for application> startup time either.
Oh! Good finding! That probably explains why my experiments producinga guix pack for jami-qt was yielding an archive that'd decompress to 2.7GiB!
Toggle quote (9 lines)> The problem seems that ‘variables-for-wrapping’ in qt-build-system.scm> is too naive: it collects in XDG_DATA_DIRS all the /share directories.> Conversely, ‘data-directories’ in glib-or-gtk-build-system.scm is a bit> more subtle, keeping only meaningful share/ directories.>> I think qt-build-system.scm should copy that strategy.>> Thoughts?
I'm not sure why a wrapper is needed in the first place; theseenvironment variables are honored by qtbase and defined as search pathspecifications. It seems if we were to fix '22138 important Searchpaths of dependencies are not honored' we might not have to wrap at all,unless we really want to be able to run things outside of a profile(directly from the store) -- which is a nice property, but comes at thecost of wrappers ugliness (e.g., running 'gdb --args sh/path/to/wrapper', then having to load the symbols with 'file/path/to/.the-binary-real; or that wrapper's name appearing in manpagesor other places).
But for the short term, perhaps it's best to copy that strategy?
Thanks for the report!
Maxim
L
L
Ludovic Courtès wrote on 5 Apr 21:48 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 47569@debbugs.gnu.org)
878s5wseaz.fsf@gnu.org
Hi Maxim!
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
Toggle quote (13 lines)> I'm not sure why a wrapper is needed in the first place; these> environment variables are honored by qtbase and defined as search path> specifications. It seems if we were to fix '22138 important Search> paths of dependencies are not honored' we might not have to wrap at all,> unless we really want to be able to run things outside of a profile> (directly from the store) -- which is a nice property, but comes at the> cost of wrappers ugliness (e.g., running 'gdb --args sh> /path/to/wrapper', then having to load the symbols with 'file> /path/to/.the-binary-real; or that wrapper's name appearing in manpages> or other places).>> But for the short term, perhaps it's best to copy that strategy?
Agreed on all points. :-) Wrappers are ugly, but they’re necessary,often independently of whether #22138 is fixed. In this case, they’reneeded so that GLib, Qt, and all their friends find the files they careabout.
Ludo’.
L
L
Ludovic Courtès wrote on 6 Apr 15:17 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 47569@debbugs.gnu.org)
87r1jnmu0v.fsf@gnu.org
Hi,
For the record, changing ‘qt-build-system’ would trigger a rebuild ofless than 400 packages according to the back-of-the-envelope calculationbelow. In that case, it’s tempting to fix on ‘master’ and include it inthe release.
Thoughts?
Ludo’.
Toggle snippet (18 lines)scheme@(guile-user)> ,use(gnu)scheme@(guile-user)> ,use(guix build-system qt)scheme@(guile-user)> ,use(guix)scheme@(guile-user)> (define qtpkgs (fold-packages (lambda (pkg lst) (if (eq? (package-build-system pkg) qt-build-system) (cons pkg lst) lst)) '()))scheme@(guile-user)> (length qtpkgs)$78 = 186scheme@(guile-user)> ,use(guix graph)scheme@(guile-user)> ,run-in-store (node-edges (@ (guix scripts graph) %reverse-package-node-type) (fold-packages cons '()))$79 = #<procedure 7fe494f11520 at guix/graph.scm:94:17 (node)>scheme@(guile-user)> (node-reachable-count qtpkgs $79)$80 = 180scheme@(guile-user)> (+ 186 180)$81 = 366
E
E
Efraim Flashner wrote on 6 Apr 15:43 +0200
Re: bug#47569: ‘qt-build- system’ retains too many references via wrappers
(name . Ludovic Courtès)(address . ludo@gnu.org)
YGxlkh56q8qFj+dn@3900XT
On Tue, Apr 06, 2021 at 03:17:52PM +0200, Ludovic Courtès wrote:
Toggle quote (10 lines)> Hi,> > For the record, changing ‘qt-build-system’ would trigger a rebuild of> less than 400 packages according to the back-of-the-envelope calculation> below. In that case, it’s tempting to fix on ‘master’ and include it in> the release.> > Thoughts?>
There are a couple of other things we want to change with theqt-build-system and the wrappers. Another one is changing the wrappersso they prefix (or was it suffix?) QT_QPA_PLUGIN (and I think others) sothey can run natively on wayland. I think it would be a goodimprovement and worth it.
Toggle quote (25 lines)> Ludo’.> > --8<---------------cut here---------------start------------->8---> scheme@(guile-user)> ,use(gnu)> scheme@(guile-user)> ,use(guix build-system qt)> scheme@(guile-user)> ,use(guix)> scheme@(guile-user)> (define qtpkgs (fold-packages (lambda (pkg lst)> (if (eq? (package-build-system pkg) qt-build-system)> (cons pkg lst)> lst))> '()))> scheme@(guile-user)> (length qtpkgs)> $78 = 186> scheme@(guile-user)> ,use(guix graph)> scheme@(guile-user)> ,run-in-store (node-edges (@ (guix scripts graph) %reverse-package-node-type) (fold-packages cons '()))> $79 = #<procedure 7fe494f11520 at guix/graph.scm:94:17 (node)>> scheme@(guile-user)> (node-reachable-count qtpkgs $79)> $80 = 180> scheme@(guile-user)> (+ 186 180)> $81 = 366> --8<---------------cut here---------------end--------------->8---> > >
-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmBsZY8ACgkQQarn3Mo9g1F8OBAAjTfTmSpnKkqHu7eXiKi8PSP52FocsGGtjyphqee1xIlXEyMVHv+k/i/geZaTRy0s78E/YO80eofpn1rdlGm+covnEwa3Edgi/dsQKgqaWQYuVzdMU1NeplAZ6B7w4GFtCnhOvVDKj24QZ8u/IrD4pm6Ef5PFWfiTOHJ4gbx2HXarwXXnvZACYVaBvx0ciofodEkO2P/PHzPnZQ9XgR7bpi6EKd/pV4IfTzhmDTvaogN0+cyFJTJ4n/awIfMzg3R4wTP6I7Quk9oQNmux3KqfYl3OzkqyaMB7xT3GpS8l4gfqsMARhGYv+FbqseBObZMRJMIDnDTQ1a9oHSXAHODQBRA5YoSewZgV3UuzfaK/OIkcSAkyeHHUXZBVCjV1eRTPsCYTve0sC5ZAFt9cLw8C96oRqWC/v4ECMsw1b/e/o8qXi+RRWRgMaVzdgKAY4KjPmC5BTc27Rtg/wLY+6cpD1Mt7RHRUGPcn6A6QLqafTyHWlBVX36BHc7wLCosngEaOEsCbsyaSIEevCId/MSwuONYEMMTh+O2xS5125lEOW0rNkOjvJS/Edur4LP2Kp3Q4tRlcfbm9PSBK1KagjC9qDsyyy6nVaicuSPSP41+F0yEZ+Gcm5B6piFQakPCePrXtDwQaIe3nsF7EkbX9WvGuzL1FPcO5qa9slMYqXYprLTU==aCQF-----END PGP SIGNATURE-----

E
E
Efraim Flashner wrote on 6 Apr 15:57 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)
YGxoz3E8EJd+N7Am@3900XT
On Tue, Apr 06, 2021 at 04:43:46PM +0300, Efraim Flashner wrote:
Toggle quote (17 lines)> On Tue, Apr 06, 2021 at 03:17:52PM +0200, Ludovic Courtès wrote:> > Hi,> > > > For the record, changing ‘qt-build-system’ would trigger a rebuild of> > less than 400 packages according to the back-of-the-envelope calculation> > below. In that case, it’s tempting to fix on ‘master’ and include it in> > the release.> > > > Thoughts?> > > > There are a couple of other things we want to change with the> qt-build-system and the wrappers. Another one is changing the wrappers> so they prefix (or was it suffix?) QT_QPA_PLUGIN (and I think others) so> they can run natively on wayland. I think it would be a good> improvement and worth it.
A quick search pulls up the following bugs: 43446 44982 45193 45221 45784.Looks like there's a lot of desire to see it adjusted.
Toggle quote (32 lines)> > Ludo’.> > > > --8<---------------cut here---------------start------------->8---> > scheme@(guile-user)> ,use(gnu)> > scheme@(guile-user)> ,use(guix build-system qt)> > scheme@(guile-user)> ,use(guix)> > scheme@(guile-user)> (define qtpkgs (fold-packages (lambda (pkg lst)> > (if (eq? (package-build-system pkg) qt-build-system)> > (cons pkg lst)> > lst))> > '()))> > scheme@(guile-user)> (length qtpkgs)> > $78 = 186> > scheme@(guile-user)> ,use(guix graph)> > scheme@(guile-user)> ,run-in-store (node-edges (@ (guix scripts graph) %reverse-package-node-type) (fold-packages cons '()))> > $79 = #<procedure 7fe494f11520 at guix/graph.scm:94:17 (node)>> > scheme@(guile-user)> (node-reachable-count qtpkgs $79)> > $80 = 180> > scheme@(guile-user)> (+ 186 180)> > $81 = 366> > --8<---------------cut here---------------end--------------->8---> > > > > > > > -- > Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351> Confidentiality cannot be guaranteed on emails sent or received unencrypted


-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmBsaMwACgkQQarn3Mo9g1F1/w/8C9uvydcmqmu8FnHdqVAsr4Kfqfs6oakHt5EyW6h6DbLxkfhTwWTUIxg+kQFisBNF07RNwfkEHf/tVOg2cyiLNlQZVyMv1HHcqAs2hpbyxJimb1gra1VSHLVHG1NM9O2KsKuyyLHhmJP5TFrHhPWWPVkW0fcKzxgeSbheYMdyJHbjCjr4XJbylezZ6eWFnh3tTNpcDdZQAS2NsQdvsevcUu7hWIFD6lkkIebmN/BVJKhIs18Stk9ppWsUFAL60Jtg8MjK56YkIiOJQGIxpw6u2982oxYnKPe6fyxdQB5Oa7qsn/7VQxZOrYKjQUZk1P7b8RJ2dY/RYOJ146laKRrQvwPzHrrTgGhIQTMQfrpxB4QtxH/QrAoPkS//E1WE9XC7y778jVjhwYviR7f8sKlh/7UQbuecRVZ7vdq82XGp7YDj2HzopNkteY2IEpWMtVcHSb5J7OOhooQ9EfsUzTmES4NOQv4W4ET6PpMrBXvyketpHrDxnjzjvYnbA1V5DVgJjTR8tmsp6fSV547HroBZqaoIKo/qsc4DkeSh5A/3p5YuHMarsJ02Gk3ho6HOzmzndAiclZxeekvGfpX1IuHe7XO83jYKD/mMsoTkNaZN8r5Y1prvKDzqouqGGCPlSR6jal+4ysFdb6GunsbHiguaJBZN0uZszjvAfmcavJ/KgB0==FG5I-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 6 Apr 19:43 +0200
Re: bug#47569: ‘qt-build-system’ retains too many references via wrappers
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 47569@debbugs.gnu.org)
87zgybl35g.fsf@gnu.org
Hi again!
The attached patch fixes this problem AFAICS by filtering out ofXDG_DATA_DIRS directories that are unlikely to be of any use. Itfollows the same strategy as ‘glib-or-gtk-build-system’, which is toonly include share/ sub-directories that also contain one of the given“selectors”: /glib-2.0/schemas, /sounds, /themes, etc.
It gives me a working ktouch, with a wrapper sets a much shorterXDG_DATA_DIR:
Toggle snippet (8 lines)$ head -2 $(./pre-inst-env guix build --no-grafts ktouch)/bin/ktouch#!/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bashexport XDG_DATA_DIRS="/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/bashexport XDG_DATA_DIRS="/gnu/store/f821syw55jd0l04xkmnbvp562flrw6fm-ktouch-20.12.1/share:/gnu/store/3dsl2jalrcyldkrsqab1hc6sv8pyag9z-cmake-minimal-3.16.5/share:/gnu/store/3x63j4ndhbzkjwr6mhnp4h86r550gs7q-extra-cmake-modules-5.70.0/share:/gnu/store/w08sglxbfpmcvz25pfgnq7v27m1rlkf9-kdoctools-5.70.0/share:/gnu/store/krpyb0zi700dcrg9cc8932w4v0qivdg9-pkg-config-0.29.2/share:/gnu/store/v6f44zccwh9z5zk3pjlywjybbi8n2hjh-tar-1.32/share:/gnu/store/ncydgq2znms5n1d2k5yqshhf58nsixwv-gzip-1.10/share:/gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-1.0.8/share:/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/share:/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/share:/gnu/store/n4n560pfvvw50a9369axw5vj5rrqfj1n-diffutils-3.7/share:/gnu/store/cd5qf3kcnlq35p9k392pjdpdzpsnds70-patch-2.7.6/share:/gnu/store/hic7snhayfl7m6cpfqqr73nmm19bpqkg-findutils-4.7.0/share:/gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/share:/gnu/store/ishk7fswcs4gkwcp8mh788z4mvvl9bxh-sed-4.8/share:/gnu/store/bhs4rj58v8j1narb2454raan2ps38xd8-grep-3.4/share:/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/share:/gnu/store/hm40bxnv8jxmbc1lpb7zfimii4xm9m81-make-4.3/share:/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/share:/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-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/3vdmy5gjn1a23ky6l907byc3917xfh2a-kcompletion-5.70.0/share:/gnu/store/ba8nl7wflsf1s95x72kpaj0rzval908b-kconfig-5.70.0/share:/gnu/store/r4120j3v7cnv5qlmp2kqb6xbc63gplpa-kconfigwidgets-5.70.0/share:/gnu/store/5g95qdh0p46qszv199rmdd2lx4mninm7-kcoreaddons-5.70.0/share:/gnu/store/lbq73h2snwpn4wf9wkp8j0rxw0lyhyp4-kdeclarative-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:/gnu/store/5mfz0faj9lc9m1ppijgqkxz03j89dyil-ktextwidgets-5.70.0/share:/gnu/store/fwmp85k5hqy7fw0rnq5560pg4amiblz4-kwidgetsaddons-5.70.0/share:/gnu/store/xslnsy6sxjp66l99mvj67v1x30bh55xi-kwindowsystem-5.70.0/share:/gnu/store/n79ns6y3cc7ny4mkp5qidf57j1cxbg6p-kxmlgui-5.70.0/share:/gnu/store/3x6y8kpbwjmzpndjfhdbn654g7dm85cp-libxcb-1.14/share:/gnu/store/zc9bpa1v46cnqc05xk8njm08bwk8a70m-libxkbfile-1.1.0/share:/gnu/store/j7110r2rhs9pdypx2x0h8nx4r082fbdk-qtbase-5.15.2/share:/gnu/store/8r5y5bnblc4s6w8j5sfxv06ra6lz12j8-qtdeclarative-5.15.2/share:/gnu/store/c020rcd650ikq7gqfnkga46kzis3v2hi-qtgraphicaleffects-5.15.2/share:/gnu/store/2iwman5hbgg15r99rshl6lsxz35dq2b2-qtquickcontrols2-5.15.2/share:/gnu/store/n7dbg5cgcpslrym4zmsimps1ch1p0q8w-qtx11extras-5.15.2/share:/gnu/store/7yjd1h08li3dr2188pfwfnwlq0p3av9p-qtxmlpatterns-5.15.2/share:/gnu/store/gfapkk5c6hvl1d94m4sqnhn7f9l5gqyh-linux-libre-headers-5.4.20/share:/gnu/store/kvdrfyi50zsmy0ykmc9p8qzjlahqfa4p-kservice-5.70.0/share:/gnu/store/yk425lbm0wnjpqm1z964l9l6li5x0wbn-kcodecs-5.70.0/share:/gnu/store/2z5nfmzxhqaalcrswp8nn3yk5ys8q261-kauth-5.70.0/share:/gnu/store/vhmyxywsdy92bgqxy6fnmcpr81xsfcys-kpackage-5.70.0/share:/gnu/store/rz42ba0my9vrgbkjpkzr2drmnjk5ah50-python-3.8.2/share:/gnu/store/n9wx4dp68bfsw9bb1bwmklzl34ggrmgm-gettext-minimal-0.20.1/share:/gnu/store/yqs5mkp20m58sr744cs2pn8sqb5m59sq-sonnet-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/store/k30a2pgmc6b3ifmq3rn0dr5ng9gr8w81-which-2.21/share:/gnu/store/7disnxqw8i3n4zhw5s0xj9kkdckkmr1p-mesa-20.2.4/share:/gnu/store/wxl57nkbqgamfp73b7v62kk3f1hiv0cz-xorgproto-2019.2/share:/gnu/store/c3zbbynb590yxrpwcxrkll80mn66h3kf-libxxf86vm-1.1.4/share:/gnu/store/jwga98k68l0h5c45jx7z4jdjzhfc34vm-libxshmfence-1.3/share:/gnu/store/9z9gd76la5bww3sqgg2ax0h00msl28k6-libxfixes-5.0.3/share:/gnu/store/2wysr1lr7b5mc444m39qz107n92xm5xq-libxdamage-1.1.5/share:/gnu/store/fx3979c88s9yxdbchyf36qryawgzpwb5-libx11-1.6.10/share:/gnu/store/kx58xc3hxa9b0mp1hl7pzz43bl7gh18h-libdrm-2.4.103/share:/gnu/store/lc8irxnwazq340ygkbqh0ask446jzy9k-util-macros-1.19.2/share:/gnu/store/qrs0p8j3wq6q5a4dm0ndjdavk9gyal5q-libxext-1.3.4/share"
The closure is still awfully big but smaller:
Toggle snippet (6 lines)$ ./pre-inst-env guix size ktouch | tail -1total: 1298.0 MiB$ guix size ktouch | tail -1total: 1752.4 MiB
Thoughts?
Ludo’.
Toggle diff (75 lines)diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scmindex 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 © 2014 Federico Beffa <beffa@fbengineering.ch>-;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>+;;; Copyright © 2014, 2015, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com> ;;;@@ -49,25 +49,44 @@ (define (variables-for-wrapping base-directories) - (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 subset+ ;; 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)) - (filter- (lambda (var-to-wrap) (not (null? (last var-to-wrap))))- (map- (lambda (var-spec)- `(,(first var-spec) = ,(collect-sub-dirs base-directories (last var-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 = ,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 packages+ ;; to XDG_DATA_DIRS just because they have a /share sub-directory.+ "/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")))) (define* (wrap-all-programs #:key inputs outputs (qt-wrap-excluded-outputs '())
L
L
Leo Famulari wrote on 6 Apr 19:45 +0200
Re: bug#47569: ‘qt-build- system’ retains too many references via wrappers
(name . Ludovic Courtès)(address . ludo@gnu.org)
YGyeJU+RLk+2SQks@jasmine.lan
On Tue, Apr 06, 2021 at 03:17:52PM +0200, Ludovic Courtès wrote:
Toggle quote (9 lines)> Hi,> > For the record, changing ‘qt-build-system’ would trigger a rebuild of> less than 400 packages according to the back-of-the-envelope calculation> below. In that case, it’s tempting to fix on ‘master’ and include it in> the release.> > Thoughts?
Let's do it.
After the release, I think we should reconsider those numbers. Comparedto when we set those guidelines, we have a lot more packages and a lotmore computing power.
L
L
Leo Famulari wrote on 6 Apr 19:45 +0200
(no subject)
(address . control@debbugs.gnu.org)
YGyeQrzSxBDRTrHa@jasmine.lan
block 47297 with 47569
M
M
Maxim Cournoyer wrote on 7 Apr 21:35 +0200
Re: bug#47569: ‘qt-build-system’ retains too many references via wrappers
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47569@debbugs.gnu.org)
87eeflopk9.fsf@gmail.com
Hi Ludovic,
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (30 lines)> 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 ‘glib-or-gtk-build-system’, which is to> only include share/ sub-directories that also contain one of the given> “selectors”: /glib-2.0/schemas, /sounds, /themes, etc.>> It gives me a working ktouch, with a wrapper sets a much shorter> XDG_DATA_DIR:>> $ 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="/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="/gnu/store/f821syw55jd0l04xkmnbvp562flrw6fm-ktouch-20.12.1/share:/gnu/store/3dsl2jalrcyldkrsqab1hc6sv8pyag9z-cmake-minimal-3.16.5/share:/gnu/store/3x63j4ndhbzkjwr6mhnp4h86r550gs7q-extra-cmake-modules-5.70.0/share:/gnu/store/w08sglxbfpmcvz25pfgnq7v27m1rlkf9-kdoctools-5.70.0/share:/gnu/store/krpyb0zi700dcrg9cc8932w4v0qivdg9-pkg-config-0.29.2/share:/gnu/store/v6f44zccwh9z5zk3pjlywjybbi8n2hjh-tar-1.32/share:/gnu/store/ncydgq2znms5n1d2k5yqshhf58nsixwv-gzip-1.10/share:/gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-1.0.8/share:/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/share:/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/share:/gnu/store/n4n560pfvvw50a9369axw5vj5rrqfj1n-diffutils-3.7/share:/gnu/store/cd5qf3kcnlq35p9k392pjdpdzpsnds70-patch-2.7.6/share:/gnu/store/hic7snhayfl7m6cpfqqr73nmm19bpqkg-findutils-4.7.0/share:/gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/share:/gnu/store/ishk7fswcs4gkwcp8mh788z4mvvl9bxh-sed-4.8/share:/gnu/store/bhs4rj58v8j1narb2454raan2ps38xd8-grep-3.4/share:/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/share:/gnu/store/hm40bxnv8jxmbc1lpb7zfimii4xm9m81-make-4.3/share:/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/share:/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-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/3vdmy5gjn1a23ky6l907byc3917xfh2a-kcompletion-5.70.0/share:/gnu/store/ba8nl7wflsf1s95x72kpaj0rzval908b-kconfig-5.70.0/share:/gnu/store/r4120j3v7cnv5qlmp2kqb6xbc63gplpa-kconfigwidgets-5.70.0/share:/gnu/store/5g95qdh0p46qszv199rmdd2lx4mninm7-kcoreaddons-5.70.0/share:/gnu/store/lbq73h2snwpn4wf9wkp8j0rxw0lyhyp4-kdeclarative-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:/gnu/store/5mfz0faj9lc9m1ppijgqkxz03j89dyil-ktextwidgets-5.70.0/share:/gnu/store/fwmp85k5hqy7fw0rnq5560pg4amiblz4-kwidgetsaddons-5.70.0/share:/gnu/store/xslnsy6sxjp66l99mvj67v1x30bh55xi-kwindowsystem-5.70.0/share:/gnu/store/n79ns6y3cc7ny4mkp5qidf57j1cxbg6p-kxmlgui-5.70.0/share:/gnu/store/3x6y8kpbwjmzpndjfhdbn654g7dm85cp-libxcb-1.14/share:/gnu/store/zc9bpa1v46cnqc05xk8njm08bwk8a70m-libxkbfile-1.1.0/share:/gnu/store/j7110r2rhs9pdypx2x0h8nx4r082fbdk-qtbase-5.15.2/share:/gnu/store/8r5y5bnblc4s6w8j5sfxv06ra6lz12j8-qtdeclarative-5.15.2/share:/gnu/store/c020rcd650ikq7gqfnkga46kzis3v2hi-qtgraphicaleffects-5.15.2/share:/gnu/store/2iwman5hbgg15r99rshl6lsxz35dq2b2-qtquickcontrols2-5.15.2/share:/gnu/store/n7dbg5cgcpslrym4zmsimps1ch1p0q8w-qtx11extras-5.15.2/share:/gnu/store/7yjd1h08li3dr2188pfwfnwlq0p3av9p-qtxmlpatterns-5.15.2/share:/gnu/store/gfapkk5c6hvl1d94m4sqnhn7f9l5gqyh-linux-libre-headers-5.4.20/share:/gnu/store/kvdrfyi50zsmy0ykmc9p8qzjlahqfa4p-kservice-5.70.0/share:/gnu/store/yk425lbm0wnjpqm1z964l9l6li5x0wbn-kcodecs-5.70.0/share:/gnu/store/2z5nfmzxhqaalcrswp8nn3yk5ys8q261-kauth-5.70.0/share:/gnu/store/vhmyxywsdy92bgqxy6fnmcpr81xsfcys-kpackage-5.70.0/share:/gnu/store/rz42ba0my9vrgbkjpkzr2drmnjk5ah50-python-3.8.2/share:/gnu/store/n9wx4dp68bfsw9bb1bwmklzl34ggrmgm-gettext-minimal-0.20.1/share:/gnu/store/yqs5mkp20m58sr744cs2pn8sqb5m59sq-sonnet-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/store/k30a2pgmc6b3ifmq3rn0dr5ng9gr8w81-which-2.21/share:/gnu/store/7disnxqw8i3n4zhw5s0xj9kkdckkmr1p-mesa-20.2.4/share:/gnu/store/wxl57nkbqgamfp73b7v62kk3f1hiv0cz-xorgproto-2019.2/share:/gnu/store/c3zbbynb590yxrpwcxrkll80mn66h3kf-libxxf86vm-1.1.4/share:/gnu/store/jwga98k68l0h5c45jx7z4jdjzhfc34vm-libxshmfence-1.3/share:/gnu/store/9z9gd76la5bww3sqgg2ax0h00msl28k6-libxfixes-5.0.3/share:/gnu/store/2wysr1lr7b5mc444m39qz107n92xm5xq-libxdamage-1.1.5/share:/gnu/store/fx3979c88s9yxdbchyf36qryawgzpwb5-libx11-1.6.10/share:/gnu/store/kx58xc3hxa9b0mp1hl7pzz43bl7gh18h-libdrm-2.4.103/share:/gnu/store/lc8irxnwazq340ygkbqh0ask446jzy9k-util-macros-1.19.2/share:/gnu/store/qrs0p8j3wq6q5a4dm0ndjdavk9gyal5q-libxext-1.3.4/share">>> The closure is still awfully big but smaller:>> $ ./pre-inst-env guix size ktouch | tail -1> total: 1298.0 MiB> $ guix size ktouch | tail -1> total: 1752.4 MiB>> Thoughts?>> Ludo’.
Thanks for the patch! I built jami-qt with it; the closure size wasreduced from 2.7 GiB to 2.2 GiB (there's probably more to do, but it's agood start!). It seems to work just as well as before the change, froma cursory look.
LGTM!
Thank you,
Maxim
M
M
Maxim Cournoyer wrote on 7 Apr 23:03 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47569@debbugs.gnu.org)
87sg41n6xm.fsf@gmail.com
Hi Ludo,
I just had another thought on this!
Ludovic Courtès <ludo@gnu.org> writes:
[...]
Toggle quote (39 lines)> - (filter> - (lambda (var-to-wrap) (not (null? (last var-to-wrap))))> - (map> - (lambda (var-spec)> - `(,(first var-spec) = ,(collect-sub-dirs base-directories (last var-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 = ,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 packages> + ;; to XDG_DATA_DIRS just because they have a /share sub-directory.> + "/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"))))>> (define* (wrap-all-programs #:key inputs outputs> (qt-wrap-excluded-outputs '())

Seeing a growing number of packages require a custom wrap phase forqtwebengine, I think the following additions could make sense to beincorporated as part as this Qt-world rebuild:
2 files changed, 5 insertions(+), 1 deletion(-)gnu/packages/qt.scm | 3 +++guix/build/qt-build-system.scm | 3 ++-
modified gnu/packages/qt.scm@@ -538,6 +538,9 @@ system, and the core design of Django is reused in Grantlee.") (search-path-specification (variable "QT_PLUGIN_PATH") (files '("lib/qt5/plugins")))+ (search-path-specification+ (variable "QTWEBENGINEPROCESS_PATH")+ (files '("lib/qt5/libexec/QtWebEngineProcess"))) (search-path-specification (variable "XDG_DATA_DIRS") (files '("share")))modified guix/build/qt-build-system.scm@@ -86,7 +86,8 @@ "/cursors" "/wallpapers" "/icons" "/mime") '("XDG_CONFIG_DIRS" "/etc/xdg") '("QT_PLUGIN_PATH" "/lib/qt5/plugins")- '("QML2_IMPORT_PATH" "/lib/qt5/qml"))))+ '("QML2_IMPORT_PATH" "/lib/qt5/qml")+ '("QTWEBENGINEPROCESS_PATH" "lib/qt5/libexec/QtWebEngineProcess"))))
(define* (wrap-all-programs #:key inputs outputs (qt-wrap-excluded-outputs '())
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 7 Apr 23:23 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 47569@debbugs.gnu.org)
87o8epn60m.fsf@gmail.com
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
Toggle quote (20 lines)> Seeing a growing number of packages require a custom wrap phase for> qtwebengine, I think the following additions could make sense to be> incorporated as part as this Qt-world rebuild:>> 2 files changed, 5 insertions(+), 1 deletion(-)> gnu/packages/qt.scm | 3 +++> guix/build/qt-build-system.scm | 3 ++->> modified gnu/packages/qt.scm> @@ -538,6 +538,9 @@ system, and the core design of Django is reused in Grantlee.")> (search-path-specification> (variable "QT_PLUGIN_PATH")> (files '("lib/qt5/plugins")))> + (search-path-specification> + (variable "QTWEBENGINEPROCESS_PATH")> + (files '("lib/qt5/libexec/QtWebEngineProcess")))> (search-path-specification> (variable "XDG_DATA_DIRS")> (files '("share")))
Actually, scratch that part above, as there's already a search pathdefined on the qtwebengine package, and it's more correctly defined as:
(native-search-paths (list (search-path-specification (file-type 'regular) (separator #f) (variable "QTWEBENGINEPROCESS_PATH") (files '("lib/qt5/libexec/QtWebEngineProcess"))))) So what I proposed above is not needed.
Toggle quote (12 lines)> modified guix/build/qt-build-system.scm> @@ -86,7 +86,8 @@> "/cursors" "/wallpapers" "/icons" "/mime")> '("XDG_CONFIG_DIRS" "/etc/xdg")> '("QT_PLUGIN_PATH" "/lib/qt5/plugins")> - '("QML2_IMPORT_PATH" "/lib/qt5/qml"))))> + '("QML2_IMPORT_PATH" "/lib/qt5/qml")> + '("QTWEBENGINEPROCESS_PATH" "lib/qt5/libexec/QtWebEngineProcess"))))>> (define* (wrap-all-programs #:key inputs outputs> (qt-wrap-excluded-outputs '())
Still is still useful I think, but I noticed now it needs a leadingslash in from of the lib/qt5/libexec above.
Thanks,
Maxim
L
L
Ludovic Courtès wrote on 8 Apr 23:32 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 47569-done@debbugs.gnu.org)
87o8eo8ntf.fsf@gnu.org
Hi!
Pushed fix as c5fd1b0bd362f8b8578a76a26a65ba5d00d48992.
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
Toggle quote (4 lines)>> Seeing a growing number of packages require a custom wrap phase for>> qtwebengine, I think the following additions could make sense to be>> incorporated as part as this Qt-world rebuild:
[...]
Toggle quote (9 lines)>> modified guix/build/qt-build-system.scm>> @@ -86,7 +86,8 @@>> "/cursors" "/wallpapers" "/icons" "/mime")>> '("XDG_CONFIG_DIRS" "/etc/xdg")>> '("QT_PLUGIN_PATH" "/lib/qt5/plugins")>> - '("QML2_IMPORT_PATH" "/lib/qt5/qml"))))>> + '("QML2_IMPORT_PATH" "/lib/qt5/qml")>> + '("QTWEBENGINEPROCESS_PATH" "lib/qt5/libexec/QtWebEngineProcess"))))
And done in 06eb21856f9535ab62d0becc92b4146e0620654e. Now we can removesome of these custom phases!
Ludo’.
Closed
L
L
Ludovic Courtès wrote on 8 Apr 23:38 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 47569@debbugs.gnu.org)
87im4w8niy.fsf@gnu.org
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
Toggle quote (5 lines)> Thanks for the patch! I built jami-qt with it; the closure size was> reduced from 2.7 GiB to 2.2 GiB (there's probably more to do, but it's a> good start!). It seems to work just as well as before the change, from> a cursory look.
Regarding the closure size, the top packages and the usual suspects:
Toggle snippet (13 lines)$ ./pre-inst-env guix size ktouch | headstore item total self/gnu/store/rv567nsh90bqz5gfh6sh1g84jccxcifa-llvm-11.0.0 220.0 148.6 11.4%/gnu/store/7disnxqw8i3n4zhw5s0xj9kkdckkmr1p-mesa-20.2.4 389.1 141.6 10.9%/gnu/store/j7110r2rhs9pdypx2x0h8nx4r082fbdk-qtbase-5.15.2 976.2 80.0 6.2%/gnu/store/rz42ba0my9vrgbkjpkzr2drmnjk5ah50-python-3.8.2 171.4 79.8 6.1%/gnu/store/8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2 146.2 57.1 4.4%/gnu/store/a5m2xzsv3ff1gsh4pkdxbv99nchmlkhq-mozjs-60.2.3-2 248.3 54.7 4.2%/gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2 132.8 53.2 4.1%/gnu/store/ckwyq3y43i33s5fl9hb6c51418rh1qwj-icu4c-66.1 110.2 38.1 2.9%/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 38.4 36.7 2.8%
There’s a preliminary patch to improve the LLVM situation athttps://issues.guix.gnu.org/42576. I’m sure we can also do a betterjob on the size of those other things.
A bit of a shame that mozjs shows up here; that’s because of Polkit:
Toggle snippet (8 lines)$ ./pre-inst-env guix graph --path ktouch mozjs@60 -t references/gnu/store/179ifxjb2kvapzydsnkh2vylhnx79kkk-ktouch-20.12.1/gnu/store/2z5nfmzxhqaalcrswp8nn3yk5ys8q261-kauth-5.70.0/gnu/store/vg0lwx182c63icfj60bi4gfk4s9bh1rf-polkit-qt-1-0.112.0/gnu/store/9zijxjyrpg54csx3sam8hmsvrjgqw4zm-polkit-0.116/gnu/store/a5m2xzsv3ff1gsh4pkdxbv99nchmlkhq-mozjs-60.2.3-2
(It’ll be worse when Polkit depends on Rust…)
Ludo’.
?