This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch msys2-dev-prototype
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/msys2-dev-prototype by this
push:
new da069de673 Stop the probe from measuring the wrong compiler, and fix
two false results
da069de673 is described below
commit da069de6731c9db9398a4b09286a6bccf011a79e
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Aug 11 13:38:46 2026 -0400
Stop the probe from measuring the wrong compiler, and fix two false results
MSYSTEM=CLANG64 does not imply PATH reaches /clang64/bin: with the toolchain
absent it falls through to the msys-namespace clang, whose Cygwin target
failed
every MSVC-extension and Win32-header probe for reasons that say nothing
about
the plan. The ATL probe never compiled at all -- its quoted -I split on the
spaces in the Visual Studio path -- and the SDK tool search returned arm
builds
that cannot execute on x64.
---
msys2-probe.sh | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/msys2-probe.sh b/msys2-probe.sh
index f7b16e567d..05e15a7112 100755
--- a/msys2-probe.sh
+++ b/msys2-probe.sh
@@ -200,6 +200,25 @@ else
done
fi
+# MSYSTEM alone does not settle which compiler PATH reaches: with the CLANG64
+# toolchain absent, /clang64/bin is empty and every probe below silently
+# measures the msys-namespace clang, which targets the Cygwin runtime instead.
+head2 "is PATH actually reaching the CLANG64 toolchain?"
+CLANG_PATH="$(command -v clang 2>/dev/null || true)"
+case "$CLANG_PATH" in
+ /clang64/*)
+ pass "clang comes from the CLANG64 prefix" "$CLANG_PATH" ;;
+ *)
+ fail "clang resolves to ${CLANG_PATH:-<nothing>}, not /clang64/bin" \
+ "the CLANG64 toolchain is not installed" CRITICAL
+ echo
+ echo " Stopping here: the remaining probes would measure the wrong
compiler"
+ echo " and report failures that say nothing about this plan. Install
it with"
+ echo " './msys2-probe.sh --install' (or 'pacman -S
mingw-w64-clang-x86_64-toolchain')"
+ echo " and run again."
+ exit 2 ;;
+esac
+
# ---------------------------------------------------------------- toolchain --
head1 "2. Toolchain facts"
@@ -410,7 +429,10 @@ if [ -z "$ATL_DIR" ]; then
info "searched" "Visual Studio VC/Tools/MSVC/*/atlmfc/include and Windows
Kits/10/Include/*/atl"
else
info "ATL headers" "$ATL_DIR"
- if try_compile atl cxx "-fms-extensions -fms-compatibility -I\"$ATL_DIR\""
compile <<'EOF'
+ # Via CPATH, not -I: the path contains spaces, and try_compile word-splits
+ # its flags. cygpath -m because clang here is a native binary.
+ ATL_CPATH="$(cygpath -m "$ATL_DIR" 2>/dev/null || echo "$ATL_DIR")"
+ if CPATH="$ATL_CPATH" try_compile atl cxx "-fms-extensions
-fms-compatibility" compile <<'EOF'
#include <atlbase.h>
#include <atlcom.h>
CComModule _Module;
@@ -433,8 +455,10 @@ find_win_tool() { # find_win_tool <exe> <severity>
<what-for>
pass "$exe" "$p"
return
fi
- p="$(find "/c/Program Files (x86)/Windows Kits/10/bin" "/c/Program
Files/Windows Kits/10/bin" \
- -maxdepth 3 -iname "$exe" 2>/dev/null | head -1)"
+ # x64 first: the SDK ships arm/ and arm64/ copies that cannot run here.
+ local roots=("/c/Program Files (x86)/Windows Kits/10/bin" "/c/Program
Files/Windows Kits/10/bin")
+ p="$(find "${roots[@]}" -maxdepth 3 -ipath "*/x64/$exe" 2>/dev/null | sort
-r | head -1)"
+ [ -n "$p" ] || p="$(find "${roots[@]}" -maxdepth 3 -iname "$exe"
2>/dev/null | head -1)"
if [ -n "$p" ]; then
warn "$exe not on PATH" "found at $p -- add its directory to PATH"
else