On Sun, Dec 17, 2023 at 06:22:19AM +0000, John Kehayias wrote: > Hi Guix, > > Quick(?) question if someone happens to know: can we separate out the tk dependency from the python package, for instance by making the tk output of python a separate package? > > I'm asking because I've realized that it is through tk that python, and thus a good chunk of all packages, depend on things like libx11 and xorgproto. In updating xorgproto for xorg-server-xwayland update, this causes python to be rebuilt. I saw the same when ungrafting libx11 but didn't look close enough to realize it is through tk. > > (As an aside, in using python as a user, it is easy to miss the python:tk output when you need it. And without searching I'm guessing many fewer packages depend on python:tk than the default output.) > > I don't know enough about how python is built (and then used in building) off the top of my head to know if this is possible. But if it was, I think it could untangle lots of the package graph. > > Thanks in advance! > John $ ./pre-inst-env guix build --no-grafts python /gnu/store/bvbrc8df75sfaxk7365xwwga5iy8xg57-python-3.10.7-idle /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7 /gnu/store/vpip7zvwps9nwzn13m9x942q2za21rfq-python-3.10.7-tk $ guix gc --references /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7 /gnu/store/2w976k6g70gkfih9wwhalqsni209vcqz-gdbm-1.23 /gnu/store/4jakqiibsvrkv4jdw1wyl6racrwv9bkh-sqlite-3.39.3 /gnu/store/69wd3pd1hd3j84xr965jj2fk2qmxn0hl-openssl-3.0.8 /gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8 /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7 /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib /gnu/store/bcc053jvsbspdjr17gnnd9dg85b3a0gy-ncurses-6.2.20210619 /gnu/store/fw1wywd34vh33l4dq182ds5d7jdz45j5-expat-2.5.0 /gnu/store/gqsxab8w881ds9raxkv74k0xcjds3z10-tcl-8.6.12 /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35 /gnu/store/lxfc2a05ysi7vlaq0m3w5wsfsy0drdlw-readline-8.1.2 /gnu/store/pl09vk5g3cl8fxfln2hjk996pyahqk8m-bzip2-1.0.8 /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16 /gnu/store/slzq3zqwj75lbrg4ly51hfhbv2vhryv5-zlib-1.2.13 /gnu/store/vzl3lmb1lh702wvb3l1b3dzs2391lp02-tk-8.6.12 /gnu/store/w8b0l8hk6g0fahj4fvmc4qqm3cvaxnmv-libffi-3.4.4 $ grep /gnu/store/vzl3lmb1lh702wvb3l1b3dzs2391lp02-tk-8.6.12 -R /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7 grep: /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7/lib/python3.10/__pycache__/_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.opt-1.pyc: binary file matches grep: /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7/lib/python3.10/__pycache__/_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.opt-2.pyc: binary file matches grep: /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7/lib/python3.10/__pycache__/_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc: binary file matches /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7/lib/python3.10/_sysconfigdata__linux_x86_64-linux-gnu.py: '-L/gnu/store/vzl3lmb1lh702wvb3l1b3dzs2391lp02-tk-8.6.12/lib ' /gnu/store/91wasjkmy50p8fq0rf9jby80mnmq1fxr-python-3.10.7/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile:TCLTK_LIBS= -L/gnu/store/gqsxab8w881ds9raxkv74k0xcjds3z10-tcl-8.6.12/lib -L/gnu/store/vzl3lmb1lh702wvb3l1b3dzs2391lp02-tk-8.6.12/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6 Checking through the python sources: New in python-3.6.0-alpha 3: - bpo-23968: Rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install the platform specific _sysconfigdata module into the platform directory and rename it to include the ABIFLAGS. New in python-3.6.0-alpha 2: - bpo-21272: Use _sysconfigdata.py to initialize distutils.sysconfig. https://docs.python.org/3/library/sysconfig.html It looks like sysconfigdata isn't just something we can rip out. $ guix shell python -- python3 -m sysconfig | grep TCLTK TCLTK_INCLUDES = "" TCLTK_LIBS = "-L/gnu/store/0scbhmjkll66vpgvgh7d77hayxgy1cc2-tcl-8.6.12/lib -L/gnu/store/fbjr5b0nfhq490x2ys1rzi7sg7rjpz95-tk-8.6.12/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6" $ guix shell pkg-config tcl tk -- pkg-config --libs tcl tk -L/gnu/store/fbjr5b0nfhq490x2ys1rzi7sg7rjpz95-tk-8.6.12/lib -L/gnu/store/0scbhmjkll66vpgvgh7d77hayxgy1cc2-tcl-8.6.12/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6 I do wonder if we could substitute TCLTK_LIBS to be: "`pkg-config --libs tcl tk`" and if that would work. -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted