Bug 2361779 - llvm-config not found, due to bad symlink in /etc/alternatives
Summary: llvm-config not found, due to bad symlink in /etc/alternatives
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 42
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-04-22 20:39 UTC by Paul Eggert
Modified: 2025-06-24 01:44 UTC (History)
15 users (show)

Fixed In Version: llvm-20.1.6-10.fc43 llvm-20.1.7-1.fc42
Clone Of:
Environment:
Last Closed: 2025-06-19 10:32:01 UTC
Type: ---
Embargoed:
tstellar: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-1619 0 None None None 2025-04-22 21:19:06 UTC

Description Paul Eggert 2025-04-22 20:39:58 UTC
After upgrading to Fedora 42 I noticed that /usr/bin/llvm-config doesn't work. Looks like the 2025-04-15 llvm-devel upgrade went awry.

I fixed things by hand via the command 'cd /etc/alternatives && ln -f llvm-config-20 llvm-config' as root. As a result of this by-hand fix I now see this:

$ ls -l /etc/alternatives/llvm*
lrwxrwxrwx. 2 root root 33 Apr 15 22:23 /etc/alternatives/llvm-config -> /usr/lib64/llvm20/bin/llvm-config
lrwxrwxrwx. 2 root root 33 Apr 15 22:23 /etc/alternatives/llvm-config-20 -> /usr/lib64/llvm20/bin/llvm-config
$ llvm-config --version
20.1.2







Reproducible: Always

Steps to Reproduce:
Run the shell command "llvm-config".

Actual Results:
bash: llvm-config: command not found


Expected Results:
The shell command "llvm-config" should run llvm-config.

Additional Information:
$ ls -l /usr/bin/llvm-config*
lrwxrwxrwx. 1 root root 29 Mar 10 16:06 /usr/bin/llvm-config -> /etc/alternatives/llvm-config
lrwxrwxrwx. 1 root root 32 Apr 15 22:23 /usr/bin/llvm-config-20 -> /etc/alternatives/llvm-config-20
$ ls -l /etc/alternatives/llvm-config*
lrwxrwxrwx. 1 root root 23 Mar 10 16:06 /etc/alternatives/llvm-config -> /usr/bin/llvm-config-64
lrwxrwxrwx. 1 root root 33 Apr 15 22:23 /etc/alternatives/llvm-config-20 -> /usr/lib64/llvm20/bin/llvm-config
$ ls -l /usr/bin/llvm-config-64 /usr/lib64/llvm20/bin/llvm-config
ls: cannot access '/usr/bin/llvm-config-64': No such file or directory
-rwxr-xr-x. 1 root root 565832 Apr  2 17:00 /usr/lib64/llvm20/bin/llvm-config
$ rpm -qf /usr/lib64/llvm20/bin/llvm-config
llvm-devel-20.1.2-3.fc42.x86_64

Comment 1 Ben Beasley 2025-04-24 11:13:32 UTC
Upon updating a Fedora 42 system today, I observed the following logs from "Removing llvm-devel-0:20.1.2-3.fc42.x86_64":

>>> Running post-uninstall scriptlet: llvm-devel-0:20.1.2-3.fc42.x86_64
>>> Non-critical error in post-uninstall scriptlet: llvm-devel-0:20.1.2-3.fc42.x86_64
>>> Scriptlet output:
>>> /var/tmp/rpm-tmp.ErdTDh: line 10: /usr/bin/llvm-config: No such file or directory
>>> /usr/lib64/llvm20/bin/llvm-config-64 has not been configured as an alternative for llvm-config-20
>>>
>>> [RPM] %postun(llvm-devel-20.1.2-3.fc42.x86_64) scriptlet failed, exit status 2

That looks like another symptom of the same problem.

Comment 2 Nikita Popov 2025-04-24 12:58:52 UTC
I think there are multiple problems here.

The postun error about llvm-config-20 is because we're trying to remove the wrong binary from alternatives (which existed in older versions). This would be easy to fix, though possibly we shouldn't be removing alternatives there at all, because it's possible that it transfers to a compat package instead.

llvm-config itself being broken a different issue that I don't fully understand. What does alternatives --display llvm-config print on a system that was upgraded from f41?

Comment 3 Ben Beasley 2025-04-24 13:27:33 UTC
(In reply to Nikita Popov from comment #2)
> llvm-config itself being broken a different issue that I don't fully
> understand. What does alternatives --display llvm-config print on a system
> that was upgraded from f41?

On the system that produced the scriptlet error, which was upgraded from F41 (and previously, F40 and beyond), and on which I have never meddled with the alternatives for llvm:

$ alternatives --display llvm-config
llvm-config - status is auto.
 link currently points to /usr/bin/llvm-config-64
/usr/bin/llvm-config-64 - priority 64
/usr/lib64/llvm20/bin/llvm-config - priority 64
Current `best' version is /usr/bin/llvm-config-64.

Here are the llvm packages that are installed:

$ rpm -qa | grep -E '^llvm' | sort
llvm11-libs-11.1.0-14.fc41.x86_64
llvm13-libs-13.0.1-8.fc41.x86_64
llvm14-libs-14.0.5-10.fc41.x86_64
llvm15-15.0.7-13.fc42.x86_64
llvm15-libs-15.0.7-13.fc42.x86_64
llvm17-17.0.6-9.fc41.x86_64
llvm17-devel-17.0.6-9.fc41.x86_64
llvm17-googletest-17.0.6-9.fc41.x86_64
llvm17-libs-17.0.6-9.fc41.x86_64
llvm17-static-17.0.6-9.fc41.x86_64
llvm17-test-17.0.6-9.fc41.x86_64
llvm18-18.1.8-6.fc42.x86_64
llvm18-devel-18.1.8-6.fc42.x86_64
llvm18-googletest-18.1.8-6.fc42.x86_64
llvm18-libs-18.1.8-6.fc42.x86_64
llvm18-static-18.1.8-6.fc42.x86_64
llvm18-test-18.1.8-6.fc42.x86_64
llvm19-filesystem-19.1.7-13.fc42.x86_64
llvm19-libs-19.1.7-13.fc42.x86_64
llvm-20.1.3-1.fc42.x86_64
llvm-devel-20.1.3-1.fc42.x86_64
llvm-filesystem-20.1.3-1.fc42.x86_64
llvm-googletest-20.1.3-1.fc42.x86_64
llvm-libs-20.1.3-1.fc42.x86_64
llvm-static-20.1.3-1.fc42.x86_64
llvm-test-20.1.3-1.fc42.x86_64

Comment 4 Nikita Popov 2025-04-24 13:30:58 UTC
Thank you! Given that, I think either giving /usr/lib64/llvm20/bin/llvm-config a higher priority or making sure that the dangling /usr/bin/llvm-config-64 entry gets dropped would fix the issue.

Comment 5 Nikita Popov 2025-04-24 13:59:50 UTC
Possible fix (currently untested) for these issues: https://src.fedoraproject.org/rpms/llvm/pull-request/417

Comment 6 Nikita Popov 2025-04-25 10:13:22 UTC
After some further discussion, we're probably going to drop alternatives for llvm-config entirely instead: https://src.fedoraproject.org/rpms/llvm/pull-request/418

Comment 7 Fedora Update System 2025-05-09 00:18:27 UTC
FEDORA-2025-4260585072 (llvm-20.1.4-6.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-4260585072

Comment 8 Fedora Update System 2025-06-18 16:36:07 UTC
FEDORA-2025-fd2baf076a (llvm-20.1.6-10.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-fd2baf076a

Comment 9 Fedora Update System 2025-06-19 10:32:01 UTC
FEDORA-2025-fd2baf076a (llvm-20.1.6-10.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2025-06-20 10:50:23 UTC
FEDORA-2025-f70f64de39 (flang-20.1.7-1.fc42, libclc-20.1.7-1.fc42, and 2 more) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-f70f64de39

Comment 11 Fedora Update System 2025-06-21 03:00:04 UTC
FEDORA-2025-f70f64de39 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-f70f64de39`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-f70f64de39

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2025-06-24 01:44:08 UTC
FEDORA-2025-f70f64de39 (flang-20.1.7-1.fc42, libclc-20.1.7-1.fc42, and 2 more) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.