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 d407927477 Stop three probes from failing on their own construction
d407927477 is described below

commit d40792747710d7b74f4b884abca6a7a283a37646
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Aug 11 13:45:06 2026 -0400

    Stop three probes from failing on their own construction
    
    The SEH probe withheld -fms-extensions, so it measured whether __try parses
    without the flag that enables it; the header probes compiled as C, 
standalone,
    which no non-self-contained or template-bearing Windows header survives.  
Show
    the diagnostics on failure too -- a fixed head -n loses them behind the 
include
    chain, which is how the ATL result stayed unreadable.
---
 msys2-probe.sh | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/msys2-probe.sh b/msys2-probe.sh
index 05e15a7112..32a3a66849 100755
--- a/msys2-probe.sh
+++ b/msys2-probe.sh
@@ -103,7 +103,15 @@ try_compile() {
     return 0
 }
 
-show_log() { [ -s "$TMP/$1.log" ] && sed -n '1,6p' "$TMP/$1.log" | sed 's/^/   
        | /'; }
+# Head for the include chain (which header dragged in what), then the actual
+# diagnostics -- on a deep chain the errors fall well past any fixed head -n.
+show_log() {
+    local f="$TMP/$1.log"
+    [ -s "$f" ] || return 0
+    sed -n '1,4p' "$f" | sed 's/^/           | /'
+    grep -m 6 'error:' "$f" | sed 's/^/           | > /'
+    return 0
+}
 
 # ---------------------------------------------------------------- preflight --
 
@@ -289,7 +297,7 @@ echo "  These decide CLANG64 vs the GCC environments.  A 
failure here does not"
 echo "  mean 'try GCC instead' -- it means source changes at the sites listed."
 
 head2 "SEH (__try/__except) -- 17 sites in vcl/win, sal/osl/w32, dtrans"
-if try_compile seh c "-O1" run <<'EOF'
+if try_compile seh c "-fms-extensions -O1" run <<'EOF'
 #include <windows.h>
 static int probe(void) {
     int r = 0;
@@ -380,11 +388,14 @@ head1 "5. mingw-w64 Win32 API coverage"
 probe_header() {  # probe_header <header> <severity> <what-it-is-for>
     local h="$1" sev="$2" what="$3" name
     name="hdr_$(echo "$h" | tr './' '__')"
-    if printf '#include <%s>\nint main(void){return 0;}\n' "$h" | \
-        try_compile "$name" c "-fms-extensions" compile; then
+    # C++ and windows.h first: several of these (uxtheme.h, comdef.h) are not
+    # self-contained, and comdef.h's _com_ptr_t is a template.
+    if printf '#include <windows.h>\n#include <%s>\nint main(void){return 
0;}\n' "$h" | \
+        try_compile "$name" cxx "-fms-extensions" compile; then
         pass "$h" "$what"
     else
         fail "$h not usable" "$what" "$sev"
+        show_log "$name"
     fi
 }
 
@@ -460,7 +471,12 @@ find_win_tool() {  # find_win_tool <exe> <severity> 
<what-for>
     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"
+        case "$p" in
+            */arm/*|*/arm64/*)
+                fail "$exe present only as an $(basename "$(dirname "$p")") 
build" \
+                     "$p cannot execute on x64 -- install the SDK's x64 MSI 
tools" "$sev" ;;
+            *)  warn "$exe not on PATH" "found at $p -- add its directory to 
PATH" ;;
+        esac
     else
         fail "$exe not found" "$what" "$sev"
     fi

Reply via email to