-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xorgproto: new package #45569
xorgproto: new package #45569
Conversation
Signed-off-by: Teague Sterling <teaguesterling@gmail.com>
Signed-off-by: Teague Sterling <teaguesterling@gmail.com>
I started something similar a long time ago, #36238. Looking at that now, I did get a few more provides for other protocols too (and I found the virtuals provider approach the most straightforward, but at that time it more than doubled the number of virtual packages so it was unwieldy. I think that it may indeed make more sense to approach this without providers and with link dependencies on |
I agree that it would make more sense to just link to |
@wdconinc, your version also put a lot more thought into this than I did. I suspect there are at least a few things we should take from there to make this more resilient/complete. My aim with this was only to get turbovnc to build, so I'm sure I've missed something. |
I recall now what the main problem was with the providers: the semver versions of the individual protocols are different from the calver versions of the In that sense, I wonder if we can avoid the provider approach with something like this (using class Fixesproto(AutotoolsPackage, XorgPackage, BundlePackage):
"""X Fixes Extension.
The extension makes changes to many areas of the protocol to resolve
issues raised by application interaction with core protocol mechanisms
that cannot be adequately worked around on the client side of the wire."""
homepage = "https://cgit.freedesktop.org/xorg/proto/fixesproto"
xorg_mirror_path = "proto/fixesproto-5.0.tar.gz"
version("6.0")
version("5.0", sha256="67865a0e3cdc7dec1fd676f0927f7011ad4036c18eb320a2b41dbd56282f33b8")
build_system(
conditional(autotools, when="@:5"),
conditional(bundle, when="@6:"),
default=bundle,
)
with when("build_system=autotols"):
depends_on("pkgconfig", type="build")
depends_on("util-macros", type="build")
with when("build_system=bundle"):
depends_on("xorg-proto@2021.4:", when="@6.0:") Edit Note: this is entirely untested. I have no reason to expect that you would not be able to use a bundle package as a multiple build system option, but it is not used in any other package as far as I can tell. |
I think the providers part is what makes it harder to get this into develop. Without the providers, this could get merged easily as a new package, and then the next step (in a different PR) could be to add the necessary support in the individual protocols, piecemeal and as needed. Or to just change each protocol to a bundle package that depends on |
So, I got a tested working case without providers (sorry for the length of output in email notification). This is with ${SPACK_ROOT}/var/spack/repos/builtin/packages/fixesproto/package.pyThis requires `has_code = True` because otherwise spack doesn't download for the `AutotoolsPackage`. It also requires a `touch ${SPACK_ROOT}/var/spack/repos/builtin/packages/fixesproto/empty` because we cannot set `has_code` as an individual version attribute.# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) ${SPACK_ROOT}/var/spack/repos/builtin/packages/libxfixes/package.pyThis is just adding the new version that requires `fixesproto >= 6`.# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Test environment:# This is a Spack Environment file. # # It describes a set of packages to be installed, along with # configuration settings. spack: # add package specs to the `specs` list specs: - libxfixes@6.0.1 ^fixesproto@6 - libxfixes@5.0.3 ^fixesproto@5 view: false concretizer: unify: false packages: perl: externals: - spec: perl@5.38.2~cpanm+opcode+open+shared+threads prefix: /usr buildable: false python: externals: - spec: python@3.12.3+bz2+crypt+ctypes+dbm+lzma~nis+pyexpat+pythoncmd+readline+sqlite3+ssl+tix+tkinter+uuid+zlib prefix: /usr buildable: false Concretizes as:$ spack concretize --fresh --force ==> Starting concretization pool with 2 processes ==> Environment concretized in 4.01 seconds ==> Concretized 2 specs: - 7w2o4vf libxfixes@5.0.3%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake - l62jnr2 ^fixesproto@5.0%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] rjdzeos ^gcc-runtime@13.2.0%gcc@13.2.0 build_system=generic arch=linux-ubuntu24.04-skylake [e] o2zy2ye ^glibc@2.39%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] gmcvx5j ^gmake@4.4.1%gcc@13.2.0~guile build_system=generic arch=linux-ubuntu24.04-skylake [+] 7g3p5dn ^libx11@1.8.9%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] q4lbh2p ^inputproto@2.3.2%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] le64ocx ^kbproto@1.0.7%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] 5ek5pwq ^libxcb@1.17.0%gcc@13.2.0~use_spack_interpreter build_system=autotools arch=linux-ubuntu24.04-skylake [+] qjmtp6v ^libpthread-stubs@0.5%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] tg5q6bq ^libxau@1.0.11%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] pruxtnf ^libxdmcp@1.1.5%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] agqymek ^autoconf@2.72%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] 5sadx7z ^m4@1.4.19%gcc@13.2.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-ubuntu24.04-skylake [+] vhochvw ^diffutils@3.10%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] n35axwd ^libiconv@1.17%gcc@13.2.0 build_system=autotools libs=shared,static arch=linux-ubuntu24.04-skylake [+] ywje6er ^libsigsegv@2.14%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] vb76tg3 ^libbsd@0.12.2%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] j5scuyb ^libmd@1.1.0%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] soxsf6x ^automake@1.16.5%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [e] ddhhm7a ^python@3.12.3%gcc@13.2.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl+tix+tkinter+uuid+zlib build_system=generic arch=linux-ubuntu24.04-skylake [+] hjkhzva ^xcb-proto@1.17.0%gcc@13.2.0~use_spack_interpreter build_system=autotools arch=linux-ubuntu24.04-skylake [e] ivomb6c ^perl@5.38.2%gcc@13.2.0~cpanm+opcode+open+shared+threads build_system=generic arch=linux-ubuntu24.04-skylake [+] h5svx5y ^xtrans@1.5.0%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] g5u7clr ^pkgconf@2.2.0%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] igvtyhw ^util-macros@1.20.1%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] l65cme6 ^xextproto@7.3.0%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake [+] okrjuyq ^xproto@7.0.31%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake - cf5w7c4 libxfixes@6.0.1%gcc@13.2.0 build_system=autotools arch=linux-ubuntu24.04-skylake - il5gyog ^fixesproto@6.0%gcc@13.2.0 build_system=bundle arch=linux-ubuntu24.04-skylake [+] ela3dne ^xorg-proto@2024.1%gcc@13.2.0~legacy~strip build_system=meson buildtype=release default_library=shared arch=linux-ubuntu24.04-skylake [+] dfxnwgc ^meson@1.5.1%gcc@13.2.0 build_system=python_pip patches=0f0b1bd arch=linux-ubuntu24.04-skylake [+] inywvgn ^py-pip@24.1.1%gcc@13.2.0 build_system=generic arch=linux-ubuntu24.04-skylake [+] a6z3yvl ^py-setuptools@70.2.0%gcc@13.2.0 build_system=generic arch=linux-ubuntu24.04-skylake [+] cdwu4y2 ^py-wheel@0.43.0%gcc@13.2.0 build_system=generic arch=linux-ubuntu24.04-skylake [+] xaubztq ^python-venv@1.0%gcc@13.2.0 build_system=generic arch=linux-ubuntu24.04-skylake [+] bdvztpj ^ninja@1.12.1%gcc@13.2.0+re2c build_system=generic arch=linux-ubuntu24.04-skylake [+] yfijrfj ^re2c@3.0%gcc@13.2.0 build_system=generic arch=linux-ubuntu24.04-skylake Build output (relevant bits)==> Installing fixesproto-5.0-l62jnr2lss7tyg7hvsikyhgd3vrsfhjb [18/28] ==> No binary for fixesproto-5.0-l62jnr2lss7tyg7hvsikyhgd3vrsfhjb found: installing from source ==> Using cached archive: /opt/spack/cache/_source-cache/archive/67/67865a0e3cdc7dec1fd676f0927f7011ad4036c18eb320a2b41dbd56282f33b8.tar.gz ==> No patches needed for fixesproto ==> fixesproto: Executing phase: 'autoreconf' ==> fixesproto: Executing phase: 'configure' ==> fixesproto: Executing phase: 'build' ==> fixesproto: Executing phase: 'install' ==> fixesproto: Successfully installed fixesproto-5.0-l62jnr2lss7tyg7hvsikyhgd3vrsfhjb Stage: 0.01s. Autoreconf: 0.00s. Configure: 1.60s. Build: 0.00s. Install: 0.01s. Post-install: 0.07s. Total: 1.72s [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/fixesproto-5.0-l62jnr2lss7tyg7hvsikyhgd3vrsfhjb [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/libxau-1.0.11-tg5q6bqkf2cghjneprsqeuu5dayi5ljv [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/libbsd-0.12.2-vb76tg3k3kgnwb3vtwddrofig25ktuy2 [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/meson-1.5.1-dfxnwgcpdi6ooxobprv7dbwauw3l4do4 [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/libxdmcp-1.1.5-pruxtnfr4bsnhi6cvg4ufk7ryjdtp2i6 [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/xorg-proto-2024.1-ela3dne6inknw3dtpczaptuyqvrcrn5b [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/libxcb-1.17.0-5ek5pwqaieirklt2c3upgssbmacpwhzb ==> Installing fixesproto-6.0-il5gyogqijwykbeq7zln47bruwhkxzfa [25/28] ==> No binary for fixesproto-6.0-il5gyogqijwykbeq7zln47bruwhkxzfa found: installing from source ==> Using cached archive: /opt/spack/cache/_source-cache/archive/e3/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ==> No patches needed for fixesproto ==> fixesproto: Executing phase: 'install' ==> fixesproto: Successfully installed fixesproto-6.0-il5gyogqijwykbeq7zln47bruwhkxzfa Stage: 0.00s. Install: 0.00s. Post-install: 0.15s. Total: 0.18s [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/fixesproto-6.0-il5gyogqijwykbeq7zln47bruwhkxzfa [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/libx11-1.8.9-7g3p5dn3ehnpenvxbf3mklt6scasyixa ==> Installing libxfixes-6.0.1-cf5w7c4rqkgpppxc2iwh5dendhucpvr3 [27/28] ==> No binary for libxfixes-6.0.1-cf5w7c4rqkgpppxc2iwh5dendhucpvr3 found: installing from source ==> Using cached archive: /opt/spack/cache/_source-cache/archive/e6/e69eaa321173c748ba6e2f15c7cf8da87f911d3ea1b6af4b547974aef6366bec.tar.gz ==> No patches needed for libxfixes ==> libxfixes: Executing phase: 'autoreconf' ==> libxfixes: Executing phase: 'configure' ==> libxfixes: Executing phase: 'build' ==> libxfixes: Executing phase: 'install' ==> libxfixes: Successfully installed libxfixes-6.0.1-cf5w7c4rqkgpppxc2iwh5dendhucpvr3 Stage: 0.01s. Autoreconf: 0.00s. Configure: 2.68s. Build: 0.25s. Install: 0.12s. Post-install: 0.17s. Total: 3.31s [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/libxfixes-6.0.1-cf5w7c4rqkgpppxc2iwh5dendhucpvr3 ==> Installing libxfixes-5.0.3-7w2o4vf37osstbstf5oxfkt3ruckbojw [28/28] ==> No binary for libxfixes-5.0.3-7w2o4vf37osstbstf5oxfkt3ruckbojw found: installing from source ==> Using cached archive: /opt/spack/cache/_source-cache/archive/9a/9ab6c13590658501ce4bd965a8a5d32ba4d8b3bb39a5a5bc9901edffc5666570.tar.gz ==> No patches needed for libxfixes ==> libxfixes: Executing phase: 'autoreconf' ==> libxfixes: Executing phase: 'configure' ==> libxfixes: Executing phase: 'build' ==> libxfixes: Executing phase: 'install' ==> libxfixes: Successfully installed libxfixes-5.0.3-7w2o4vf37osstbstf5oxfkt3ruckbojw Stage: 0.01s. Autoreconf: 0.00s. Configure: 2.98s. Build: 0.17s. Install: 0.09s. Post-install: 0.10s. Total: 3.41s [+] /opt/software/linux-ubuntu24.04-skylake/gcc-13.2.0/libxfixes-5.0.3-7w2o4vf37osstbstf5oxfkt3ruckbojw Edit: fixed some conceptual errors, typos, updated output. |
Updated comment above. It seems like combining bundle versions without code and autotools versions which have code requires us (for now) to provide a fake archive file. We probably should have |
This is great! Do you know if we can use |
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
@spackbot fix style |
Let me see if I can fix that for you! |
I was able to run spack style --fix==> Running style checks on spack
selected: isort, black, flake8, mypy
==> Modified files
var/spack/repos/builtin/packages/xorgproto/package.py
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/xorgproto/package.py
All done! ✨ 🍰 ✨
1 file reformatted.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
lib/spack/spack/version/version_types.py:145: error: Argument 2 to "StandardVersion" has incompatible type "*Tuple[Tuple[Any, ...], Tuple[Any, ...]]"; expected "Tuple[Tuple[Any, ...], Tuple[Any, ...]]" [arg-type]
lib/spack/spack/version/version_types.py:452: error: Argument 2 to "StandardVersion" has incompatible type "*Tuple[Tuple[Any, ...], Tuple[Any, ...]]"; expected "Tuple[Tuple[Any, ...], Tuple[Any, ...]]" [arg-type]
lib/spack/spack/version/version_types.py:481: error: Argument 2 to "StandardVersion" has incompatible type "*Tuple[Tuple[Any, ...], Tuple[Any, ...]]"; expected "Tuple[Tuple[Any, ...], Tuple[Any, ...]]" [arg-type]
Found 3 errors in 1 file (checked 621 source files)
mypy found errors
I've updated the branch with style fixes. |
* xorgproto: new package Signed-off-by: Teague Sterling <teaguesterling@gmail.com> * adding providers for xorgprotos Signed-off-by: Teague Sterling <teaguesterling@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update etc/spack/defaults/packages.yaml Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update etc/spack/defaults/packages.yaml Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * [@spackbot] updating style on behalf of teaguesterling * xorgproto: depends_on meson type build --------- Signed-off-by: Teague Sterling <teaguesterling@gmail.com> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
* xorgproto: new package Signed-off-by: Teague Sterling <teaguesterling@gmail.com> * adding providers for xorgprotos Signed-off-by: Teague Sterling <teaguesterling@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update etc/spack/defaults/packages.yaml Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update etc/spack/defaults/packages.yaml Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * [@spackbot] updating style on behalf of teaguesterling * xorgproto: depends_on meson type build --------- Signed-off-by: Teague Sterling <teaguesterling@gmail.com> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
* xorgproto: new package Signed-off-by: Teague Sterling <teaguesterling@gmail.com> * adding providers for xorgprotos Signed-off-by: Teague Sterling <teaguesterling@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update etc/spack/defaults/packages.yaml Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update etc/spack/defaults/packages.yaml Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Update var/spack/repos/builtin/packages/xorgproto/package.py Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * [@spackbot] updating style on behalf of teaguesterling * xorgproto: depends_on meson type build --------- Signed-off-by: Teague Sterling <teaguesterling@gmail.com> Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Breaking out the xorgproto package that replaces the individual x proto files from #44722. This package has lots of virtual providers, so the issues that appeared in #45485 should be considered and evaluated separately.
Potentially, this could also deprecate the other proto files over time, as that is the direction that X seems to be taking.
Given the number of packages that the xorgproto package subsumes, I wonder if it would make more sense to simply update the packages that depend on those various protos to use xorgproto. That would cut down on the number of "providers" that we are adding.
Noting that @wdconinc had a previous PR in #36238 that has some important things to consider before merging.