Bug 283128 - devel/spirv-llvm-translator: add libLLVMSPIRVLib.so.${MAJOR} symlink for llvm >= 18 ?
Summary: devel/spirv-llvm-translator: add libLLVMSPIRVLib.so.${MAJOR} symlink for llvm...
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks: 283013
  Show dependency treegraph
 
Reported: 2024-12-04 16:16 UTC by Dimitry Andric
Modified: 2024-12-04 20:34 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (jbeich)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-12-04 16:16:09 UTC
During the exp-run for bug 283013 ("update LLVM_DEFAULT to 18") it
turned out that lang/clover fails to build, with an error similar
to:

[133amd64-default-foo-job-09] Extracting spirv-llvm-translator-llvm18-18.1.6: .......... done
===>   clover-24.1.7 depends on shared library: libLLVMSPIRVLib.so.18 - not found
*** Error code 1

This is because after llvm 18, the .so filename has become libLLVMSPIRVLib.so.18.1, libLLVMSPIRVLib.so.19.1, and so on.

The Makefile for devel/spirv-llvm-translator takes this into account by doing:

SOVERSION=      ${${FLAVOR:S/llvm//}<18:?${DISTVERSION:R:R}:${DISTVERSION:R}}

which is nice, but it is rather annoying that all consumers will have to be updated similarly too. I found the following consumers, which directly refer to the .so filename:

devel/intel-graphics-compiler/Makefile:                 libLLVMSPIRVLib.so.${FLAVOR:S/llvm//}:devel/spirv-llvm-translator@${FLAVOR}
devel/ispc/Makefile:                    libLLVMSPIRVLib.so.${LLVM_VERSION}:devel/spirv-llvm-translator@llvm${LLVM_VERSION}
devel/opencl-clang/Makefile:            libLLVMSPIRVLib.so.${FLAVOR:S/llvm//}:devel/spirv-llvm-translator@${FLAVOR}
graphics/mesa-devel/Makefile: OPENCL_LIB_DEPENDS=       libLLVMSPIRVLib.so.${OPENCL_SOVERSION}:devel/spirv-llvm-translator@${LLVM_PORT:T}
lang/clover/Makefile:           libLLVMSPIRVLib.so.${LLVM_VERSION}:devel/spirv-llvm-translator@${LLVM_PORT:T} \

If it is not too much trouble, should the devel/spirv-llvm-translator add a compat symlink libLLVMSPIRVLib.so.18, libLLVMSPIRVLib.so.19 etc, to make it easier on consumers? 

Note that the devel/llvm18 and higher ports do something slightly different:

libLLVM-18.so@ -> libLLVM.so.18.1
libLLVM.so@ -> libLLVM.so.18.1
libLLVM.so.18.1*

and:

libLLVM-19.so@ -> libLLVM.so.19.1
libLLVM.so@ -> libLLVM.so.19.1
libLLVM.so.19.1*
Comment 1 Jan Beich freebsd_committer freebsd_triage 2024-12-04 20:20:57 UTC
SOVERSION aka ABI version embedded SONAME is caused by https://github.com/llvm/llvm-project/commit/91a384621e5b and can be adapted like ports 23739fa6caa7 or specify package name instead like {BUILD,RUN}_DEPENDS+=spirv-llvm-translator@${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T}

The workaround is only necessary in ports that want to support both new and old LLVM versions (rare because LLVM breaks each major update twice a year). For example, ispc is llvm16-only and can't use spirv-llvm-translator due to XE_BROKEN; intel-graphics-compiler doesn't support llvm > 14 and maybe removed (together with opencl-clang) after /stable/13 EOL (per bug 281566).
Comment 2 Jan Beich freebsd_committer freebsd_triage 2024-12-04 20:26:41 UTC
clover can simply drop spirv-llvm-translator dependency per bug 280957.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2024-12-04 20:29:13 UTC
(In reply to Jan Beich from comment #2)
Hm, so after clover is fixed, there aren't really any relevant consumers left, then?