From e65b3a8e60193b453f27689e58e0415eb408caf9 Mon Sep 17 00:00:00 2001 From: Shreyasg13 Date: Fri, 9 Oct 2026 17:32:26 -0400 Subject: [PATCH] scripts: fix client-conformance.sh on Windows and with a relative --result_dir client-conformance.sh fails every client check in two cases. On Windows, it builds the client as `conformance-client` with no extension. The conformance runner starts `--command` through cmd.exe, which can't run a file without `.exe`, so all 42 checks fail with "'.../conformance-client' is not recognized as an internal or external command". The script now appends `go env GOEXE`, which is ".exe" on Windows and empty elsewhere. With a relative --result_dir, such as `./conformance-results` from CONTRIBUTING.md, the script cds into that directory and then passes the same relative path in `--command`, so the client is not found on any OS. The script now resolves --result_dir to an absolute path first. CI is unaffected: its client job runs the runner directly with `go run ./conformance/everything-client`. AI disclosure: this change was written with Claude Code (Claude Opus 5.5). Co-Authored-By: Claude Opus 5.5 --- scripts/client-conformance.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/client-conformance.sh b/scripts/client-conformance.sh index fef74ca96..4867a1690 100755 --- a/scripts/client-conformance.sh +++ b/scripts/client-conformance.sh @@ -57,13 +57,17 @@ done # Set up the work directory. if [ -n "$RESULT_DIR" ]; then mkdir -p "$RESULT_DIR" + # Make the path absolute: the tests run from inside it (see below). + RESULT_DIR=$(cd "$RESULT_DIR" && pwd) WORKDIR="$RESULT_DIR" else WORKDIR=$(mktemp -d) fi -# Build the conformance server. -go build -o "$WORKDIR/conformance-client" ./conformance/everything-client +# Build the conformance client. GOEXE is ".exe" on Windows, where the +# conformance runner can only launch the client with that extension. +CLIENT="$WORKDIR/conformance-client$(go env GOEXE)" +go build -o "$CLIENT" ./conformance/everything-client # Run conformance tests from the work directory to avoid writing results to the repo. echo "Running conformance tests..." @@ -71,13 +75,13 @@ if [ -n "$CONFORMANCE_REPO" ]; then # Run from local checkout using npm run start. (cd "$WORKDIR" && \ npm --prefix "$CONFORMANCE_REPO" run start -- \ - client --command "$WORKDIR/conformance-client" \ + client --command "$CLIENT" \ --suite "$SUITE" \ ${RESULT_DIR:+--output-dir "$RESULT_DIR"}) || FINAL_EXIT_CODE=$? else (cd "$WORKDIR" && \ npx @modelcontextprotocol/conformance@latest \ - client --command "$WORKDIR/conformance-client" \ + client --command "$CLIENT" \ --suite "$SUITE" \ ${RESULT_DIR:+--output-dir "$RESULT_DIR"}) || FINAL_EXIT_CODE=$? fi