Problem
TestDdevXdebugEnabled on WSL2 with docker-ce (non-Docker Desktop) currently sets xdebug_ide_location=wsl2, which tests only the "IDE inside WSL2" path. It does not test the common case where the IDE runs on the Windows side. The existing nc.exe listener (used for the Docker Desktop path) relies on a Chocolatey x86 netcat package that isn't available on ARM64 Windows.
Goal
Replace nc.exe with a cross-architecture listener (PowerShell or ncat from nmap) and extend the Windows-side listener path to cover virtioproxy mode in addition to Docker Desktop. The test should be run manually on all WSL2 networking modes (nat, mirrored, virtioproxy) and on both amd64 and arm64 Windows.
Approaches tried
PowerShell TcpListener
We attempted to use PowerShell's [System.Net.Sockets.TcpListener] as a replacement for nc.exe:
$listener = [System.Net.Sockets.TcpListener]::new([System.Net.IPAddress]::Any, 9003)
$listener.Start()
# ... AcceptTcpClient, read data, etc.
Issues encountered:
- Timing: PowerShell startup is slow (~1-2s). The test must wait for "LISTENING" output via stdout pipe before triggering the HTTP request, otherwise Xdebug's 200ms connection timeout expires before PowerShell is ready.
- Connection never received: Even with confirmed readiness (stdout pipe approach), dual-stack listening (
IPv6Any + DualMode), and correct host.docker.internal (172.20.48.1) inside the container, the PowerShell listener never received the Xdebug connection. PhpStorm listening on the same port (:::9003) works fine. The root cause is unclear — may be related to how Windows routes Hyper-V virtual switch traffic to different listener types.
- Stale processes: When the test times out, the PowerShell process must be explicitly killed or it holds the port across test runs.
The PowerShell approach works for the xdebug-diagnose interactive command (where it's used for connectivity testing), but not for the actual Xdebug protocol connection in the test.
ncat (from nmap)
ncat.exe from the nmap package has ARM64 Windows support and could replace nc.exe. The syntax differs slightly:
- nc.exe:
nc.exe -l -w 1 -p 9003
- ncat.exe:
ncat.exe -l -w 1 9003 (no -p flag)
This was not tested but is a viable alternative.
Suggested approach
- Install
nmap (which includes ncat.exe) via Chocolatey on test machines
- Replace the
nc.exe path in TestDdevXdebugEnabled with ncat.exe
- Extend the Windows-side listener to cover
IsWSL2VirtioProxyMode() in addition to IsDockerDesktop()
- Update
buildkite-testmachine-setup.md to document ncat installation
- Manually verify on all WSL2 networking modes (nat, mirrored, virtioproxy) and on both amd64 and arm64 Windows
Refs #8220
Problem
TestDdevXdebugEnabledon WSL2 with docker-ce (non-Docker Desktop) currently setsxdebug_ide_location=wsl2, which tests only the "IDE inside WSL2" path. It does not test the common case where the IDE runs on the Windows side. The existingnc.exelistener (used for the Docker Desktop path) relies on a Chocolatey x86netcatpackage that isn't available on ARM64 Windows.Goal
Replace
nc.exewith a cross-architecture listener (PowerShell orncatfrom nmap) and extend the Windows-side listener path to cover virtioproxy mode in addition to Docker Desktop. The test should be run manually on all WSL2 networking modes (nat, mirrored, virtioproxy) and on both amd64 and arm64 Windows.Approaches tried
PowerShell TcpListener
We attempted to use PowerShell's
[System.Net.Sockets.TcpListener]as a replacement fornc.exe:Issues encountered:
IPv6Any+DualMode), and correcthost.docker.internal(172.20.48.1) inside the container, the PowerShell listener never received the Xdebug connection. PhpStorm listening on the same port (:::9003) works fine. The root cause is unclear — may be related to how Windows routes Hyper-V virtual switch traffic to different listener types.The PowerShell approach works for the
xdebug-diagnoseinteractive command (where it's used for connectivity testing), but not for the actual Xdebug protocol connection in the test.ncat (from nmap)
ncat.exefrom the nmap package has ARM64 Windows support and could replacenc.exe. The syntax differs slightly:nc.exe -l -w 1 -p 9003ncat.exe -l -w 1 9003(no-pflag)This was not tested but is a viable alternative.
Suggested approach
nmap(which includesncat.exe) via Chocolatey on test machinesnc.exepath inTestDdevXdebugEnabledwithncat.exeIsWSL2VirtioProxyMode()in addition toIsDockerDesktop()buildkite-testmachine-setup.mdto documentncatinstallationRefs #8220