From 7ae25febbbc06a23f5d7094071a8ecf370d6ddd8 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 24 Apr 2026 01:39:08 +0900 Subject: [PATCH] gha: start DNS Client service and probe Windows localhost resolution Addrinfo.getaddrinfo on the Windows CI runners fails for "localhost" regardless of address family (diagnostic commit a69d12aa54 showed 127.0.0.1 literal resolves fine while "localhost" never does under AF_INET, AF_INET6, AF_UNSPEC, or nil). That rules out the earlier KB4057932/AF_INET hypothesis and points at the Dnscache service being stopped on the runner image. Start Dnscache if not already running (and set it to Automatic), then Resolve-DnsName localhost to print the OS-level resolver view to the log. Existing hosts file and diagnostic assert stay in place so the single CI round exposes both the service state and its effect on getaddrinfo. Co-authored-by: Claude --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74ba156bf..357640261 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,8 +42,18 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | + Write-Host "=== Dnscache service state (before) ===" + Get-Service Dnscache | Format-List Name, Status, StartType + if ((Get-Service Dnscache).Status -ne 'Running') { + Set-Service -Name Dnscache -StartupType Automatic + Start-Service -Name Dnscache + } + Write-Host "=== Dnscache service state (after) ===" + Get-Service Dnscache | Format-List Name, Status, StartType Add-Content -Path $env:WINDIR\System32\drivers\etc\hosts -Value "127.0.0.1 localhost" Add-Content -Path $env:WINDIR\System32\drivers\etc\hosts -Value "::1 localhost" + Write-Host "=== Resolve-DnsName localhost ===" + Resolve-DnsName localhost -ErrorAction Continue | Format-List - name: Build and test run: rake -m test:run:serial @@ -88,8 +98,18 @@ jobs: - name: Ensure localhost resolves shell: pwsh run: | + Write-Host "=== Dnscache service state (before) ===" + Get-Service Dnscache | Format-List Name, Status, StartType + if ((Get-Service Dnscache).Status -ne 'Running') { + Set-Service -Name Dnscache -StartupType Automatic + Start-Service -Name Dnscache + } + Write-Host "=== Dnscache service state (after) ===" + Get-Service Dnscache | Format-List Name, Status, StartType Add-Content -Path $env:WINDIR\System32\drivers\etc\hosts -Value "127.0.0.1 localhost" Add-Content -Path $env:WINDIR\System32\drivers\etc\hosts -Value "::1 localhost" + Write-Host "=== Resolve-DnsName localhost ===" + Resolve-DnsName localhost -ErrorAction Continue | Format-List - name: Build and test shell: cmd run: |