CI: find clang-c/Index.h and libclang where Ubuntu and Homebrew keep them; the language server on Windows paths

CI has failed since the embed merge (2026-10-25):
- Linux: bootstrap/build.sh asks llvm-config for the folder with clang-c/Index.h
- macOS: FINCH_LIBCLANG's -L folders also go to the compiler's own link "clang"
- Windows: the language server turns file:///C:/x into C:/x and back (diagnostics went to /C:/x);
  the -g tests compare without \r; shared.sh (dlopen, -rdynamic) is not run there

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016GzNP6r8dg6WDxUVZy8wjL
This commit is contained in:
Nexoniarz 2026-10-29 11:42:18 +01:00
commit 72e96a3f71
4 changed files with 33 additions and 7 deletions

View file

@ -84,7 +84,8 @@ init = c.request("initialize", {"processId": None, "rootUri": None, "capabilitie
check("initialize", init["capabilities"]["hoverProvider"] is True)
c.notify("initialized", {})
c.notify("textDocument/didOpen", {"textDocument": {"uri": uri, "languageId": "finch", "version": 1, "text": src}})
check("no errors in a good file", c.diagnostics(uri) == [])
first = c.diagnostics(uri)
check("no errors in a good file", first == [], first)
h = c.request("textDocument/hover", {"textDocument": td, "position": pos(12, "total")})
check("hover: variable type", h and "int total" in h["contents"]["value"], h)

View file

@ -79,7 +79,7 @@ for f in new/enums.fch new/generics.fch new/std_json.fch run/basics.fch run/meth
run/defer.fch run/c_structs.fch run/memory.fch; do
input="${f%.fch}.in"
[ -f "$input" ] || input=/dev/null
if "$FINCH" build "$f" -g -O0 -o "$tmp/progg" > "$tmp/err" 2>&1 && [ "$("$tmp/progg" < "$input" 2>&1)" == "$(cat "${f%.fch}.out")" ]; then
if "$FINCH" build "$f" -g -O0 -o "$tmp/progg" > "$tmp/err" 2>&1 && [ "$("$tmp/progg" < "$input" 2>&1 | tr -d '\r')" == "$(tr -d '\r' < "${f%.fch}.out")" ]; then
pass=$((pass + 1))
else
failed=$((failed + 1))
@ -88,8 +88,12 @@ for f in new/enums.fch new/generics.fch new/std_json.fch run/basics.fch run/meth
fi
done
# a library a C program loads (finch build --shared)
if FINCH="$FINCH" ./shared.sh > "$tmp/shared.out" 2>&1; then
# a library a C program loads (finch build --shared); the test's host uses dlopen and -rdynamic, so not on Windows
# (there a DLL can't call functions of the program that loads it without an import library)
case "$(uname -s)" in MINGW*|MSYS*|CYGWIN*) skip_shared=1 ;; *) skip_shared=0 ;; esac
if [ $skip_shared = 1 ]; then
:
elif FINCH="$FINCH" ./shared.sh > "$tmp/shared.out" 2>&1; then
pass=$((pass + 1))
else
failed=$((failed + 1))