[MacPorts] #73982: clang_select-22: `port select --set clang mp-clang-22` fails due to missing c-index-test-mp-22

MacPorts noreply at macports.org
Fri May 8 21:26:48 UTC 2026


#73982: clang_select-22: `port select --set clang mp-clang-22` fails due to missing
c-index-test-mp-22
----------------------+--------------------
 Reporter:  pmetzger  |      Owner:  (none)
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:
 Keywords:            |       Port:
----------------------+--------------------
 == Description ==

 Running:

 {{{
 sudo port select --set clang mp-clang-22
 }}}

 fails with:

 {{{
 Selecting 'mp-clang-22' for 'clang' failed: could not create new link
 "/opt/local/bin/c-index-test": target "/opt/local/bin/c-index-test-mp-22"
 doesn't exist
 }}}

 The problem appears to be in:

 {{{
 sysutils/clang_select/files/mp-clang-22
 }}}

 The first entry in that select file is currently:

 {{{
 bin/c-index-test-mp-22
 }}}

 This corresponds to the first entry in:

 {{{
 sysutils/clang_select/files/base
 }}}

 which is:

 {{{
 bin/c-index-test
 }}}

 However, `clang-22` does not install:

 {{{
 /opt/local/bin/c-index-test-mp-22
 }}}

 so `port select` fails before completing the selection.

 == Expected result ==

 {{{
 sudo port select --set clang mp-clang-22
 }}}

 should successfully select `mp-clang-22`.

 == Actual result ==

 The selection fails because `clang_select-22` tries to create:

 {{{
 /opt/local/bin/c-index-test -> /opt/local/bin/c-index-test-mp-22
 }}}

 but the target file does not exist.

 == Analysis ==

 This appears to be specific to LLVM/Clang 22.

 In upstream LLVM 22, `c-index-test` is only built when
 `CLANG_INCLUDE_TESTS` is enabled. The MacPorts `lang/llvm-22` Portfile
 configures clang with:

 {{{
 -DCLANG_INCLUDE_TESTS=OFF
 }}}

 so the absence of `c-index-test-mp-22` is expected.

 This looks like a stale select entry copied forward from earlier clang
 select files where `c-index-test` was still built and installed.

 == Suggested fix ==

 Change the first field of:

 {{{
 sysutils/clang_select/files/mp-clang-22
 }}}

 from:

 {{{
 bin/c-index-test-mp-22
 }}}

 to:

 {{{
 -
 }}}

 while preserving the field order and field count relative to
 `sysutils/clang_select/files/base`.

 Approximate patch:

 {{{#!diff
 --- sysutils/clang_select/files/mp-clang-22
 +++ sysutils/clang_select/files/mp-clang-22
 @@
 -bin/c-index-test-mp-22 bin/clang++-mp-22 ...
 +- bin/clang++-mp-22 ...
 }}}

 `clang_select-22` should also get a revision bump so users receive the
 corrected select file.

-- 
Ticket URL: <https://trac.macports.org/ticket/73982>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list