mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
7ae25febbb
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 <noreply@anthropic.com>
118 lines
4.4 KiB
YAML
118 lines
4.4 KiB
YAML
# https://github.com/actions/runner-images#available-images
|
|
name: Build & Test
|
|
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
GCC-CLANG:
|
|
name: "${{ matrix.os }}-${{ matrix.altname || matrix.cc }}"
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
strategy:
|
|
fail-fast: false
|
|
max-parallel: 8
|
|
matrix:
|
|
include:
|
|
- {os: ubuntu-24.04, cc: gcc, cxx: g++}
|
|
- {os: ubuntu-24.04, cc: clang, cxx: clang++}
|
|
- {os: ubuntu-22.04, cc: gcc, cxx: g++}
|
|
- {os: ubuntu-22.04, cc: clang, cxx: clang++}
|
|
- {os: macos-15, cc: clang, cxx: clang++}
|
|
- {os: macos-14, cc: clang, cxx: clang++}
|
|
- {os: windows-2025, cc: gcc, cxx: g++, altname: "mingw-gcc"}
|
|
- {os: windows-2022, cc: gcc, cxx: g++, altname: "mingw-gcc"}
|
|
env:
|
|
MRUBY_CONFIG: ci/gcc-clang
|
|
CC: ${{ matrix.cc }}
|
|
CXX: ${{ matrix.cxx }}
|
|
LD: ${{ matrix.cc }}
|
|
steps:
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Ruby version
|
|
run: ruby -v
|
|
- name: Compiler version
|
|
run: ${{ env.CC }} --version
|
|
- name: Ensure localhost resolves on Windows
|
|
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
|
|
|
|
Cosmopolitan:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Ruby version
|
|
run: ruby -v
|
|
- name: Cache cosmocc
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
id: cache-cosmocc
|
|
with:
|
|
path: ~/cosmo
|
|
key: cosmocc-${{ runner.os }}-20260104
|
|
- name: Install cosmocc
|
|
if: steps.cache-cosmocc.outputs.cache-hit != 'true'
|
|
run: |
|
|
mkdir -p ~/cosmo && cd ~/cosmo
|
|
wget https://cosmo.zip/pub/cosmocc/cosmocc.zip
|
|
unzip cosmocc.zip
|
|
- name: Build and test
|
|
run: |
|
|
COSMO_ROOT=~/cosmo rake -m test:run:serial MRUBY_CONFIG=cosmopolitan
|
|
|
|
Windows-VC:
|
|
runs-on: windows-2022
|
|
timeout-minutes: 10
|
|
env:
|
|
MRUBY_CONFIG: ci/msvc
|
|
steps:
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Ruby version
|
|
run: ruby -v
|
|
- 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: |
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
rake -m test:run:serial
|