As part of the Fedora XR SIG packaging work, we have determined there is not clear policy where Vulkan layers should be installed.
Vulkan layers are unversioned shared object files that have been traditionally installed into /usr/lib[64] but are not to be linked against. They should only be loaded at runtime and that is the responsibility of the vulkan-loader and local configuration. The current undocumented policy of using a subdir in /usr/lib[64] for this type of library is unclear on how to handle Vulkan layers.
/usr/lib[64]
Upstream Monado has an explicit policy to not move the shared object due to old loader versions not handling multi-arch correctly. The Fedora policy will not only affect Monado and related projects, but all Vulkan layers. An example is mesa-vulkan-drivers. We should expect the use of Vulkan to continue to expand and getting a good policy/guidance in place now is important.
mesa-vulkan-drivers
This was discussed in a recent FPC meeting: https://meetbot.fedoraproject.org/meeting-1_matrix_fedoraproject-org/2024-05-02/fpc.2024-05-02-16.00.log.html
The intended outcome of this ticket it to document the specific Fedora policy for handling of Vulkan layers to be applied to all current and future packages.
Background/context tracking tickets:
I'm trying to get what the problem is and what we want to see happen.
Currently we drop them in /usr/lib[64], because that is where it makes sense to put things and means the vulkan loader we supply along with any user installed vulkan sdk will do the right thing.
This also applies to vulkan drivers not just vulkan layers.
I don't think openxr should be any different here? are they requesting we put stuff into /usr/lib64/monado-vulkan-layers or are we wanting that?
If they are going to be moved to a subdirectory then that subdirectory needs to be added to the library search paths, probably with an /etc/ld.so.conf.d/ file
@airlied thanks for the quick look. I was instructed to move it to /usr/lib[64]/monado-vulkan-layers due to Fedora packaging guidelines. Private unversioned libraries that are not to be linked against should be put into a path outside of the default loader path. This policy was shared via Matrix and might just be tradition. There is currently no documented policy and that is what this ticket is expecting to address.
Upstream, Monado in this case, is pushing back on the move to a subdirectory.
yes ignore that advice, these unversioned libraries are to be in the default loader path by design.
if we move them, wherever we move them to has to be in the loader path, so it's kinda self defeating.
If we are proposing new packaging guidelines, they should just be a in most cases unversioned libraries shoud be in private dirs, but there are many exceptions to this and should be addressed on a case by case basis
Toward the goal of starting a policy document, it sounds like we have some things defined as part of the proposal so far:
MUST put unversioned private libraries in a directory outside of the default loader paths EXCEPT when the unversioned library is a Vulkan layer or driver loaded by Vulkan loader EXCEPT when the unversioned library is an OpenXR layer loaded by OpenXR loader SHOULD document in the specfile what libraries are visible to default loader paths and reference the packaging policy exception(s)
Per discussion in https://gitlab.freedesktop.org/monado/monado/-/issues/335 there could also be:
MUST configure the unversioned private library as a MODULE to prevent linking[1]
[1] I don't know if this is how it actually works, so someone who knows should help us here.
There's a lot of things breaking this policy, so I'm not sure we can really write one now
find . -maxdepth 1 -type f -name '*.so'
finds all the aren't symlinks to other versioned ones and there's quite a few.
Hmm... so maybe change everything I have that is a MUST to a SHOULD.
$ find /usr/lib64/ -maxdepth 1 -type f -name '*.so' -exec readelf -a {} \;|grep SONAME 0x000000000000000e (SONAME) Library soname: [libdb-5.3.so] 0x000000000000000e (SONAME) Library soname: [libgettextlib-0.22.so] 0x000000000000000e (SONAME) Library soname: [libgettextsrc-0.22.so] 0x000000000000000e (SONAME) Library soname: [libijs-0.35.so] 0x000000000000000e (SONAME) Library soname: [liblpsolve55.so] 0x000000000000000e (SONAME) Library soname: [liblua-5.4.so] 0x000000000000000e (SONAME) Library soname: [libtcl8.6.so] readelf: /usr/lib64/libtcl8.6.so: Warning: Gap in build notes detected from 0x2f87a to 0x15f1af 0x000000000000000e (SONAME) Library soname: [libthrift-0.15.0.so] 0x000000000000000e (SONAME) Library soname: [libthriftnb-0.15.0.so] 0x000000000000000e (SONAME) Library soname: [libthriftz-0.15.0.so] 0x000000000000000e (SONAME) Library soname: [libbfd-2.40-14.fc39.so] 0x000000000000000e (SONAME) Library soname: [libopcodes-2.40-14.fc39.so] 0x000000000000000e (SONAME) Library soname: [libLLVM-17.so] 0x000000000000000e (SONAME) Library soname: [liblua-5.1.so] 0x000000000000000e (SONAME) Library soname: [libopenblas.so.0] 0x000000000000000e (SONAME) Library soname: [libopenblaso.so.0] 0x000000000000000e (SONAME) Library soname: [libopenblaso64.so.0] 0x000000000000000e (SONAME) Library soname: [libxerces-c-3.2.so] 0x000000000000000e (SONAME) Library soname: [libhdr10plus.so] 0x000000000000000e (SONAME) Library soname: [libfdt.so.1] 0x000000000000000e (SONAME) Library soname: [libVkLayer_MESA_device_select.so] 0x000000000000000e (SONAME) Library soname: [libvulkan_broadcom.so] 0x000000000000000e (SONAME) Library soname: [libvulkan_freedreno.so] 0x000000000000000e (SONAME) Library soname: [libvulkan_intel.so] 0x000000000000000e (SONAME) Library soname: [libvulkan_intel_hasvk.so] 0x000000000000000e (SONAME) Library soname: [libvulkan_lvp.so] 0x000000000000000e (SONAME) Library soname: [libvulkan_panfrost.so] 0x000000000000000e (SONAME) Library soname: [libvulkan_radeon.so] 0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-diff.so] 0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-link.so] 0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-lint.so] 0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-opt.so] 0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-reduce.so] 0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools-shared.so] 0x000000000000000e (SONAME) Library soname: [libSPIRV-Tools.so] 0x000000000000000e (SONAME) Library soname: [libelf.so.1] 0x000000000000000e (SONAME) Library soname: [libdebuginfod.so.1] 0x000000000000000e (SONAME) Library soname: [libasm.so.1] 0x000000000000000e (SONAME) Library soname: [libdw.so.1] 0x000000000000000e (SONAME) Library soname: [opensc-pkcs11.so] 0x000000000000000e (SONAME) Library soname: [pkcs11-spy.so] 0x000000000000000e (SONAME) Library soname: [libnspr4.so] 0x000000000000000e (SONAME) Library soname: [libplc4.so] 0x000000000000000e (SONAME) Library soname: [libplds4.so] 0x000000000000000e (SONAME) Library soname: [libnssutil3.so] 0x000000000000000e (SONAME) Library soname: [libfreebl3.so] 0x000000000000000e (SONAME) Library soname: [libfreeblpriv3.so] 0x000000000000000e (SONAME) Library soname: [libsoftokn3.so] 0x000000000000000e (SONAME) Library soname: [libnss3.so] 0x000000000000000e (SONAME) Library soname: [libsmime3.so] 0x000000000000000e (SONAME) Library soname: [libssl3.so] 0x000000000000000e (SONAME) Library soname: [libnsssysinit.so] 0x000000000000000e (SONAME) Library soname: [libmemusage.so] 0x000000000000000e (SONAME) Library soname: [libpcprofile.so] 0x000000000000000e (SONAME) Library soname: [libpython3.so] readelf: /usr/lib64/libc.so: Error: Not an ELF file - it has the wrong magic bytes at the start readelf: /usr/lib64/libm.so: Error: Not an ELF file - it has the wrong magic bytes at the start 0x000000000000000e (SONAME) Library soname: [libsss_sudo.so] 0x000000000000000e (SONAME) Library soname: [libsubid_sss.so] 0x000000000000000e (SONAME) Library soname: [libbind9-9.18.26.so] 0x000000000000000e (SONAME) Library soname: [libdns-9.18.26.so] 0x000000000000000e (SONAME) Library soname: [libirs-9.18.26.so] 0x000000000000000e (SONAME) Library soname: [libisc-9.18.26.so] 0x000000000000000e (SONAME) Library soname: [libisccc-9.18.26.so] 0x000000000000000e (SONAME) Library soname: [libisccfg-9.18.26.so] 0x000000000000000e (SONAME) Library soname: [libns-9.18.26.so]
It looks like most everything is versioned, except vulkan and sssd stuff, maybe more that my eyes didn't see.
Did we attend the same meeting? I don't remember anyone "instructing" you to put things into a subdirectory, we just expressed a preference for it, unless there are technical reasons not to do it.
What I still think is very weird is that the libraries NEED to be in the default loader search paths, but they MUST not be dynamically linkable? How does that fit together? Are the Vulkan / OpenXR loaders "abusing" the default loader search paths for a different mechanism?
@decathorpe Sorry for any miscommunication. The recommendation was given on Wed, Mar 13, 2024 via #devel:fedoraproject.org.
For consideration at the next meeting:
SHOULD put unversioned private libraries in a directory outside of the default loader paths (i.e. %{_libdir}/%{name}/) EXCEPT when the unversioned library is a Vulkan layer or driver loaded by Vulkan loader EXCEPT when the unversioned library is an OpenXR layer (Vulkan ICD) loaded by OpenXR loader
%{_libdir}/%{name}/
Optionally, to be considered:
SHOULD document in the specfile what private libraries are visible to default loader paths and reference the packaging policy exception(s) SHOULD configure the unversioned private library as a MODULE to prevent linking
Additional discussion about this from today's FPC meeting: https://meetbot.fedoraproject.org/meeting-1_matrix_fedoraproject-org/2024-05-23/fpc.2024-05-23-16.01.log.html
My action item is to do a PR for the packaging guidelines for further collaboration on developing this policy and possibly resulting in a Change Proposal for system-wide adoption.
The relevant existing policies are located at:
https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/ https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages
https://pagure.io/packaging-committee/pull-request/1368
https://pagure.io/packaging-committee/c/308b542 resolves this ticket.
Metadata Update from @jsteffan: - Issue close_status updated to: accepted - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.