Skip to content

fix(gold-traces): detected launchers that run in cmd.exe on Windows - #12

Merged
kgilpin merged 4 commits into
mainfrom
fix/windows-launchers
Sep 22, 2026
Merged

kgilpin merged 4 commits into
mainfrom
fix/windows-launchers

Conversation

@kgilpin

@kgilpin kgilpin commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #8.

The record command runs through the platform's shell, which is cmd.exe on Windows. Three detected launchers did not run there.

Framework Before On Windows now Why
pytest, unittest .venv/bin/appmap-python ... (venv never found) .venv\Scripts\appmap-python .venv\Scripts\pytest pip writes appmap-python.exe; a relative command path needs backslashes in cmd.exe
maven ./mvnw test mvnw test cmd.exe reads ./mvnw as the command . with a switch. The bare name works: cmd.exe searches the current directory and adds the PATHEXT suffix itself, so it finds mvnw.cmd.
gradle ./gradlew appmap test gradlew appmap test same
rails-test bin/rails test ruby bin/rails test no extension, so PATHEXT cannot help

Nothing changes on macOS or Linux.

resolveRunner, buildCommand and planRecordCommands take a platform (default process.platform), the way detectMaxCommandLength already does, so the Windows cases are tested on any machine.

One test runs the detected wrapper launcher through the real shell (sh, or cmd.exe on the Windows runner). On Windows it also checks that ./mvnw test does not start. That is the evidence for the cmd.exe claims in #8.

🤖 Generated with Claude Code

kgilpin and others added 4 commits September 22, 2026 11:47
The record command runs through the platform's shell, which is cmd.exe on
Windows. Three detected launchers did not run there:

- venv: the file is appmap-python.exe, so the venv was never found; and a
  relative command path needs backslashes in cmd.exe
- mvnw, gradlew: cmd.exe reads ./mvnw as the command `.` with a switch; the
  bare name works, since cmd.exe searches the current directory and adds the
  PATHEXT suffix itself
- bin/rails: no extension, so it runs through ruby

resolveRunner, buildCommand and planRecordCommands take a platform (default
process.platform) so the tests cover Windows on any machine. One test runs the
detected wrapper through the real shell, and on Windows also shows that
./mvnw does not start.

Closes #8

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
They describe the sh command line, and ran with the real platform, so on the
Windows runner they got the cmd.exe forms. The Windows forms have their own
tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
appmap-ruby's rspec and minitest hooks enable recording by themselves
(DetectEnabled#enabled_by_testing? runs before the APPMAP check). APPMAP=true
enables every recording method, requests included, and the gem warns about it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@kgilpin
kgilpin merged commit a39f2b6 into main Sep 22, 2026
3 checks passed
@kgilpin
kgilpin deleted the fix/windows-launchers branch September 22, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: detected launchers (venv, mvnw, gradlew, bin/rails) do not run in cmd.exe

1 participant