<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/cbf7cdcc207db3cc4d823b3277eab619a550ea1d">https://github.com/macports/macports-ports/commit/cbf7cdcc207db3cc4d823b3277eab619a550ea1d</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new cbf7cdcc207 cltversion: fix spurious warnings with no CLT installation on macOS ≥ 11
</span>cbf7cdcc207 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit cbf7cdcc207db3cc4d823b3277eab619a550ea1d
</span>Author: Mark Mentovai <mark@chromium.org>
AuthorDate: Sat Apr 2 23:28:44 2022 -0400
<span style='display:block; white-space:pre;color:#404040;'> cltversion: fix spurious warnings with no CLT installation on macOS ≥ 11
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> On macOS 11 and 12, when Command Line Tools (CLT) are not installed,
</span><span style='display:block; white-space:pre;color:#404040;'> cltversion produced these warnings:
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Warning: cltversion: The Command Line Tools are installed, but MacPorts cannot determine the version.
</span><span style='display:block; white-space:pre;color:#404040;'> Warning: cltversion: For a possible fix, please see: https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This was confusing, because CLT were not installed. The linked document
</span><span style='display:block; white-space:pre;color:#404040;'> discusses reinstalling CLT, but this is nonsense when CLT is not present
</span><span style='display:block; white-space:pre;color:#404040;'> and there’s no need or desire to install CLT. CLT may intentionally be
</span><span style='display:block; white-space:pre;color:#404040;'> absent if a fully-functioning Xcode installation is available. This
</span><span style='display:block; white-space:pre;color:#404040;'> warning may have caused quite a bit of busywork by macOS 11 and 12
</span><span style='display:block; white-space:pre;color:#404040;'> users, dutifully silencing the warning by installing CLT unnecessarily.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The warning appeared because cltversion looked for
</span><span style='display:block; white-space:pre;color:#404040;'> /usr/lib/libxcselect.dylib on disk to determine if it should look for a
</span><span style='display:block; white-space:pre;color:#404040;'> new-style CLT installation, but /usr/lib/libxcselect.dylib does not
</span><span style='display:block; white-space:pre;color:#404040;'> exist as a file on disk on macOS 11 or later (Darwin 20 or later), since
</span><span style='display:block; white-space:pre;color:#404040;'> individual system dylibs are only shipped in the dyld shared cache on
</span><span style='display:block; white-space:pre;color:#404040;'> these newer OS versions. The file’s absence caused cltversion to search
</span><span style='display:block; white-space:pre;color:#404040;'> for an old-style CLT installation, checking for the existence of
</span><span style='display:block; white-space:pre;color:#404040;'> /usr/bin/make. On modern OS versions, /usr/bin/make is always present as
</span><span style='display:block; white-space:pre;color:#404040;'> a stub that delegates to make in the active developer tools
</span><span style='display:block; white-space:pre;color:#404040;'> installation—it’s bundled with the OS and will never be missing.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This fix makes cltversion look for a new-style CLT installation if the
</span><span style='display:block; white-space:pre;color:#404040;'> OS is so new that it doesn’t ship system dylibs outside of the dyld
</span><span style='display:block; white-space:pre;color:#404040;'> cache. Rest assured that on OS versions this new, no old-style CLT
</span><span style='display:block; white-space:pre;color:#404040;'> installations are even possible.
</span>---
_resources/port1.0/group/cltversion-1.0.tcl | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/cltversion-1.0.tcl b/_resources/port1.0/group/cltversion-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 2346fd3dc9e..c281f9a3ce8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/cltversion-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/cltversion-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -19,7 +19,7 @@ default cltversion {[cltversion::get_default_cltversion]}
</span> default developerversion {[cltversion::get_default_developerversion]}
proc cltversion::get_default_cltversion {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global cltversion._cltversion_version_cache
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global cltversion._cltversion_version_cache os.major
</span>
if {[info exists cltversion._cltversion_version_cache]} {
return [set cltversion._cltversion_version_cache]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -49,8 +49,14 @@ proc cltversion::get_default_cltversion {} {
</span>
# On OS X 10.9, running `xcode-select --install` seems to reinstall the command line tools.
# For later OS versions, however, if `/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib` exists, then `xcode-select --install` refuses to reinstall.
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # /usr/lib/libxcselect.dylib will not exist as a file on disk on macOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # 11 or later (Darwin 20 or later) because individual system dylibs are
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # only shipped in the dyld shared cache. Rest assured that if the OS is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # that new, it's always appropriate to look for a Command Line Tools
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # installation at the path given here.
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists /usr/lib/libxcselect.dylib]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists /usr/lib/libxcselect.dylib] || ${os.major} >= 20} {
</span> set test_file /Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib
} else {
set test_file /usr/bin/make
</pre><pre style='margin:0'>
</pre>